示例#1
0
void updatePMLHFieldUtilHz(int xStart, int xEnd, int yStart, int yEnd, int zStart, int zEnd, int xBound, int yBound, int zBound, pmlConstStruct cx[], pmlConstStruct cy[], pmlConstStruct cz[], int n){
		
	int i, j, k; // These are the indexes
	int x,y,z;// There are indexes for the pmlConstStruct indexs
	long p;
	int m;
	double bzStore;
	double mu;
// Either this, or make cOnes a bigger array with number of elements which are the max of xLen, yLen, zLen
	for (i=xStart;i<xEnd+1;i++){
		x = abs(xBound - i)%PML_LAYERS;	
	for (j=yStart;j<yEnd+1;j++){
		y = abs(yBound - j)%PML_LAYERS;		
	for (k=zStart;k<zEnd+1;k++){
		z = abs(zBound - k)%PML_LAYERS;
			
		p = PMLINDEX(i,j,k);
		bzStore = BZ(p);
	
		mu = MUR(m)*MUNOT;
				
		BZ(p)     = cx[x].c1*BZ(p) + cx[x].c2*(EX(i,j+1,k) - EX(i,j,k) + EY(i,j,k) - EY(i+1,j,k) - MSZ(m));
		HZ(i,j,k) = cy[y].c3*HZ(i,j,k) + cy[y].c4*(cz[z].c5*BZ(p)-cz[z].c6*bzStore)/mu; 
	}}} // end for

}// end updatePMLHFieldUtilHz
示例#2
0
void updatePMLEFieldUtilEy(int xStart, int xEnd, int yStart, int yEnd, int zStart, int zEnd, int xBound, int yBound, int zBound, pmlConstStruct cx[], pmlConstStruct cy[], pmlConstStruct cz[], int n){
		
	int i, j, k; // These are the indexes
	int x,y,z;// There are indexes for the pmlConstStruct indexs
	long p;
	int m;
	double dyStore;
	double eps;
	for (i=xStart;i<xEnd+1;i++){
		x = abs(xBound - i)%PML_LAYERS;	
	for (j=yStart;j<yEnd+1;j++){
		y = abs(yBound - j)%PML_LAYERS;	
	for (k=zStart;k<zEnd+1;k++){
		z = abs(zBound - k)%PML_LAYERS;
			
		p = PMLINDEX(i,j,k);
		dyStore = DY(p);					
	
		m = MATERIALINDEX(i,j,k);
		eps = EPSR(m)*EPSNOT;
				
		DY(p)     = cz[z].c1*DY(p) + cz[z].c2*(HX(i,j,k) - HX(i,j,k-1) + HZ(i-1,j,k) - HZ(i,j,k) - JSY(m));
		EY(i,j,k) = cx[x].c3*EY(i,j,k) + cx[x].c4*(cy[y].c5*DY(p)-cy[y].c6*dyStore)/eps; 

	}}} // end for

}// end updatePMLEFieldUtilEy
示例#3
0
文件: fdtdTE_upml.c 项目: rennone/C
static inline void calcJD(void)
{
  for(int i=1; i<N_PX-1; i++){
    for(int j=1; j<N_PY-1; j++){
      double complex nowJx = JX(i,j);
      Jx[ind(i,j)] = CJX(i,j)*JX(i,j) + CJXHZ(i,j)*(HZ(i,j) - HZ(i,j-1));
      Dx[ind(i,j)] = CDX(i,j)*DX(i,j) + CDXJX1(i,j)*JX(i,j) - CDXJX0(i,j)*nowJx;
    }
  }
  
  for(int i=1; i<N_PX-1; i++){
    for(int j=1; j<N_PY-1; j++){
      double complex nowJy = JY(i,j);
      Jy[ind(i,j)] = CJY(i,j)*JY(i,j) + CJYHZ(i,j)*(-HZ(i,j) + HZ(i-1,j));
      Dy[ind(i,j)] = CDY(i,j)*DY(i,j) + CDYJY1(i,j)*JY(i,j) - CDYJY0(i,j)*nowJy;
    }
  }
}
示例#4
0
void
allocate_explosions (void)
{
  XSALLOC_ARRAY (square_explo_state, lvl.square_count, EXPLOSION_UNTRIGGERED);
  XMALLOC_ARRAY (square_explo_type, lvl.square_count);
  explo_list_max = 64;
  explo_list_first_unused = 0;
  XMALLOC_ARRAY (explo_list, explo_list_max);
  explo_timer = new_htimer (T_GLOBAL, HZ (70));
  explo_time = 0;
}
PhoenixBase::PhoenixBase(){
	
	//----------Initialize Member Objects----------------
	m_Bot = new PhoenixRobot();
	m_ControlBoard = new PhoenixControlBoard();
	m_OpController = new OperatorController(m_ControlBoard);
	m_Constants = PhoenixConstants::GetInstance();
	//m_WinchState = Winch::UNLOCKING;
		
	//-----------------------------------------------------
	SetPeriod(HZ(ROBOT_HZ));
	GetWatchdog().SetEnabled(false);
	printf("Done constructing PhoenixBase!\n");
}
示例#6
0
文件: fader.c 项目: gcwnow/heroes
void
init_fader (void)
{
  dmsg (D_FADER, "initialize fader");
  fader.from = 0;
  fader.to = 0;
  fader.kind = F_NONE;
  fader.color = F_BLACK;
  fader.timer = new_htimer (T_LOCAL, HZ (70));
  fader.duration = 0;
  fader.last_step = -1;
  fader.status_ptr = 0;
  fader.delay = 0;
}
示例#7
0
void updatePMLEFieldUtilAll(int xStart, int xEnd, int yStart, int yEnd, int zStart, int zEnd, int xBound, int yBound, int zBound, pmlConstStruct cx[], pmlConstStruct cy[], pmlConstStruct cz[], int n){
		
	int i, j, k; // These are the indexes
	int x,y,z;// There are indexes for the pmlConstStruct indexs
	long p;
	int m;
	double dxStore, dyStore, dzStore;
	double eps;
// Either this, or make cOnes a bigger array with number of elements which are the max of xLen, yLen, zLen
	for (i=xStart;i<xEnd+1;i++){
		x = abs(xBound - i)%PML_LAYERS;	
	for (j=yStart;j<yEnd+1;j++){
		y = abs(yBound - j)%PML_LAYERS;		
	for (k=zStart;k<zEnd+1;k++){
		z = abs(zBound - k)%PML_LAYERS;
			
		//printf("(i,j,k) (%d, %d, %d), (x,y,z) (%d,%d,%d)\n", i,j,k,x,y,z);
		p = PMLINDEX(i,j,k);

		dxStore = DX(p);					
		dyStore = DY(p);					
		dzStore = DZ(p);			
	
		m = MATERIALINDEX(i,j,k);
		eps = EPSR(m)*EPSNOT;
				
		DX(p)     = cy[y].c1*DX(p) + cy[y].c2*(HZ(i,j,k) - HZ(i,j-1,k) - HY(i,j,k) + HY(i,j,k-1) - JSX(m));
		EX(i,j,k) = cz[z].c3*EX(i,j,k) + cz[z].c4*(cx[x].c5*DX(p)-cx[x].c6*dxStore)/eps; 
		 
		DY(p)     = cz[z].c1*DY(p) + cz[z].c2*(HX(i,j,k) - HX(i,j,k-1) + HZ(i-1,j,k) - HZ(i,j,k) - JSY(m));
		EY(i,j,k) = cx[x].c3*EY(i,j,k) + cx[x].c4*(cy[y].c5*DY(p)-cy[y].c6*dyStore)/eps; 
		
		DZ(p)     = cx[x].c1*DZ(p) + cx[x].c2*(HY(i,j,k) - HY(i-1,j,k) - HX(i,j,k) + HX(i,j-1,k) - JSZ(m));
		EZ(i,j,k) = cy[y].c3*EZ(i,j,k) + cy[y].c4*(cz[z].c5*DZ(p)-cz[z].c6*dzStore)/eps; 
	}}} // end for

}// end updatePMLEFieldUtilAll
示例#8
0
文件: sound.c 项目: pepone42/gngb
void init_freq_table(void)
{
  int i;
  long double y;

  for(i=0;i<2048;i++) {
    freq_table[i]=sample_rate/HZ(i);
    freq_table_m3[i]=sample_rate/HZ_M3(i);
  }

  for(i=0;i<256;i++) {
    if ((i&0x7)==0)
      y=(long double)2.0;
    else
      y=(long double)1.0/(float)(i&0x7);
    freq_table_m4[i]=1.0/(4194304.0*(1.0/8.0)*y*(1.0/(long double)(2<<(i>>4))));
  }
}
示例#9
0
	MCFG_TIMER_ADD_SCANLINE("scantimer", djboy_scanline, "screen", 0, 1)

	MCFG_CPU_ADD("cpu1", Z80, 6000000)
	MCFG_CPU_PROGRAM_MAP(cpu1_am)
	MCFG_CPU_IO_MAP(cpu1_port_am)
	MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)

	MCFG_CPU_ADD("cpu2", Z80, 6000000)
	MCFG_CPU_PROGRAM_MAP(cpu2_am)
	MCFG_CPU_IO_MAP(cpu2_port_am)
	MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)

	MCFG_CPU_ADD("beast", I80C51, 6000000)
	MCFG_CPU_IO_MAP(djboy_mcu_io_map)

	MCFG_QUANTUM_TIME(HZ(6000))

	MCFG_MACHINE_START(djboy)
	MCFG_MACHINE_RESET(djboy)

	MCFG_SCREEN_ADD("screen", RASTER)
	MCFG_SCREEN_REFRESH_RATE(57.5)
	MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MCFG_SCREEN_SIZE(256, 256)
	MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)

	MCFG_GFXDECODE(djboy)
	MCFG_PALETTE_LENGTH(0x200)

	MCFG_KANEKO_PANDORA_ADD("pandora", djboy_pandora_config)
示例#10
0
static MACHINE_DRIVER_START( ninjaw )

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", M68000,16000000/2)	/* 8 MHz ? */
	MDRV_CPU_PROGRAM_MAP(ninjaw_master_map)
	MDRV_CPU_VBLANK_INT("lscreen", irq4_line_hold)

	MDRV_CPU_ADD("audiocpu", Z80,16000000/4)	/* 16/4 MHz ? */
	MDRV_CPU_PROGRAM_MAP(ninjaw_sound_map)

	MDRV_CPU_ADD("sub", M68000,16000000/2)	/* 8 MHz ? */
	MDRV_CPU_PROGRAM_MAP(ninjaw_slave_map)
	MDRV_CPU_VBLANK_INT("lscreen", irq4_line_hold)

	MDRV_QUANTUM_TIME(HZ(6000))	/* CPU slices */

	MDRV_MACHINE_START(ninjaw)
	MDRV_MACHINE_RESET(ninjaw)

	/* video hardware */
	MDRV_GFXDECODE(ninjaw)
	MDRV_PALETTE_LENGTH(4096*3)
	MDRV_DEFAULT_LAYOUT(layout_darius)

	MDRV_SCREEN_ADD("lscreen", RASTER)
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_SIZE(36*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 3*8, 31*8-1)
示例#11
0
	MDRV_CPU_ADD("maincpu", M68010, XTAL_12MHz / 2)
	MDRV_CPU_PROGRAM_MAP(tomcat_map)
	MDRV_CPU_VBLANK_INT_HACK(irq1_line_assert, 5)
	//MDRV_CPU_PERIODIC_INT(irq1_line_assert, (double)XTAL_12MHz / 16 / 16 / 16 / 12)

	MDRV_CPU_ADD("dsp", TMS32010, XTAL_16MHz)
	MDRV_CPU_PROGRAM_MAP( dsp_map)
	MDRV_CPU_IO_MAP( dsp_io_map)

	MDRV_CPU_ADD("soundcpu", M6502, XTAL_14_31818MHz / 8 )
	MDRV_DEVICE_DISABLE()
	MDRV_CPU_PROGRAM_MAP( sound_map)

	MDRV_RIOT6532_ADD("riot", XTAL_14_31818MHz / 8, tomcat_riot6532_intf)

	MDRV_QUANTUM_TIME(HZ(4000))

	MDRV_MACHINE_START(tomcat)

	MDRV_NVRAM_HANDLER(tomcat)

	MDRV_M48T02_ADD( "m48t02" )

	MDRV_SCREEN_ADD("screen", VECTOR)
	MDRV_SCREEN_REFRESH_RATE(40)
	//MDRV_SCREEN_REFRESH_RATE((double)XTAL_12MHz / 16 / 16 / 16 / 12  / 5 )
	MDRV_SCREEN_SIZE(400, 300)
	MDRV_SCREEN_VISIBLE_AREA(0, 280, 0, 250)

	MDRV_VIDEO_START(avg_tomcat)
	MDRV_VIDEO_UPDATE(vector)
示例#12
0
	},
	irqhandler
};

static MACHINE_DRIVER_START( psychic5 )

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", Z80, XTAL_12MHz/2)
	MDRV_CPU_PROGRAM_MAP(psychic5_main_map)
	MDRV_CPU_VBLANK_INT_HACK(psychic5_interrupt,2)

	MDRV_CPU_ADD("audiocpu", Z80, XTAL_12MHz/2)
	MDRV_CPU_PROGRAM_MAP(psychic5_sound_map)
	MDRV_CPU_IO_MAP(psychic5_soundport_map)

	MDRV_QUANTUM_TIME(HZ(600))      /* Allow time for 2nd cpu to interleave */
	MDRV_MACHINE_RESET(psychic5)

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(53.8)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	/* frames per second hand tuned to match game and music speed */
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
	MDRV_SCREEN_SIZE(32*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)

	MDRV_GFXDECODE(psychic5)
	MDRV_PALETTE_LENGTH(768)

	MDRV_VIDEO_START(psychic5)
示例#13
0
}

static MACHINE_DRIVER_START( raiden )

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */
	MDRV_CPU_PROGRAM_MAP(main_map)
	MDRV_CPU_VBLANK_INT("screen", raiden_interrupt)

	MDRV_CPU_ADD("sub", V30,XTAL_20MHz/2) /* NEC V30 CPU, 20MHz verified on pcb */
	MDRV_CPU_PROGRAM_MAP(sub_map)
	MDRV_CPU_VBLANK_INT("screen", raiden_interrupt)

	SEIBU_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */

	MDRV_QUANTUM_TIME(HZ(12000))

	MDRV_MACHINE_RESET(seibu_sound)

	/* video hardware */
	MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)

	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(59.60)    /* verified on pcb */
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(32*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)

	MDRV_GFXDECODE(raiden)
	MDRV_PALETTE_LENGTH(2048)
示例#14
0
}

static MACHINE_DRIVER_START( zerozone )

	/* driver data */
	MDRV_DRIVER_DATA(zerozone_state)

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", M68000, 10000000)	/* 10 MHz */
	MDRV_CPU_PROGRAM_MAP(main_map)
	MDRV_CPU_VBLANK_INT("screen", irq1_line_hold)

	MDRV_CPU_ADD("audiocpu", Z80, 1000000)	/* 1 MHz ??? */
	MDRV_CPU_PROGRAM_MAP(sound_map)

	MDRV_QUANTUM_TIME(HZ(600))

	MDRV_MACHINE_START(zerozone)
	MDRV_MACHINE_RESET(zerozone)

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(64*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(1*8, 47*8-1, 2*8, 30*8-1)

	MDRV_GFXDECODE(zerozone)
	MDRV_PALETTE_LENGTH(256)
示例#15
0
	/* driver data */
	MDRV_DRIVER_DATA(dassault_state)

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", M68000, 14000000) /* Accurate */
	MDRV_CPU_PROGRAM_MAP(dassault_map)
	MDRV_CPU_VBLANK_INT("screen", irq4_line_hold)

	MDRV_CPU_ADD("sub", M68000, 14000000) /* Accurate */
	MDRV_CPU_PROGRAM_MAP(dassault_sub_map)
	MDRV_CPU_VBLANK_INT("screen", irq5_line_hold)

	MDRV_CPU_ADD("audiocpu", H6280,32220000/8)	/* Accurate */
	MDRV_CPU_PROGRAM_MAP(sound_map)

	MDRV_QUANTUM_TIME(HZ(8400)) /* 140 CPU slices per frame */

	/* video hardware */
	MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)

	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
	MDRV_SCREEN_SIZE(40*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)

	MDRV_GFXDECODE(dassault)
	MDRV_PALETTE_LENGTH(4096)

	MDRV_VIDEO_UPDATE(dassault)
示例#16
0
MDRV_CPU_CONFIG(vgb_config)
MDRV_CPU_PROGRAM_MAP(vgbmem)

MDRV_CPU_ADD("drmath", AM29000, XTAL_32MHz / 2)
MDRV_CPU_PROGRAM_MAP(drmath_prg)
MDRV_CPU_DATA_MAP(drmath_data)

MDRV_CPU_ADD("audiocpu", I8051, XTAL_11_0592MHz)
MDRV_CPU_PROGRAM_MAP(soundmem_prg)
MDRV_CPU_IO_MAP(soundmem_io)

MDRV_DUART68681_ADD("duart68681", XTAL_3_6864MHz, micro3d_duart68681_config)

MDRV_MACHINE_RESET(micro3d)
MDRV_NVRAM_HANDLER(generic_0fill)
MDRV_QUANTUM_TIME(HZ(3000))

MDRV_PALETTE_LENGTH(4096)

MDRV_SCREEN_ADD("screen", RASTER)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_RAW_PARAMS(XTAL_40MHz/8*4, 192*4, 0, 144*4, 434, 0, 400)

MDRV_VIDEO_START(micro3d)
MDRV_VIDEO_RESET(micro3d)
MDRV_VIDEO_UPDATE(tms340x0)

MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")

MDRV_SOUND_ADD("upd7759", UPD7759, XTAL_640kHz)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.35)
示例#17
0
	MCFG_CPU_ADD("cpua", Z80, 6000000)
	MCFG_CPU_PROGRAM_MAP(cpua_map)
	MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)

	MCFG_CPU_ADD("cpub", Z80, 6000000)
	MCFG_CPU_PROGRAM_MAP(cpub_map)
	MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)

	MCFG_CPU_ADD("cpuc", Z80, 6000000)
	MCFG_CPU_PROGRAM_MAP(cpuc_map)
	MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)

	MCFG_CPU_ADD("audiocpu", Z80, 4000000)
	MCFG_CPU_PROGRAM_MAP(sound_map)

	MCFG_QUANTUM_TIME(HZ(600))	/* 10 CPU slices per frame - enough for the sound CPU to read all commands */

	/* video hardware */
	MCFG_SCREEN_ADD("screen", RASTER)
	MCFG_SCREEN_REFRESH_RATE(60)
	MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MCFG_SCREEN_SIZE(32*8, 32*8)
	MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)

	MCFG_GFXDECODE(exzisus)
	MCFG_PALETTE_LENGTH(1024)

	MCFG_PALETTE_INIT(RRRR_GGGG_BBBB)
	MCFG_VIDEO_UPDATE(exzisus)
示例#18
0
static MACHINE_DRIVER_START( gaplus )

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", M6809,	24576000/16)	/* 1.536 MHz */
	MDRV_CPU_PROGRAM_MAP(cpu1_map)
	MDRV_CPU_VBLANK_INT("screen", gaplus_interrupt_1)

	MDRV_CPU_ADD("sub", M6809,	24576000/16)	/* 1.536 MHz */
	MDRV_CPU_PROGRAM_MAP(cpu2_map)
	MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)

	MDRV_CPU_ADD("sub2", M6809, 24576000/16)	/* 1.536 MHz */
	MDRV_CPU_PROGRAM_MAP(cpu3_map)
	MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)

	MDRV_QUANTUM_TIME(HZ(6000))	/* a high value to ensure proper synchronization of the CPUs */
	MDRV_MACHINE_RESET(gaplus)

	MDRV_NAMCO56XX_ADD("56xx", intf0_lamps)
	MDRV_NAMCO58XX_ADD("58xx", intf1)

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60.606060)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(36*8, 28*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)

	MDRV_GFXDECODE(gaplus)
	MDRV_PALETTE_LENGTH(64*4+64*8)
示例#19
0
	/* basic machine hardware */
	MCFG_CPU_ADD("maincpu", M68000,24000000/2)	/* 12 MHz */
	MCFG_CPU_PROGRAM_MAP(overdriv_master_map)
	MCFG_CPU_VBLANK_INT_HACK(cpuA_interrupt,4)	/* ??? IRQ 4 is vblank, IRQ 5 of unknown origin */

	MCFG_CPU_ADD("sub", M68000,24000000/2)	/* 12 MHz */
	MCFG_CPU_PROGRAM_MAP(overdriv_slave_map)
	MCFG_CPU_VBLANK_INT("screen", cpuB_interrupt)	/* IRQ 5 and 6 are generated by the main CPU. */
								/* IRQ 5 is used only in test mode, to request the checksums of the gfx ROMs. */
	MCFG_CPU_ADD("audiocpu", M6809,3579545/2)	/* 1.789 MHz?? This might be the right speed, but ROM testing */
						/* takes a little too much (the counter wraps from 0000 to 9999). */
						/* This might just mean that the video refresh rate is less than */
						/* 60 fps, that's how I fixed it for now. */
	MCFG_CPU_PROGRAM_MAP(overdriv_sound_map)

	MCFG_QUANTUM_TIME(HZ(12000))

	MCFG_MACHINE_START(overdriv)
	MCFG_MACHINE_RESET(overdriv)

	MCFG_EEPROM_ADD("eeprom", eeprom_intf)
	MCFG_EEPROM_DATA(overdriv_default_eeprom, 128)

	/* video hardware */
	MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)

	MCFG_SCREEN_ADD("screen", RASTER)
	MCFG_SCREEN_REFRESH_RATE(59)
	MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MCFG_SCREEN_SIZE(64*8, 32*8)
示例#20
0
	MDRV_DRIVER_DATA(f1gp_state)

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu",M68000,XTAL_20MHz/2)	/* verified on pcb */
	MDRV_CPU_PROGRAM_MAP(f1gp_cpu1_map)
	MDRV_CPU_VBLANK_INT("screen", irq1_line_hold)

	MDRV_CPU_ADD("sub", M68000,XTAL_20MHz/2)	/* verified on pcb */
	MDRV_CPU_PROGRAM_MAP(f1gp_cpu2_map)
	MDRV_CPU_VBLANK_INT("screen", irq1_line_hold)

	MDRV_CPU_ADD("audiocpu", Z80,XTAL_20MHz/4)	/* verified on pcb */
	MDRV_CPU_PROGRAM_MAP(sound_map)
	MDRV_CPU_IO_MAP(sound_io_map)

	MDRV_QUANTUM_TIME(HZ(6000)) /* 100 CPU slices per frame */

	MDRV_MACHINE_START(f1gp)
	MDRV_MACHINE_RESET(f1gp)

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(64*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)

	MDRV_GFXDECODE(f1gp)
	MDRV_PALETTE_LENGTH(2048)

	MDRV_VIDEO_START(f1gp)
示例#21
0
	GFXDECODE_ENTRY( "gfx1", 0x000000, wrally_tilelayout16, 0, 64*8 )
GFXDECODE_END


static MACHINE_DRIVER_START( wrally )
	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", M68000,XTAL_24MHz/2)		/* verified on pcb */
	MDRV_CPU_PROGRAM_MAP(wrally_map)
	MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)

	MDRV_CPU_ADD("mcu", DS5002FP, XTAL_24MHz/2)	/* verified on pcb */
	MDRV_CPU_CONFIG(dallas_config)
	MDRV_CPU_PROGRAM_MAP(dallas_rom)
	MDRV_CPU_IO_MAP(dallas_ram)

	MDRV_QUANTUM_TIME(HZ(38400))					/* heavy sync */

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(64*16, 32*16)
	MDRV_SCREEN_VISIBLE_AREA(8, 24*16-8-1, 16, 16*16-8-1)

	MDRV_GFXDECODE(wrally)
	MDRV_PALETTE_LENGTH(1024*8)

	MDRV_VIDEO_START(wrally)
	MDRV_VIDEO_UPDATE(wrally)
示例#22
0
static void ntff(void)
{
  const double C = LIGHT_SPEED_S;  
  const int cx = N_PX/2; //a center of field is origin
  const int cy = N_PY/2;  
  const int offset = 5;		// closed line offset
  const int tp = N_PY - N_PML - offset;	//上から-5
  const int bm = N_PML + offset;	//下から5
  const int rt = N_PX - N_PML - offset;	//右から-5
  const int lt = N_PML + offset;	//左から5
  const int len = tp-bm+1; //length
  const double RFperC = len*2;  //C = 1/√2,Rf=len*√2 => Rf/C = len*2  
  const double coef = 1.0/(4*M_PI*C);
  
  int m_e, m_h;
  double timeE = field_getTime() - 1;  //t - Δt  todo
  double timeH = field_getTime() - 0.5;  //t - Δt/2  todo
  double a_e, b_e, ab_e, a_h, b_h, ab_h;

  int ang;
  int i, j;
  for(ang=0; ang<360; ang++){
    double rad = ang*M_PI/180.0;
    double r1x = cos(rad), r1y = sin(rad);    
    //bottom side
    //normal vector n is (0,-1)
    //Js = n × H = (-Hz, 0, 0)  Ms = E × n = (0, 0, -Ex)

    for(i=lt; i<rt; i++){
      double r2x = i-cx+0.5, r2y = bm-cy;            //distance between origin to cell
      double timeShift = -(r1x*r2x + r1y*r2y)/C + RFperC;
      ntffCoef(timeE, timeShift, &m_e, &a_e, &b_e, &ab_e);
      ntffCoef(timeH, timeShift, &m_e, &a_e, &b_e, &ab_e);
      
      double complex ex = -EX(i,bm);
      double complex hz = -0.5*( HZ(i,bm) + HZ(i,bm-1) );
          
      Uz[ang][m_e-1] += ex*b_e*coef;
      Wx[ang][m_h-1] += hz*b_h*coef;
      Uz[ang][m_e]   += ex*ab_e*coef;
      Wx[ang][m_h]   += hz*ab_h*coef;
      Uz[ang][m_e+1] -= ex*a_e*coef;
      Wx[ang][m_h+1] -= hz*a_h*coef;      
    }

    //top side
    //normal vector n is (0,1)
    //Js = n × H = (Hz, 0, 0)  Ms = E × n = (0, 0, Ex)
    for(i=lt; i<rt; i++){
      double r2x = i-cx+0.5, r2y = tp-cy;
      double timeShift = -(r1x*r2x + r1y*r2y)/C + RFperC;      
      ntffCoef(timeE, timeShift, &m_e, &a_e, &b_e, &ab_e);
      ntffCoef(timeH, timeShift, &m_h, &a_h, &b_h, &ab_h);

      double complex ex = EX(i,bm);
      double complex hz = 0.5*( HZ(i,tp) + HZ(i,tp-1) );

      Uz[ang][m_e-1] += ex*b_e*coef;
      Wx[ang][m_h-1] += hz*b_h*coef;
      Uz[ang][m_e]   += ex*ab_e*coef;
      Wx[ang][m_h]   += hz*ab_h*coef;
      Uz[ang][m_e+1] -= ex*a_e*coef;
      Wx[ang][m_h+1] -= hz*a_h*coef;            
    }
    
    //left side
    //normal vector n is (-1,0)
    //Js = n × H = (0,Hz,0)    Ms = E × n = (0,0,Ey)
    for(j=bm; j<tp; j++){
      double r2x = lt-cx, r2y = j-cy+0.5;
      double timeShift = -(r1x*r2x + r1y*r2y)/C + RFperC;
      ntffCoef(timeE, timeShift, &m_e, &a_e, &b_e, &ab_e);
      ntffCoef(timeH, timeShift, &m_h, &a_h, &b_h, &ab_h);
      
      double complex ey = EY(lt,j);
      double complex hz = 0.5*( HZ(lt,j) + HZ(lt-1,j) );
      
      Uz[ang][m_e-1] += ey*b_e*coef;
      Wy[ang][m_h-1] += hz*b_h*coef;
      Uz[ang][m_e]   += ey*ab_e*coef;
      Wy[ang][m_h]   += hz*ab_h*coef;
      Uz[ang][m_e+1] -= ey*a_e*coef;
      Wy[ang][m_h+1] -= hz*a_h*coef;
    }

    //right side
    //normal vector n is (1,0)
    //Js = n × H = (0,-Hz,0)    Ms = E × n = (0,0,-Ey)    
    for(j=bm; j<tp; j++){
      double r2x = rt-cx, r2y = j-cy+0.5;
      double timeShift = -(r1x*r2x + r1y*r2y)/C + RFperC;
      ntffCoef(timeE, timeShift, &m_e, &a_e, &b_e, &ab_e);
      ntffCoef(timeH, timeShift, &m_h, &a_h, &b_h, &ab_h);

      double complex ey = -EY(lt,j);
      double complex hz = -0.5*( HZ(lt,j) + HZ(lt-1,j) );
      Uz[ang][m_e-1] += ey*b_e*coef;
      Wy[ang][m_h-1] += hz*b_h*coef;
      Uz[ang][m_e]   += ey*ab_e*coef;
      Wy[ang][m_h]   += hz*ab_h*coef;
      Uz[ang][m_e+1] -= ey*a_e*coef;
      Wy[ang][m_h+1] -= hz*a_h*coef;      
    }

  }
}
示例#23
0
	0 /* TODO */
};

static MACHINE_DRIVER_START( cybertnk )
	MDRV_CPU_ADD("maincpu", M68000,20000000/2)
	MDRV_CPU_PROGRAM_MAP(master_mem)
	MDRV_CPU_VBLANK_INT_HACK(master_irq,2)

	MDRV_CPU_ADD("slave", M68000,20000000/2)
	MDRV_CPU_PROGRAM_MAP(slave_mem)
	MDRV_CPU_VBLANK_INT_HACK(slave_irq,2)

	MDRV_CPU_ADD("audiocpu", Z80,3579500)
	MDRV_CPU_PROGRAM_MAP(sound_mem)

	MDRV_QUANTUM_TIME(HZ(6000))//arbitrary value,needed to get the communication to work

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(64*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 32*8-1)

	MDRV_GFXDECODE(cybertnk)
	MDRV_PALETTE_LENGTH(0x4000)

	MDRV_VIDEO_START(cybertnk)
	MDRV_VIDEO_UPDATE(cybertnk)
示例#24
0
	MCFG_CPU_VBLANK_INT("screen", kingofb_interrupt)

	MCFG_CPU_ADD("video", Z80, 4000000)        /* 4.0 MHz */
	MCFG_CPU_PROGRAM_MAP(kingobox_video_map)
	MCFG_CPU_VBLANK_INT("screen", kingofb_interrupt)

	MCFG_CPU_ADD("sprite", Z80, 4000000)        /* 4.0 MHz */
	MCFG_CPU_PROGRAM_MAP(kingobox_sprite_map)
	MCFG_CPU_VBLANK_INT("screen", kingofb_interrupt)

	MCFG_CPU_ADD("audiocpu", Z80, 4000000)        /* 4.0 MHz */
	MCFG_CPU_PROGRAM_MAP(kingobox_sound_map)
	MCFG_CPU_IO_MAP(kingobox_sound_io_map)
	MCFG_CPU_PERIODIC_INT(nmi_line_pulse, 6000)	/* Hz */

	MCFG_QUANTUM_TIME(HZ(6000)) /* We really need heavy synching among the processors */

	MCFG_MACHINE_START(kingofb)
	MCFG_MACHINE_RESET(kingofb)

	/* video hardware */
	MCFG_SCREEN_ADD("screen", RASTER)
	MCFG_SCREEN_REFRESH_RATE(60)
	MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
	MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MCFG_SCREEN_SIZE(32*8, 32*8)
	MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)

	MCFG_GFXDECODE(kingobox)
	MCFG_PALETTE_LENGTH(256+8*2)
示例#25
0
 *  Machine driver
 *
 *************************************/

static MACHINE_DRIVER_START( cloak )

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", M6502, 1000000)		/* 1 MHz ???? */
	MDRV_CPU_PROGRAM_MAP(master_map)
	MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 4)

	MDRV_CPU_ADD("slave", M6502, 1250000)		/* 1.25 MHz ???? */
	MDRV_CPU_PROGRAM_MAP(slave_map)
	MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold, 2)

	MDRV_QUANTUM_TIME(HZ(1000))

	MDRV_NVRAM_HANDLER(generic_0fill)

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(32*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 3*8, 32*8-1)

	MDRV_GFXDECODE(cloak)
	MDRV_PALETTE_LENGTH(64)

	MDRV_VIDEO_START(cloak)
示例#26
0
 *************************************/

static MACHINE_DRIVER_START( mhavoc )

	/* basic machine hardware */
	MDRV_CPU_ADD("alpha", M6502, MHAVOC_CLOCK_2_5M)		/* 2.5 MHz */
	MDRV_CPU_PROGRAM_MAP(alpha_map)

	MDRV_CPU_ADD("gamma", M6502, MHAVOC_CLOCK_1_25M)	/* 1.25 MHz */
	MDRV_CPU_PROGRAM_MAP(gamma_map)

	MDRV_MACHINE_START(mhavoc)
	MDRV_MACHINE_RESET(mhavoc)
	MDRV_NVRAM_HANDLER(generic_1fill)

	MDRV_TIMER_ADD_PERIODIC("5k_timer", mhavoc_cpu_irq_clock, HZ(MHAVOC_CLOCK_5K))

	/* video hardware */
	MDRV_SCREEN_ADD("screen", VECTOR)
	MDRV_SCREEN_REFRESH_RATE(50)
	MDRV_SCREEN_SIZE(400, 300)
	MDRV_SCREEN_VISIBLE_AREA(0, 300, 0, 260)

	MDRV_VIDEO_START(avg_mhavoc)
	MDRV_VIDEO_UPDATE(vector)

	/* sound hardware */
	MDRV_SPEAKER_STANDARD_MONO("mono")

	MDRV_SOUND_ADD("pokey1", POKEY, MHAVOC_CLOCK_1_25M)
	MDRV_SOUND_CONFIG(pokey_config)
示例#27
0
static MACHINE_DRIVER_START( vastar )

	MDRV_DRIVER_DATA(vastar_state)

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", Z80, 3072000)	/* 3.072 MHz ???? */
	MDRV_CPU_PROGRAM_MAP(main_map)
	MDRV_CPU_IO_MAP(main_port_map)
	MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)

	MDRV_CPU_ADD("sub", Z80, 3072000)	/* 3.072 MHz ???? */
	MDRV_CPU_PROGRAM_MAP(cpu2_map)
	MDRV_CPU_IO_MAP(cpu2_port_map)
	MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)	/* ??? */

	MDRV_QUANTUM_TIME(HZ(600))	/* 10 CPU slices per frame - seems enough to ensure proper */
						/* synchronization of the CPUs */
	MDRV_MACHINE_RESET(vastar)

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(32*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)

	MDRV_GFXDECODE(vastar)
	MDRV_PALETTE_LENGTH(256)

	MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
示例#28
0
文件: megazone.c 项目: nitrologic/emu
	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", M6809, 18432000/9)        /* 2 MHz */
	MDRV_CPU_PROGRAM_MAP(megazone_map)
	MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)

	MDRV_CPU_ADD("audiocpu", Z80,18432000/6)     /* Z80 Clock is derived from the H1 signal */
	MDRV_CPU_PROGRAM_MAP(megazone_sound_map)
	MDRV_CPU_IO_MAP(megazone_sound_io_map)
	MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)

	MDRV_CPU_ADD("daccpu", I8039,14318000/2)	/* 1/2 14MHz crystal */
	MDRV_CPU_PROGRAM_MAP(megazone_i8039_map)
	MDRV_CPU_IO_MAP(megazone_i8039_io_map)

	MDRV_QUANTUM_TIME(HZ(900))

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(36*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)

	MDRV_GFXDECODE(megazone)
	MDRV_PALETTE_LENGTH(16*16+16*16)

	MDRV_PALETTE_INIT(megazone)
	MDRV_VIDEO_START(megazone)
	MDRV_VIDEO_UPDATE(megazone)
示例#29
0
	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", Z80,4000000)	/* 4 MHz ??? */
	MDRV_CPU_PROGRAM_MAP(main_map)
	MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)

	MDRV_CPU_ADD("sub", Z80,4000000)	/* 4 MHz ??? */
	MDRV_CPU_PROGRAM_MAP(cpu2_map)
	MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)	/* ??? */

	MDRV_CPU_ADD("audiocpu", Z80,4000000)	/* 4 MHz ??? */
	MDRV_CPU_PROGRAM_MAP(cpu3_map)
	MDRV_CPU_IO_MAP(cpu3_port_map)
	MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)	/* ??? */

	MDRV_QUANTUM_TIME(HZ(6000))	/* 100 CPU slices per frame - an high value to ensure proper */
							/* synchronization of the CPUs */

	MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
	MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
	MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] )
	MDRV_PPI8255_ADD( "ppi8255_3", ppi8255_intf[3] )
	MDRV_PPI8255_ADD( "ppi8255_4", ppi8255_intf[4] )

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(32*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 27*8-1)
示例#30
0
文件: pacland.c 项目: nitrologic/emu


static MACHINE_DRIVER_START( pacland )

	/* basic machine hardware */
	MDRV_CPU_ADD("maincpu", M6809, 49152000/32)	/* 1.536 MHz */
	MDRV_CPU_PROGRAM_MAP(main_map)
	MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)

	MDRV_CPU_ADD("mcu", HD63701, 49152000/8)	/* 1.536 MHz? */
	MDRV_CPU_PROGRAM_MAP(mcu_map)
	MDRV_CPU_IO_MAP(mcu_port_map)
	MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)

	MDRV_QUANTUM_TIME(HZ(6000))	/* we need heavy synching between the MCU and the CPU */

	/* video hardware */
	MDRV_SCREEN_ADD("screen", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60.606060)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(64*8, 32*8)
	MDRV_SCREEN_VISIBLE_AREA(3*8, 39*8-1, 2*8, 30*8-1)

	MDRV_GFXDECODE(pacland)
	MDRV_PALETTE_LENGTH(256*4+256*4+64*16)

	MDRV_PALETTE_INIT(pacland)
	MDRV_VIDEO_START(pacland)
	MDRV_VIDEO_UPDATE(pacland)