本文整理汇总了C++中HZ函数的典型用法代码示例。如果您正苦于以下问题:C++ HZ函数的具体用法?C++ HZ怎么用?C++ HZ使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HZ函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
示例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
示例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;
}
}
}
示例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;
}
示例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");
}
示例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;
}
示例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
示例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))));
}
}
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)