本文整理汇总了C++中HZ函数的典型用法代码示例。如果您正苦于以下问题:C++ HZ函数的具体用法?C++ HZ怎么用?C++ HZ使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HZ函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: updatePMLHFieldUtilHz
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
开发者ID:vbora,项目名称:FDTD,代码行数:26,代码来源:updatePMLHFields.c
示例2: updatePMLEFieldUtilEy
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
开发者ID:vbora,项目名称:FDTD,代码行数:27,代码来源:updatePMLEFields.c
示例3: calcJD
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;
}
}
}
开发者ID:rennone,项目名称:C,代码行数:18,代码来源:fdtdTE_upml.c
示例4: allocate_explosions
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;
}
开发者ID:gcwnow,项目名称:heroes,代码行数:11,代码来源:explosions.c
示例5: PhoenixRobot
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");
}
开发者ID:team4element,项目名称:2014_Offseason_Hitmonchan,代码行数:14,代码来源:PhoenixBase.cpp
示例6: init_fader
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;
}
开发者ID:gcwnow,项目名称:heroes,代码行数:14,代码来源:fader.c
示例7: updatePMLEFieldUtilAll
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
开发者ID:vbora,项目名称:FDTD,代码行数:37,代码来源:updatePMLEFields.c
示例8: init_freq_table
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))));
}
}
开发者ID:pepone42,项目名称:gngb,代码行数:18,代码来源:sound.c
示例9: MACHINE_DRIVER_START
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)
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:30,代码来源:ninjaw.c
示例10: MDRV_CPU_ADD
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)
开发者ID:hstampfl,项目名称:mame2010-libretro,代码行数:31,代码来源:tomcat.c
示例11: MACHINE_DRIVER_START
},
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)
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:31,代码来源:psychic5.c
示例12: MACHINE_DRIVER_START
}
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)
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:31,代码来源:raiden.c
示例13: MACHINE_DRIVER_START
}
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)
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:30,代码来源:zerozone.c
示例14: MDRV_DRIVER_DATA
/* 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)
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:31,代码来源:dassault.c
示例15: MDRV_CPU_CONFIG
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)
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:31,代码来源:micro3d.c
示例16: MACHINE_DRIVER_START
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)
开发者ID:hstampfl,项目名称:mame2010-libretro,代码行数:31,代码来源:gaplus.c
示例17: MDRV_DRIVER_DATA
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)
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:31,代码来源:f1gp.c
示例18: GFXDECODE_ENTRY
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)
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:30,代码来源:wrally.c
示例19: ntff
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;
//.........这里部分代码省略.........
开发者ID:rennone,项目名称:FDTD,代码行数:101,代码来源:fdtdTE_upml.c
示例20: MACHINE_DRIVER_START
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)
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:30,代码来源:cybertnk.c
注:本文中的HZ函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论