这篇教程C++ timer_adjust函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中timer_adjust函数的典型用法代码示例。如果您正苦于以下问题:C++ timer_adjust函数的具体用法?C++ timer_adjust怎么用?C++ timer_adjust使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了timer_adjust函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: start_pulsestatic void start_pulse(TTL74123_state *chip){ attotime duration = compute_duration(chip); if (timer_running(chip)) { /* retriggering, but not if we are called to quickly */ attotime delay_time = attotime_make(0, ATTOSECONDS_PER_SECOND * chip->intf->cap * 220); if (attotime_compare(timer_timeelapsed(chip->timer), delay_time) >= 0) { timer_adjust(chip->timer, duration, 0, attotime_never); if (LOG) logerror("74123 #%d: Retriggering pulse. Duration: %f/n", chip->which, attotime_to_double(duration)); } else { if (LOG) logerror("74123 #%d: Retriggering failed./n", chip->which); } } else { /* starting */ timer_adjust(chip->timer, duration, 0, attotime_never); set_output(chip); if (LOG) logerror("74123 #%d: Starting pulse. Duration: %f/n", chip->which, attotime_to_double(duration)); }}
开发者ID:broftkd,项目名称:historic-mame,代码行数:30,
示例2: WRITE_HANDLERstatic WRITE_HANDLER(play1s_data_w) { static UINT8 oldData; static int timer_on; if (data & 0x0f) { if (oldData != data) sndlocals.volume = 100; oldData = data; discrete_sound_w(8, data & 0x01); discrete_sound_w(4, data & 0x02); discrete_sound_w(2, data & 0x04); discrete_sound_w(1, data & 0x08); if (~data & 0x10) { // start fading timer_adjust(sndlocals.timer, 0.02, 0, 0.02); timer_on = 1; } else { // no fading used timer_adjust(sndlocals.timer, TIME_NEVER, 0, 0); timer_on = 0; mixer_set_volume(0, sndlocals.volume); } } else if (!timer_on) { // no fading going on, so stop sound discrete_sound_w(8, 0); discrete_sound_w(4, 0); discrete_sound_w(2, 0); discrete_sound_w(1, 0); }}
开发者ID:chrisjubb,项目名称:pinmame,代码行数:25,
示例3: cpu_vblankcallbackstatic void cpu_vblankcallback(int param){ int cpunum; if (vblank_countdown == 1) vblank = 1; /* loop over CPUs */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { /* if the interrupt multiplier is valid */ if (cpu[cpunum].vblankint_multiplier != -1) { /* decrement; if we hit zero, generate the interrupt and reset the countdown */ if (!--cpu[cpunum].vblankint_countdown) { /* a param of -1 means don't call any callbacks */ if (param != -1) { /* if the CPU has a VBLANK handler, call it */ if (Machine->drv->cpu[cpunum].vblank_interrupt && cpu_getstatus(cpunum)) { cpuintrf_push_context(cpunum); (*Machine->drv->cpu[cpunum].vblank_interrupt)(); cpuintrf_pop_context(); } /* update the counters */ cpu[cpunum].iloops--; } /* reset the countdown and timer */ cpu[cpunum].vblankint_countdown = cpu[cpunum].vblankint_multiplier; timer_adjust(cpu[cpunum].vblankint_timer, TIME_NEVER, 0, 0); } } /* else reset the VBLANK timer if this is going to be a real VBLANK */ else if (vblank_countdown == 1) timer_adjust(cpu[cpunum].vblankint_timer, TIME_NEVER, 0, 0); } /* is it a real VBLANK? */ if (!--vblank_countdown) { /* do we update the screen now? */ if (!(Machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK)) time_to_quit = updatescreen(); /* Set the timer to update the screen */ timer_set(TIME_IN_USEC(Machine->drv->vblank_duration), 0, cpu_updatecallback); /* reset the globals */ cpu_vblankreset(); /* reset the counter */ vblank_countdown = vblank_multiplier; }}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:59,
示例4: WRITE8_HANDLERstatic WRITE8_HANDLER( polyplay_start_timer2 ){ if (data == 0x03) timer_adjust(polyplay_timer, attotime_never, 0, attotime_never); if (data == 0xb5) timer_adjust(polyplay_timer, ATTOTIME_IN_HZ(40), 0, ATTOTIME_IN_HZ(40));}
开发者ID:broftkd,项目名称:historic-mame,代码行数:8,
示例5: h8_itu_resetvoid h8_itu_reset(void){ // stop all the timers timer_adjust(h8.timer[0], TIME_NEVER, 0, 0); timer_adjust(h8.timer[1], TIME_NEVER, 0, 0); timer_adjust(h8.timer[2], TIME_NEVER, 0, 0); timer_adjust(h8.timer[3], TIME_NEVER, 0, 0); timer_adjust(h8.timer[4], TIME_NEVER, 0, 0);}
开发者ID:BirchJD,项目名称:advancemame-0.106.1-RPi,代码行数:9,
示例6: dma_timerstatic void dma_timer( int n_channel, UINT32 n_scanline ){ if( n_scanline != 0xffffffff ) { timer_adjust( m_p_timer_dma[ n_channel ], cpu_getscanlinetime( n_scanline ), n_channel, 0 ); } else { timer_adjust( m_p_timer_dma[ n_channel ], TIME_NEVER, 0, 0 ); } m_p_n_dma_lastscanline[ n_channel ] = n_scanline;}
开发者ID:kensan73,项目名称:mame2003-libretro,代码行数:12,
示例7: cpu_boost_interleavevoid cpu_boost_interleave(double timeslice_time, double boost_duration){ /* if you pass 0 for the timeslice_time, it means pick something reasonable */ if (timeslice_time < perfect_interleave) timeslice_time = perfect_interleave; LOG(("cpu_boost_interleave(%.9f, %.9f)/n", timeslice_time, boost_duration)); /* adjust the interleave timer */ timer_adjust(interleave_boost_timer, timeslice_time, 0, timeslice_time); /* adjust the end timer */ timer_adjust(interleave_boost_timer_end, boost_duration, 0, TIME_NEVER);}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:14,
示例8: gpss4_initstatic void gpss4_init(struct sndbrdData *brdData){ capTimer = timer_alloc(capTimer_timer); timer_adjust(capTimer, TIME_NEVER, 0, TIME_NEVER); /* MIXER (pins 27,25,26) = 010 */ SN76477_mixer_w(0, 2); /* ENVELOPE is constant: pin1 = hi, pin 28 = lo */ SN76477_envelope_w(0, 1); /* ENVELOPE is constant: pin1 = hi, pin 28 = lo */ SN76477_envelope_w(1, 1); SN76477_vco_w(1, 1); /* MIXER = 0 */ SN76477_mixer_w(2, 0); /* ENVELOPE is constant: pin1 = lo, pin 28 = lo */ SN76477_envelope_w(2, 0); /* MIXER = 0 */ SN76477_mixer_w(3, 0); /* ENVELOPE is constant: pin1 = lo, pin 28 = hi */ SN76477_envelope_w(3, 2); SN76477_vco_w(3, 1);}
开发者ID:mp-lee,项目名称:pinmame,代码行数:25,
示例9: cpu_updatecallbackstatic void cpu_updatecallback(int param){ /* update the screen if we didn't before */ if (Machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) time_to_quit = updatescreen(); vblank = 0; /* update IPT_VBLANK input ports */ inputport_vblank_end(); /* reset partial updating */ reset_partial_updates(); /* check the watchdog */ if (watchdog_counter > 0) if (--watchdog_counter == 0) { logerror("reset caused by the watchdog/n"); machine_reset(); } /* track total frames */ current_frame++; /* reset the refresh timer */ timer_adjust(refresh_timer, TIME_NEVER, 0, 0);}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:27,
示例10: centronics_write_handshakevoid centronics_write_handshake(int nr, int data, int mask){ CENTRONICS *This=cent+nr; int neu=(data&mask)|(This->control&(~mask)); if (neu & CENTRONICS_NO_RESET) { if ( !(This->control&CENTRONICS_STROBE) && (neu&CENTRONICS_STROBE) ) { printer_output(image_from_devtype_and_index(IO_PRINTER, nr), This->data); /* setup timer for data acknowledge */ /* set mask for data that has changed */ This->new_control_mask = CENTRONICS_ACKNOWLEDGE; /* set data that has changed */ This->new_control_data = CENTRONICS_ACKNOWLEDGE; /* setup a new timer */ timer_adjust(This->timer, TIME_IN_USEC(1), nr, 0); } } This->control=neu;}
开发者ID:Synapseware,项目名称:coco,代码行数:25,
示例11: sound_updatevoid sound_update(void){#if 0 /* forQUASI88 */ int totalsound = 0; profiler_mark(PROFILER_SOUND); while (Machine->drv->sound[totalsound].sound_type != 0 && totalsound < MAX_SOUND) { if (sndintf[Machine->drv->sound[totalsound].sound_type].update) (*sndintf[Machine->drv->sound[totalsound].sound_type].update)(); totalsound++; }#else /* forQUASI88 */ { if (sndintf[ fm_interface.sound_type ].update) (*sndintf[ fm_interface.sound_type ].update)(); if (sndintf[ beep_interface.sound_type ].update) (*sndintf[ beep_interface.sound_type ].update)(); }#endif /* forQUASI88 */ streams_sh_update(); mixer_sh_update(); timer_adjust(sound_update_timer, TIME_NEVER, 0, 0); profiler_mark(PROFILER_END);}
开发者ID:toyoshim,项目名称:quasi88nc,代码行数:33,
示例12: timer_restore/* Remove the timer handler */void timer_restore(void){ /* Restore previous timer setting */ timer_adjust(0); /* Remove the interrupt handler */ _go32_dpmi_set_protected_mode_interrupt_vector(TIMER_INT, &old_handler);}
开发者ID:nesouri,项目名称:nosefart,代码行数:9,
示例13: tmp68301_update_timervoid tmp68301_update_timer( int i ){ UINT16 TCR = tmp68301_regs[(0x200 + i * 0x20)/2]; UINT16 MAX1 = tmp68301_regs[(0x204 + i * 0x20)/2]; UINT16 MAX2 = tmp68301_regs[(0x206 + i * 0x20)/2]; int max = 0; double duration = 0; timer_adjust(tmp68301_timer[i],TIME_NEVER,i,0); /* timers 1&2 only */ switch( (TCR & 0x0030)>>4 ) /* MR2..1 */ { case 1: max = MAX1; break; case 2: max = MAX2; break; } switch ( (TCR & 0xc000)>>14 ) /* CK2..1 */ { case 0: /* System clock (CLK) */ if (max) { int scale = (TCR & 0x3c00)>>10; /* P4..1 */ if (scale > 8) scale = 8; duration = Machine->drv->cpu[0].cpu_clock; duration /= 1 << scale; duration /= max; } break; }/* logerror("CPU #0 PC %06X: TMP68301 Timer %d, duration %lf, max %04X/n",activecpu_get_pc(),i,duration,max); */ if (!(TCR & 0x0002)) /* CS */ { if (duration) timer_adjust(tmp68301_timer[i],TIME_IN_HZ(duration),i,0); else logerror("CPU #0 PC %06X: TMP68301 error, timer %d duration is 0/n",activecpu_get_pc(),i); }}
开发者ID:CrouchingLlama,项目名称:openlase-mame,代码行数:46,
示例14: schedule_next_irqINLINE void schedule_next_irq(int curscanline){ /* IRQ is clocked by /32V, so every 64 scanlines */ curscanline = (curscanline + 64) & 255; /* next one at the start of this scanline */ timer_adjust(irq_timer, video_screen_get_time_until_pos(0, curscanline, 0), curscanline, attotime_zero);}
开发者ID:broftkd,项目名称:historic-mame,代码行数:8,
示例15: cpu_firstvblankcallbackstatic void cpu_firstvblankcallback(int param){ /* now that we're synced up, pulse from here on out */ timer_adjust(vblank_timer, vblank_period, param, vblank_period); /* but we need to call the standard routine as well */ cpu_vblankcallback(param);}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:8,
示例16: europc_rtc_initvoid europc_rtc_init(void){ memset(&europc_rtc,0,sizeof(europc_rtc)); europc_rtc.data[0xf]=1; europc_rtc.timer = timer_alloc(europc_rtc_timer); timer_adjust(europc_rtc.timer, 0, 0, 1.0);}
开发者ID:BirchJD,项目名称:xmame-0.103-RPi,代码行数:8,
示例17: TIMER_CALLBACKstatic TIMER_CALLBACK( scanline_callback ){ if (param==interrupt_scanline) { if (out&0x2000) cpunum_set_input_line(0, 1, ASSERT_LINE); timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, param+1, 0), param+1, attotime_zero); interrupt_line_active = 1; } else { if (interrupt_line_active) cpunum_set_input_line(0, 1, CLEAR_LINE); timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline, attotime_zero); interrupt_line_active = 0; }}
开发者ID:broftkd,项目名称:historic-mame,代码行数:17,
示例18: adjust_timerstatic void adjust_timer(int offset) { static char s[8]; SPINBlocals.irqfreq += offset; if (SPINBlocals.irqfreq < 1) SPINBlocals.irqfreq = 1; sprintf(s, "IRQ:%4d", SPINBlocals.irqfreq); core_textOut(s, 8, 40, 0, 5); timer_adjust(SPINBlocals.irqtimer, 1.0/(double)SPINBlocals.irqfreq, 0, 1.0/(double)SPINBlocals.irqfreq);}
开发者ID:Bremma,项目名称:pinmame,代码行数:8,
示例19: WRITE8_HANDLERstatic WRITE8_HANDLER( sound_nmi_rate_w ){ /* rate is controlled by the value written here */ /* this value is latched into up-counters, which are clocked at the */ /* input clock / 256 */ attotime nmi_rate = attotime_mul(ATTOTIME_IN_HZ(4000000), 4096 * (256 - data)); timer_adjust(sound_nmi_timer, nmi_rate, 0, nmi_rate);}
开发者ID:kleopatra999,项目名称:historic-mame,代码行数:8,
示例20: z80ctc_trg_wvoid z80ctc_trg_w (int which, int trg, int offset, int data){ z80ctc *ctc = ctcs + which; int ch = trg & 3; int mode; data = data ? 1 : 0; mode = ctc->mode[ch]; /* see if the trigger value has changed */ if (data != ctc->extclk[ch]) { ctc->extclk[ch] = data; /* see if this is the active edge of the trigger */ if (((mode & EDGE) == EDGE_RISING && data) || ((mode & EDGE) == EDGE_FALLING && !data)) { /* if we're waiting for a trigger, start the timer */ if ((mode & WAITING_FOR_TRIG) && (mode & MODE) == MODE_TIMER) { double clock = ((mode & PRESCALER) == PRESCALER_16) ? ctc->invclock16 : ctc->invclock256;logerror("CTC clock %f/n",1.0/clock); if (!(ctc->notimer & (1<<ch))) timer_adjust(ctc->timer[ch], clock * (double)ctc->tconst[ch], (which << 2) + ch, clock * (double)ctc->tconst[ch]); else timer_adjust(ctc->timer[ch], TIME_NEVER, 0, 0); } /* we're no longer waiting */ ctc->mode[ch] &= ~WAITING_FOR_TRIG; /* if we're clocking externally, decrement the count */ if ((mode & MODE) == MODE_COUNTER) { ctc->down[ch]--; /* if we hit zero, do the same thing as for a timer interrupt */ if (!ctc->down[ch]) z80ctc_timercallback ((which << 2) + ch); } } }}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:45,
示例21: play2s_timer_callbackstatic void play2s_timer_callback(int n) { if (sndlocals.volume) { mixer_set_volume(sndlocals.channel, (--sndlocals.volume)); if (!sndlocals.volume) { timer_adjust(sndlocals.timer, TIME_NEVER, 0, 0); mixer_stop_sample(sndlocals.channel); } }}
开发者ID:chrisjubb,项目名称:pinmame,代码行数:9,
示例22: WRITE16_HANDLERstatic WRITE16_HANDLER( fuuki16_vregs_w ){ UINT16 old_data = fuuki16_vregs[offset]; UINT16 new_data = COMBINE_DATA(&fuuki16_vregs[offset]); if ((offset == 0x1c/2) && old_data != new_data) { timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, new_data, Machine->screen[0].visarea.max_x + 1), 0, video_screen_get_frame_period(0)); }}
开发者ID:broftkd,项目名称:historic-mame,代码行数:9,
示例23: WRITE8_HANDLERstatic WRITE8_HANDLER( sound_nmi_rate_w ){ /* rate is controlled by the value written here */ /* this value is latched into up-counters, which are clocked at the */ /* input clock / 256 */ double input_clock = TIME_IN_HZ(4000000/16); double nmi_rate = input_clock * 256 * (256 - data); timer_adjust(sound_nmi_timer, nmi_rate, 0, nmi_rate);}
开发者ID:broftkd,项目名称:historic-mess,代码行数:9,
示例24: MACHINE_RESETstatic MACHINE_RESET( pkscramble){ out = 0; interrupt_line_active=0; scanline_timer = timer_alloc(scanline_callback, NULL); timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline, attotime_zero); state_save_register_global(out); state_save_register_global(interrupt_line_active);}
开发者ID:broftkd,项目名称:historic-mame,代码行数:10,
示例25: sound_initvoid sound_init(running_machine *machine){ attotime update_frequency = SOUND_UPDATE_FREQUENCY; const char *filename; /* handle -nosound */ nosound_mode = !options_get_bool(mame_options(), OPTION_SOUND); if (nosound_mode) Machine->sample_rate = 11025; /* count the speakers */ for (totalspeakers = 0; Machine->drv->speaker[totalspeakers].tag; totalspeakers++) ; VPRINTF(("total speakers = %d/n", totalspeakers)); /* allocate memory for mix buffers */ leftmix = auto_malloc(Machine->sample_rate * sizeof(*leftmix)); rightmix = auto_malloc(Machine->sample_rate * sizeof(*rightmix)); finalmix = auto_malloc(Machine->sample_rate * sizeof(*finalmix)); /* allocate a global timer for sound timing */ sound_update_timer = timer_alloc(sound_update, NULL); timer_adjust(sound_update_timer, update_frequency, 0, update_frequency); /* initialize the streams engine */ VPRINTF(("streams_init/n")); streams_init(machine, update_frequency.attoseconds); /* now start up the sound chips and tag their streams */ VPRINTF(("start_sound_chips/n")); start_sound_chips(); /* then create all the speakers */ VPRINTF(("start_speakers/n")); start_speakers(); /* finally, do all the routing */ VPRINTF(("route_sound/n")); route_sound(); /* open the output WAV file if specified */ filename = options_get_string(mame_options(), OPTION_WAVWRITE); if (filename[0] != 0) wavfile = wav_open(filename, machine->sample_rate, 2); /* enable sound by default */ global_sound_enabled = TRUE; sound_muted = FALSE; sound_set_attenuation(options_get_int(mame_options(), OPTION_VOLUME)); /* register callbacks */ config_register("mixer", sound_load, sound_save); add_pause_callback(machine, sound_pause); add_reset_callback(machine, sound_reset); add_exit_callback(machine, sound_exit);}
开发者ID:broftkd,项目名称:historic-mame,代码行数:55,
示例26: TimerHandler_3812static void TimerHandler_3812(int c,double period){ if( period == 0 ) { /* Reset FM Timer */ timer_enable(Timer_3812[c], 0); } else { /* Start FM Timer */ timer_adjust(Timer_3812[c], period, c, 0); }}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:11,
注:本文中的timer_adjust函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ timer_adjust_oneshot函数代码示例 C++ timer_Stop函数代码示例 |