diff options
Diffstat (limited to 'src/devices')
132 files changed, 245 insertions, 249 deletions
diff --git a/src/devices/bus/a2bus/a2sd.cpp b/src/devices/bus/a2bus/a2sd.cpp index d17b1f133c7..f0c0b51ad70 100644 --- a/src/devices/bus/a2bus/a2sd.cpp +++ b/src/devices/bus/a2bus/a2sd.cpp @@ -172,11 +172,11 @@ u8 a2bus_a2sd_device::read_c0nx(u8 offset) if (m_c0n1 & C0N1_ECE) { - m_shift_timer->adjust(attotime::from_hz(14.318181_MHz_XTAL / 4), 0, attotime::from_hz(14.318181_MHz_XTAL / 4)); + m_shift_timer->adjust_periodic(attotime::from_hz(14.318181_MHz_XTAL / 4)); } else { - m_shift_timer->adjust(attotime::from_hz(500_kHz_XTAL), 0, attotime::from_hz(500_kHz_XTAL)); + m_shift_timer->adjust_periodic(attotime::from_hz(500_kHz_XTAL)); } } return m_datain; @@ -217,11 +217,11 @@ void a2bus_a2sd_device::write_c0nx(u8 offset, u8 data) // if ECE is set, clock is 3.58 MHz from the A2 bus, otherwise internally generated 500 kHz if (m_c0n1 & C0N1_ECE) { - m_shift_timer->adjust(attotime::from_hz(14.318181_MHz_XTAL / 4), 0, attotime::from_hz(14.318181_MHz_XTAL/4)); + m_shift_timer->adjust_periodic(attotime::from_hz(14.318181_MHz_XTAL / 4)); } else { - m_shift_timer->adjust(attotime::from_hz(500_kHz_XTAL), 0, attotime::from_hz(500_kHz_XTAL)); + m_shift_timer->adjust_periodic(attotime::from_hz(500_kHz_XTAL)); } break; diff --git a/src/devices/bus/a2bus/agat840k_hle.cpp b/src/devices/bus/a2bus/agat840k_hle.cpp index 2cf22ed4f05..4d753fb9931 100644 --- a/src/devices/bus/a2bus/agat840k_hle.cpp +++ b/src/devices/bus/a2bus/agat840k_hle.cpp @@ -122,7 +122,7 @@ void a2bus_agat840k_hle_device::index_callback(int unit, int state) m_count_write = 0; m_d15->pc4_w(0); // latch data into port A m_d15->pc4_w(1); - m_timer_wait->adjust(attotime::from_usec(m_waittime), 0, attotime::from_usec(m_waittime)); + m_timer_wait->adjust_periodic(attotime::from_usec(m_waittime)); } #endif } @@ -386,7 +386,7 @@ void a2bus_agat840k_hle_device::d14_o_c(uint8_t data) { m_d15->pc4_w(0); m_d15->pc4_w(1); - m_timer_wait->adjust(attotime::from_usec(m_waittime), 0, attotime::from_usec(m_waittime)); + m_timer_wait->adjust_periodic(attotime::from_usec(m_waittime)); } LOG("D14 C <- %02X (unit %d side %d drtn %d wtg %d mon %d)\n", diff --git a/src/devices/bus/a2bus/agat_fdc.cpp b/src/devices/bus/a2bus/agat_fdc.cpp index ad90a251af6..8069c613e19 100644 --- a/src/devices/bus/a2bus/agat_fdc.cpp +++ b/src/devices/bus/a2bus/agat_fdc.cpp @@ -159,7 +159,7 @@ void a2bus_agat_fdc_device::device_reset() // Just a timer to be sure that the lss is updated from time to // time, so that there's no hiccup when it's talked to again. - m_timer_lss->adjust(attotime::from_msec(10), 0, attotime::from_msec(10)); + m_timer_lss->adjust_periodic(attotime::from_msec(10)); } void a2bus_agat_fdc_device::device_timer(timer_instance const &timer) diff --git a/src/devices/bus/abckb/abc77.cpp b/src/devices/bus/abckb/abc77.cpp index 0d48b4fe7c8..43b8815d625 100644 --- a/src/devices/bus/abckb/abc77.cpp +++ b/src/devices/bus/abckb/abc77.cpp @@ -443,7 +443,7 @@ void abc77_device::device_start() { // allocate timers m_serial_timer = timer_alloc(TIMER_SERIAL); - m_serial_timer->adjust(attotime::from_hz(19200), 0, attotime::from_hz(19200)); // ALE/32 + m_serial_timer->adjust_periodic(attotime::from_hz(19200)); // ALE/32 m_reset_timer = timer_alloc(TIMER_RESET); } diff --git a/src/devices/bus/abckb/abc800kb.cpp b/src/devices/bus/abckb/abc800kb.cpp index abea024a5f5..77142322fb6 100644 --- a/src/devices/bus/abckb/abc800kb.cpp +++ b/src/devices/bus/abckb/abc800kb.cpp @@ -338,7 +338,7 @@ void abc800_keyboard_device::device_start() { // allocate timers m_serial_timer = timer_alloc(); - m_serial_timer->adjust(attotime::from_hz(XTAL(5'990'400)/(3*5)/20), 0, attotime::from_hz(XTAL(5'990'400)/(3*5)/20)); // ??? + m_serial_timer->adjust_periodic(attotime::from_hz(XTAL(5'990'400)/(3*5)/20)); // ??? // state saving save_item(NAME(m_row)); diff --git a/src/devices/bus/c64/c128_partner.cpp b/src/devices/bus/c64/c128_partner.cpp index 428b17e9058..62a224a3024 100644 --- a/src/devices/bus/c64/c128_partner.cpp +++ b/src/devices/bus/c64/c128_partner.cpp @@ -99,7 +99,7 @@ void c128_partner_cartridge_device::device_start() { // simulate the 16.7ms pulse from CIA1 PB2 that would arrive thru the joystick port dongle t_joyb2 = timer_alloc(); - t_joyb2->adjust(attotime::from_msec(16), 0, attotime::from_msec(16)); + t_joyb2->adjust_periodic(attotime::from_msec(16)); // state saving save_item(NAME(m_ram_a12_a7)); diff --git a/src/devices/bus/cbus/pc9801_86.cpp b/src/devices/bus/cbus/pc9801_86.cpp index 267b1a2c55b..c47ae9ae618 100644 --- a/src/devices/bus/cbus/pc9801_86.cpp +++ b/src/devices/bus/cbus/pc9801_86.cpp @@ -337,7 +337,7 @@ void pc9801_86_device::pcm_w(offs_t offset, u8 data) break; case 2: if(((data & 7) != (m_pcm_ctrl & 7)) || !m_init) - m_dac_timer->adjust(attotime::from_ticks(divs[data & 7], rate), 0, attotime::from_ticks(divs[data & 7], rate)); + m_dac_timer->adjust_periodic(attotime::from_ticks(divs[data & 7], rate)); if(data & 8) m_head = m_tail = m_count = 0; if(!(data & 0x10)) diff --git a/src/devices/bus/compucolor/floppy.cpp b/src/devices/bus/compucolor/floppy.cpp index f5a5da7b567..8ea7de09752 100644 --- a/src/devices/bus/compucolor/floppy.cpp +++ b/src/devices/bus/compucolor/floppy.cpp @@ -128,7 +128,7 @@ void compucolor_floppy_device::device_start() { // allocate timer m_timer = timer_alloc(); - m_timer->adjust(attotime::from_hz(9600*8), 0, attotime::from_hz(9600*8)); + m_timer->adjust_periodic(attotime::from_hz(9600*8)); // state saving save_item(NAME(m_rw)); diff --git a/src/devices/bus/hp9845_io/98035.cpp b/src/devices/bus/hp9845_io/98035.cpp index ec6082a0f1f..a0bf5548b2f 100644 --- a/src/devices/bus/hp9845_io/98035.cpp +++ b/src/devices/bus/hp9845_io/98035.cpp @@ -198,11 +198,9 @@ void hp98035_io_card_device::device_reset() sts_w(true); set_flg(true); - attotime period(attotime::from_msec(1)); - m_msec_timer->adjust(period , 0 , period); + m_msec_timer->adjust_periodic(attotime::from_msec(1)); - period = attotime::from_hz(DIGIT_MUX_FREQ); - m_clock_timer->adjust(period , 0 , period); + m_clock_timer->adjust_periodic(attotime::from_hz(DIGIT_MUX_FREQ)); half_init(); } diff --git a/src/devices/bus/ieee488/remote488.cpp b/src/devices/bus/ieee488/remote488.cpp index 21b937ac30d..b677586eaf4 100644 --- a/src/devices/bus/ieee488/remote488.cpp +++ b/src/devices/bus/ieee488/remote488.cpp @@ -336,7 +336,7 @@ void remote488_device::bus_reset() m_sh_state = REM_SH_SIDS; m_ah_state = REM_AH_ACRS; m_rx_state = REM_RX_WAIT_CH; - m_poll_timer->adjust(attotime::from_usec(POLL_PERIOD_US) , 0 , attotime::from_usec(POLL_PERIOD_US)); + m_poll_timer->adjust_periodic(attotime::from_usec(POLL_PERIOD_US)); m_pp_data = 0; m_pp_requested = false; update_ah_fsm(); @@ -399,7 +399,7 @@ void remote488_device::process_input_msgs() } } if (!m_poll_timer->enabled()) { - m_poll_timer->adjust(attotime::from_usec(POLL_PERIOD_US) , 0 , attotime::from_usec(POLL_PERIOD_US)); + m_poll_timer->adjust_periodic(attotime::from_usec(POLL_PERIOD_US)); } } @@ -446,7 +446,7 @@ void remote488_device::set_connection(bool state) send_update(MSG_SIGNAL_CLEAR , tmp); } } - m_hb_timer->adjust(attotime::from_msec(HEARTBEAT_MS) , 0 , attotime::from_msec(HEARTBEAT_MS)); + m_hb_timer->adjust_periodic(attotime::from_msec(HEARTBEAT_MS)); m_connect_cnt = MAX_MISSED_HB; } else { if (m_connected) { @@ -454,7 +454,7 @@ void remote488_device::set_connection(bool state) m_connected = false; LOG("Connection lost!\n"); update_ah_fsm(); - m_hb_timer->adjust(attotime::from_msec(HEARTBEAT_MS) , 0 , attotime::from_msec(HEARTBEAT_MS)); + m_hb_timer->adjust_periodic(attotime::from_msec(HEARTBEAT_MS)); } } } diff --git a/src/devices/bus/isa/s3virge.cpp b/src/devices/bus/isa/s3virge.cpp index 62777eec564..6bc660a1822 100644 --- a/src/devices/bus/isa/s3virge.cpp +++ b/src/devices/bus/isa/s3virge.cpp @@ -972,7 +972,7 @@ void s3virge_vga_device::command_start() s3virge.s3d.clip_b = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_CLIP_T_B] & 0x000007ff; s3virge.s3d.clip_t = (s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_CLIP_T_B] & 0x07ff0000) >> 16; if(!(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_COMMAND] & 0x00000080)) - m_draw_timer->adjust(attotime::from_nsec(250),0,attotime::from_nsec(250)); + m_draw_timer->adjust_periodic(attotime::from_nsec(250)); s3virge.s3d.bitblt_step_count = 0; s3virge.s3d.bitblt_mono_pattern = s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_MONO_PAT_0] | (uint64_t)(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_MONO_PAT_1]) << 32; diff --git a/src/devices/bus/isa/sb16.cpp b/src/devices/bus/isa/sb16.cpp index 8cea7d20697..92de67d2ef9 100644 --- a/src/devices/bus/isa/sb16.cpp +++ b/src/devices/bus/isa/sb16.cpp @@ -109,7 +109,7 @@ void sb16_lle_device::control_timer(bool start) if(start && m_freq) { double rate = ((46.61512_MHz_XTAL).dvalue()/1024/256) * m_freq; - m_timer->adjust(attotime::from_hz(rate), 0, attotime::from_hz(rate)); + m_timer->adjust_periodic(attotime::from_hz(rate)); } else m_timer->adjust(attotime::never); diff --git a/src/devices/bus/isa/sblaster.cpp b/src/devices/bus/isa/sblaster.cpp index cd6f6e43cc0..07a7e3ebd9c 100644 --- a/src/devices/bus/isa/sblaster.cpp +++ b/src/devices/bus/isa/sblaster.cpp @@ -1476,7 +1476,7 @@ void sb16_device::dack16_w(int line, uint16_t data) // set the transfer timer on the 1st byte if (!m_dsp.dma_timer_started) { - m_timer->adjust(attotime::from_hz((double)m_dsp.frequency), 0, attotime::from_hz((double)m_dsp.frequency)); + m_timer->adjust_periodic(attotime::from_hz((double)m_dsp.frequency)); m_dsp.d_rptr = m_dsp.d_wptr = 0; m_dsp.dma_timer_started = true; } @@ -1523,7 +1523,7 @@ void sb_device::dack_w(int line, uint8_t data) // set the transfer timer on the 1st byte if (!m_dsp.dma_timer_started) { - m_timer->adjust(attotime::from_hz((double)m_dsp.frequency), 0, attotime::from_hz((double)m_dsp.frequency)); + m_timer->adjust_periodic(attotime::from_hz((double)m_dsp.frequency)); m_dsp.d_rptr = m_dsp.d_wptr = 0; m_dsp.dma_timer_started = true; } diff --git a/src/devices/bus/isa/sc499.cpp b/src/devices/bus/isa/sc499.cpp index a49d52a5d2a..8d796b3d2be 100644 --- a/src/devices/bus/isa/sc499.cpp +++ b/src/devices/bus/isa/sc499.cpp @@ -552,7 +552,7 @@ void sc499_device::device_timer(timer_instance const &timer) if (++m_underrun_counter >= 5000) { // stop tape (after 30 seconds) - probably the DMA handshake failed. - m_timer1->adjust(attotime::never, param, attotime::never); + m_timer1->adjust(attotime::never, param); m_status &= ~SC499_STAT_EXC; m_status &= ~SC499_STAT_DIR; tape_status_clear(SC499_ST_CLEAR_ALL); @@ -572,7 +572,7 @@ void sc499_device::device_timer(timer_instance const &timer) { LOG1(("timer_func param=%d status=%x tape_pos=%d - end-of-tape or not ready", param, m_status, m_tape_pos)); - m_timer1->adjust(attotime::never, param, attotime::never); + m_timer1->adjust(attotime::never, param); m_status &= ~SC499_STAT_EXC; m_status &= ~SC499_STAT_DIR; tape_status_clear(SC499_ST_CLEAR_ALL); @@ -594,7 +594,7 @@ void sc499_device::device_timer(timer_instance const &timer) m_underrun_counter = 0; if (block_is_filemark()) { - m_timer1->adjust(attotime::never, param, attotime::never); + m_timer1->adjust(attotime::never, param); } else if (m_current_command == SC499_CMD_READ_DATA) { @@ -801,7 +801,7 @@ void sc499_device::do_command(uint8_t data) set_interrupt(CLEAR_LINE); set_dma_drq(CLEAR_LINE); - m_timer1->adjust( attotime::never, SC499_TIMER_6, attotime::never); + m_timer1->adjust( attotime::never, SC499_TIMER_6); m_data_index = 0; m_timer->adjust( attotime::from_usec(100), SC499_TIMER_4); @@ -845,7 +845,7 @@ void sc499_device::do_reset() set_interrupt(CLEAR_LINE); set_dma_drq(CLEAR_LINE); - m_timer1->adjust( attotime::never, SC499_TIMER_6, attotime::never); + m_timer1->adjust( attotime::never, SC499_TIMER_6 ); } // ------------------------------------- diff --git a/src/devices/bus/isa/stereo_fx.cpp b/src/devices/bus/isa/stereo_fx.cpp index d8b8f3f28fb..13c1ede430f 100644 --- a/src/devices/bus/isa/stereo_fx.cpp +++ b/src/devices/bus/isa/stereo_fx.cpp @@ -216,7 +216,7 @@ void stereo_fx_device::device_start() m_isa->install_device(0x0388, 0x0389, read8sm_delegate(ym3812, FUNC(ym3812_device::read)), write8sm_delegate(ym3812, FUNC(ym3812_device::write))); m_isa->install_device(0x0228, 0x0229, read8sm_delegate(ym3812, FUNC(ym3812_device::read)), write8sm_delegate(ym3812, FUNC(ym3812_device::write))); m_timer = timer_alloc(); - m_timer->adjust(attotime::from_hz(2000000), 0, attotime::from_hz(2000000)); + m_timer->adjust_periodic(attotime::from_hz(2000000)); m_isa->set_dma_channel(1, this, false); } diff --git a/src/devices/bus/pc_kbd/hle_mouse.cpp b/src/devices/bus/pc_kbd/hle_mouse.cpp index 1521560d913..5a2743efbfb 100644 --- a/src/devices/bus/pc_kbd/hle_mouse.cpp +++ b/src/devices/bus/pc_kbd/hle_mouse.cpp @@ -151,7 +151,7 @@ void hle_ps2_mouse_device::resume() // start serial communication if (!m_serial->enabled()) - m_serial->adjust(serial_cycle, 0, serial_cycle); + m_serial->adjust_periodic(serial_cycle); } } @@ -442,7 +442,7 @@ void hle_ps2_mouse_device::command(u8 const command) case 0xf4: // enable data reporting LOGMASKED(LOG_COMMAND, "enable data reporting\n"); m_mode |= ENABLE; - m_sample->adjust(attotime::from_hz(m_sample_rate), 0, attotime::from_hz(m_sample_rate)); + m_sample->adjust_periodic(attotime::from_hz(m_sample_rate)); m_tx_buf[m_tx_len++] = 0xfa; break; diff --git a/src/devices/bus/pet/c2n.cpp b/src/devices/bus/pet/c2n.cpp index 88f33f03f46..dd053e8b91b 100644 --- a/src/devices/bus/pet/c2n.cpp +++ b/src/devices/bus/pet/c2n.cpp @@ -85,7 +85,7 @@ void c2n_device::device_start() { // allocate timers m_read_timer = timer_alloc(); - m_read_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100)); + m_read_timer->adjust_periodic(attotime::from_hz(44100)); } diff --git a/src/devices/bus/qbus/pc11.cpp b/src/devices/bus/qbus/pc11.cpp index 714c5633c38..e561a82627c 100644 --- a/src/devices/bus/qbus/pc11.cpp +++ b/src/devices/bus/qbus/pc11.cpp @@ -82,7 +82,7 @@ void pc11_device::device_start() // about 300 cps emu_timer *timer = timer_alloc(); - timer->adjust(attotime::from_usec(333), 0, attotime::from_usec(333)); + timer->adjust_periodic(attotime::from_usec(333)); } diff --git a/src/devices/bus/ti8x/bitsocket.cpp b/src/devices/bus/ti8x/bitsocket.cpp index 69ce649cefb..c16b66cd823 100644 --- a/src/devices/bus/ti8x/bitsocket.cpp +++ b/src/devices/bus/ti8x/bitsocket.cpp @@ -40,7 +40,7 @@ void bit_socket_device::device_start() m_tip_in = m_ring_in = true; - m_poll_timer->adjust(attotime::from_hz(200000), 0, attotime::from_hz(200000)); + m_poll_timer->adjust_periodic(attotime::from_hz(200000)); } diff --git a/src/devices/bus/ti99/joyport/mecmouse.cpp b/src/devices/bus/ti99/joyport/mecmouse.cpp index 27dc147b73d..cf71fbb837c 100644 --- a/src/devices/bus/ti99/joyport/mecmouse.cpp +++ b/src/devices/bus/ti99/joyport/mecmouse.cpp @@ -167,7 +167,7 @@ void mecmouse_device::device_start() // The poll time cannot depend on the console settings, since the TI-99/4A // has no clock line on the joystick port. The rate is not mentioned in // the specs; however, if it is too low, the mouse pointer will do jumps - m_poll_timer->adjust(attotime::from_hz(100), 0, attotime::from_hz(100)); + m_poll_timer->adjust_periodic(attotime::from_hz(100)); save_item(NAME(m_last_select)); save_item(NAME(m_read_y_axis)); diff --git a/src/devices/bus/vcs/dpc.cpp b/src/devices/bus/vcs/dpc.cpp index a1facbbd2d4..1e8802665a0 100644 --- a/src/devices/bus/vcs/dpc.cpp +++ b/src/devices/bus/vcs/dpc.cpp @@ -58,7 +58,7 @@ void dpc_device::device_reset() elem.flag = 0; elem.music_mode = 0; } - m_oscillator->adjust(attotime::from_hz(18400), 0, attotime::from_hz(18400)); + m_oscillator->adjust_periodic(attotime::from_hz(18400)); } diff --git a/src/devices/bus/vip/vp550.cpp b/src/devices/bus/vip/vp550.cpp index 3250e10a286..b28d8c0e2ef 100644 --- a/src/devices/bus/vip/vp550.cpp +++ b/src/devices/bus/vip/vp550.cpp @@ -91,7 +91,7 @@ void vp550_device::device_start() { // allocate timers m_sync_timer = timer_alloc(); - m_sync_timer->adjust(attotime::from_hz(50), 0, attotime::from_hz(50)); + m_sync_timer->adjust_periodic(attotime::from_hz(50)); m_sync_timer->enable(0); } diff --git a/src/devices/cpu/hd61700/hd61700.cpp b/src/devices/cpu/hd61700/hd61700.cpp index 177929084ff..a27cc106a76 100644 --- a/src/devices/cpu/hd61700/hd61700.cpp +++ b/src/devices/cpu/hd61700/hd61700.cpp @@ -138,7 +138,7 @@ void hd61700_cpu_device::device_start() m_program = &space(AS_PROGRAM); m_sec_timer = timer_alloc(SEC_TIMER); - m_sec_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); + m_sec_timer->adjust_periodic(attotime::from_seconds(1)); m_lcd_ctrl_cb.resolve_safe(); m_lcd_read_cb.resolve_safe(0xff); diff --git a/src/devices/cpu/lc8670/lc8670.cpp b/src/devices/cpu/lc8670/lc8670.cpp index 6a3723239e6..3b646a65fc6 100644 --- a/src/devices/cpu/lc8670/lc8670.cpp +++ b/src/devices/cpu/lc8670/lc8670.cpp @@ -208,7 +208,7 @@ void lc8670_cpu_device::device_start() // setup timers m_basetimer = timer_alloc(BASE_TIMER); - m_basetimer->adjust(attotime::from_hz(m_clocks[unsigned(clock_source::SUB)]), 0, attotime::from_hz(m_clocks[unsigned(clock_source::SUB)])); + m_basetimer->adjust_periodic(attotime::from_hz(m_clocks[unsigned(clock_source::SUB)])); m_clocktimer = timer_alloc(CLOCK_TIMER); // register state for debugger @@ -1185,7 +1185,7 @@ inline void lc8670_cpu_device::change_clock_source() set_unscaled_clock(new_clock); set_clock_scale(1.0 / (REG_OCR & 0x80 ? 6.0 : 12.0)); - m_clocktimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); + m_clocktimer->adjust_periodic(attotime::from_hz(clock())); m_clock_changed = false; } diff --git a/src/devices/cpu/m6502/m5074x.cpp b/src/devices/cpu/m6502/m5074x.cpp index 8ea41ff2258..29124378f3d 100644 --- a/src/devices/cpu/m6502/m5074x.cpp +++ b/src/devices/cpu/m6502/m5074x.cpp @@ -236,13 +236,13 @@ void m5074x_device::recalc_timer(int timer) case 0: hz = clock() / 16; hz /= (m_tmr12pre + 2); - m_timers[TIMER_1]->adjust(attotime::from_hz(hz), 0, attotime::from_hz(hz)); + m_timers[TIMER_1]->adjust_periodic(attotime::from_hz(hz)); break; case 1: hz = clock() / 16; hz /= (m_tmr12pre + 2); - m_timers[TIMER_2]->adjust(attotime::from_hz(hz), 0, attotime::from_hz(hz)); + m_timers[TIMER_2]->adjust_periodic(attotime::from_hz(hz)); break; case 2: @@ -253,13 +253,13 @@ void m5074x_device::recalc_timer(int timer) // stop bit? if (m_tmrctrl & TMRC_TMRXHLT) { - m_timers[TIMER_X]->adjust(attotime::never, 0, attotime::never); + m_timers[TIMER_X]->adjust(attotime::never); } else { hz = clock() / 16; hz /= (m_tmrxpre + 2); - m_timers[TIMER_X]->adjust(attotime::from_hz(hz), 0, attotime::from_hz(hz)); + m_timers[TIMER_X]->adjust_periodic(attotime::from_hz(hz)); } } else diff --git a/src/devices/cpu/m6502/st2xxx.cpp b/src/devices/cpu/m6502/st2xxx.cpp index 68164c60dc3..1c6cb1e5bc5 100644 --- a/src/devices/cpu/m6502/st2xxx.cpp +++ b/src/devices/cpu/m6502/st2xxx.cpp @@ -747,7 +747,7 @@ void st2xxx_device::lfr_recalculate_period() assert(clocks != 0); attotime period = cycles_to_attotime(clocks); LOGMASKED(LOG_LCDC, "LCD frame rate = %f Hz (PC = $%04X)\n", period.as_hz(), PPC); - m_lcd_timer->adjust(period, 0, period); + m_lcd_timer->adjust_periodic(period); } else m_lcd_timer->adjust(attotime::never); diff --git a/src/devices/cpu/m6800/m6801.cpp b/src/devices/cpu/m6800/m6801.cpp index b31159e2f84..0db753db253 100644 --- a/src/devices/cpu/m6800/m6801.cpp +++ b/src/devices/cpu/m6800/m6801.cpp @@ -692,7 +692,7 @@ void m6801_cpu_device::set_rmcr(uint8_t data) int divisor = M6801_RMCR_SS[m_rmcr & M6801_RMCR_SS_MASK]; attotime period = cycles_to_attotime(divisor); LOGSER("SCI: Setting serial rate, Divisor: %d Hz: %d\n", divisor, period.as_hz()); - m_sci_timer->adjust(period, 0, period); + m_sci_timer->adjust_periodic(period); m_use_ext_serclock = false; } break; @@ -730,7 +730,7 @@ void hd6301x_cpu_device::set_rmcr(uint8_t data) int divisor = M6801_RMCR_SS[m_rmcr & M6801_RMCR_SS_MASK]; attotime period = cycles_to_attotime(divisor); LOGSER("SCI: Setting serial rate, Divisor: %d Hz: %d\n", divisor, period.as_hz()); - m_sci_timer->adjust(period, 0, period); + m_sci_timer->adjust_periodic(period); } m_use_ext_serclock = false; break; diff --git a/src/devices/cpu/mb88xx/mb88xx.cpp b/src/devices/cpu/mb88xx/mb88xx.cpp index aff96787497..75da89065bc 100644 --- a/src/devices/cpu/mb88xx/mb88xx.cpp +++ b/src/devices/cpu/mb88xx/mb88xx.cpp @@ -385,7 +385,7 @@ void mb88_cpu_device::update_pio_enable( uint8_t newpio ) if ((newpio & 0x30) == 0) m_serial->adjust(attotime::never); else if ((newpio & 0x30) == 0x20) - m_serial->adjust(attotime::from_hz(clock() / SERIAL_PRESCALE), 0, attotime::from_hz(clock() / SERIAL_PRESCALE)); + m_serial->adjust_periodic(attotime::from_hz(clock() / SERIAL_PRESCALE)); else fatalerror("mb88xx: update_pio_enable set serial enable to unsupported value %02X\n", newpio & 0x30); } @@ -744,7 +744,7 @@ void mb88_cpu_device::execute_run() { /* re-enable the timer if we disabled it previously */ if (m_SBcount >= SERIAL_DISABLE_THRESH) - m_serial->adjust(attotime::from_hz(clock() / SERIAL_PRESCALE), 0, attotime::from_hz(clock() / SERIAL_PRESCALE)); + m_serial->adjust_periodic(attotime::from_hz(clock() / SERIAL_PRESCALE)); m_SBcount = 0; } m_sf = 0; diff --git a/src/devices/cpu/nec/v25.cpp b/src/devices/cpu/nec/v25.cpp index 50c8fe30a83..599b6246b5d 100644 --- a/src/devices/cpu/nec/v25.cpp +++ b/src/devices/cpu/nec/v25.cpp @@ -224,7 +224,7 @@ void v25_common_device::device_reset() unsigned tmp = m_PCK << m_TB; attotime time = clocks_to_attotime(tmp); - m_timers[3]->adjust(time, INTTB, time); + m_timers[3]->adjust_periodic(time, INTTB); m_timers[0]->adjust(attotime::never); m_timers[1]->adjust(attotime::never); diff --git a/src/devices/cpu/nec/v25sfr.cpp b/src/devices/cpu/nec/v25sfr.cpp index 81d9d5569b0..e1fff1a3c0b 100644 --- a/src/devices/cpu/nec/v25sfr.cpp +++ b/src/devices/cpu/nec/v25sfr.cpp @@ -413,7 +413,7 @@ void v25_common_device::tmc0_w(uint8_t d) { unsigned tmp = m_PCK * m_MD0 * (BIT(d, 6) ? 128 : 6); attotime time = clocks_to_attotime(tmp); - m_timers[0]->adjust(time, INTTU0, time); + m_timers[0]->adjust_periodic(time, INTTU0); m_timers[1]->adjust(attotime::never); m_TM0 = m_MD0; } @@ -432,7 +432,7 @@ void v25_common_device::tmc1_w(uint8_t d) { unsigned tmp = m_PCK * m_MD1 * (BIT(d, 6) ? 128 : 6); attotime time = clocks_to_attotime(tmp); - m_timers[2]->adjust(time, INTTU2, time); + m_timers[2]->adjust_periodic(time, INTTU2); m_TM1 = m_MD1; } else @@ -563,7 +563,7 @@ void v25_common_device::prc_w(uint8_t d) unsigned tmp = m_PCK << m_TB; attotime time = clocks_to_attotime(tmp); - m_timers[3]->adjust(time, INTTB, time); + m_timers[3]->adjust_periodic(time, INTTB); notify_clock_changed(); // make device_execute_interface pick up the new clocks_to_cycles() logerror(" Internal RAM %sabled\n", (m_RAMEN ? "en" : "dis")); diff --git a/src/devices/cpu/powerpc/ppccom.cpp b/src/devices/cpu/powerpc/ppccom.cpp index b96eebeae31..faabb69949e 100644 --- a/src/devices/cpu/powerpc/ppccom.cpp +++ b/src/devices/cpu/powerpc/ppccom.cpp @@ -2687,7 +2687,7 @@ void ppc_device::ppc4xx_spu_timer_reset() int divisor = ((m_spu.regs[SPU4XX_BAUD_DIVISOR_H] * 256 + m_spu.regs[SPU4XX_BAUD_DIVISOR_L]) & 0xfff) + 1; int bpc = 7 + ((m_spu.regs[SPU4XX_CONTROL] & 8) >> 3) + 1 + (m_spu.regs[SPU4XX_CONTROL] & 1); attotime charperiod = clockperiod * (divisor * 16 * bpc); - m_spu.timer->adjust(charperiod, 0, charperiod); + m_spu.timer->adjust_periodic(charperiod); if (PRINTF_SPU) printf("ppc4xx_spu_timer_reset: baud rate = %.0f\n", charperiod.as_hz() * bpc); } diff --git a/src/devices/cpu/sc61860/sc61860.cpp b/src/devices/cpu/sc61860/sc61860.cpp index a171c275b46..688963120a9 100644 --- a/src/devices/cpu/sc61860/sc61860.cpp +++ b/src/devices/cpu/sc61860/sc61860.cpp @@ -107,7 +107,7 @@ void sc61860_device::device_reset() void sc61860_device::device_start() { m_2ms_tick_timer = timer_alloc(*this, FUNC(sc61860_device::sc61860_2ms_tick)); - m_2ms_tick_timer->adjust(attotime::from_hz(500), 0, attotime::from_hz(500)); + m_2ms_tick_timer->adjust_periodic(attotime::from_hz(500)); space(AS_PROGRAM).cache(m_cache); space(AS_PROGRAM).specific(m_program); diff --git a/src/devices/cpu/sm510/sm510base.cpp b/src/devices/cpu/sm510/sm510base.cpp index 27fe81e5161..307df3c1a9f 100644 --- a/src/devices/cpu/sm510/sm510base.cpp +++ b/src/devices/cpu/sm510/sm510base.cpp @@ -218,7 +218,7 @@ void sm510_base_device::init_lcd_driver() // note: in reality, this timer runs at high frequency off the main divider, strobing one segment at a time m_lcd_timer = timer_alloc(*this, FUNC(sm510_base_device::lcd_timer_cb)); attotime period = attotime::from_ticks(0x20, unscaled_clock()); // default 1kHz - m_lcd_timer->adjust(period, 0, period); + m_lcd_timer->adjust_periodic(period); } @@ -267,7 +267,7 @@ TIMER_CALLBACK_MEMBER(sm510_base_device::div_timer_cb) void sm510_base_device::init_divider() { m_div_timer = timer_alloc(*this, FUNC(sm510_base_device::div_timer_cb)); - m_div_timer->adjust(attotime::from_ticks(1, unscaled_clock()), 0, attotime::from_ticks(1, unscaled_clock())); + m_div_timer->adjust_periodic(attotime::from_ticks(1, unscaled_clock())); } diff --git a/src/devices/cpu/tlcs90/tlcs90.cpp b/src/devices/cpu/tlcs90/tlcs90.cpp index 1f6e60331d3..3728de785bd 100644 --- a/src/devices/cpu/tlcs90/tlcs90.cpp +++ b/src/devices/cpu/tlcs90/tlcs90.cpp @@ -2720,7 +2720,7 @@ void tlcs90_device::t90_start_timer(int i) period = m_timer_period * prescaler; - m_timer[i]->adjust(period, i, period); + m_timer[i]->adjust_periodic(period, i); logerror("%04X: CPU Timer %d started at %f Hz\n", m_pc.w.l, i, 1.0 / period.as_double()); } @@ -2742,7 +2742,7 @@ void tlcs90_device::t90_start_timer4() period = m_timer_period * prescaler; - m_timer[4]->adjust(period, 4, period); + m_timer[4]->adjust_periodic(period, 4); logerror("%04X: CPU Timer 4 started at %f Hz\n", m_pc.w.l, 1.0 / period.as_double()); } diff --git a/src/devices/imagedev/avivideo.cpp b/src/devices/imagedev/avivideo.cpp index 4cd1c2fcf5c..44de7d8b486 100644 --- a/src/devices/imagedev/avivideo.cpp +++ b/src/devices/imagedev/avivideo.cpp @@ -97,7 +97,7 @@ image_init_result avivideo_image_device::call_load() const avi_file::movie_info &aviinfo = m_avi->get_movie_info(); float frame_rate = (float)aviinfo.video_timescale / (float)aviinfo.video_sampletime; attotime frame_time = attotime::from_hz((int)round(frame_rate)); - m_frame_timer->adjust(frame_time, 0, frame_time); + m_frame_timer->adjust_periodic(frame_time); m_frame_count = aviinfo.video_numsamples; m_frame_num = 0; return image_init_result::PASS; diff --git a/src/devices/imagedev/mfmhd.cpp b/src/devices/imagedev/mfmhd.cpp index 2b701eef22a..9065c82435b 100644 --- a/src/devices/imagedev/mfmhd.cpp +++ b/src/devices/imagedev/mfmhd.cpp @@ -361,7 +361,7 @@ void mfm_harddisk_device::device_start() m_cache_timer = timer_alloc(CACHE_TM); m_rev_time = attotime::from_hz(m_rpm/60); - m_index_timer->adjust(attotime::from_hz(m_rpm/60), 0, attotime::from_hz(m_rpm/60)); + m_index_timer->adjust_periodic(attotime::from_hz(m_rpm/60)); m_current_cylinder = m_landing_zone; // Park position m_spinup_timer->adjust(attotime::from_msec(m_spinupms)); @@ -369,7 +369,7 @@ void mfm_harddisk_device::device_start() m_cache = std::make_unique<mfmhd_trackimage_cache>(machine()); // In 5 second periods, check whether the cache has dirty lines - m_cache_timer->adjust(attotime::from_msec(5000), 0, attotime::from_msec(5000)); + m_cache_timer->adjust_periodic(attotime::from_msec(5000)); save_item(NAME(m_max_cylinders)); save_item(NAME(m_phys_cylinders)); diff --git a/src/devices/imagedev/midiin.cpp b/src/devices/imagedev/midiin.cpp index 3c8e71f30d1..e78e01b3b9a 100644 --- a/src/devices/imagedev/midiin.cpp +++ b/src/devices/imagedev/midiin.cpp @@ -152,7 +152,7 @@ image_init_result midiin_device::call_load() return image_init_result::FAIL; } - m_timer->adjust(attotime::from_hz(1500), 0, attotime::from_hz(1500)); + m_timer->adjust_periodic(attotime::from_hz(1500)); return image_init_result::PASS; } } diff --git a/src/devices/machine/68230pit.cpp b/src/devices/machine/68230pit.cpp index 16b25955048..fe60cb1c07e 100644 --- a/src/devices/machine/68230pit.cpp +++ b/src/devices/machine/68230pit.cpp @@ -674,13 +674,13 @@ void pit68230_device::wr_pitreg_tcr(uint8_t data) if (clk == 1) { int rate = clock() / (psc == 1 ? 32 : 1); - pit_timer->adjust(attotime::from_hz(rate), TIMER_ID_PIT, attotime::from_hz(rate)); + pit_timer->adjust_periodic(attotime::from_hz(rate), TIMER_ID_PIT); LOG("PIT timer started @ rate: %d and CLK: %d,\n", rate, clock()); } } else { - pit_timer->adjust(attotime::never, TIMER_ID_PIT, attotime::never); + pit_timer->adjust(attotime::never, TIMER_ID_PIT); } } diff --git a/src/devices/machine/8042kbdc.cpp b/src/devices/machine/8042kbdc.cpp index 2789da21dfd..b0b7265486d 100644 --- a/src/devices/machine/8042kbdc.cpp +++ b/src/devices/machine/8042kbdc.cpp @@ -100,7 +100,7 @@ void kbdc8042_device::device_reset() m_mouse_y = 0; m_mouse_btn = 0; - m_update_timer->adjust(attotime::from_hz(100), 0, attotime::from_hz(100)); + m_update_timer->adjust_periodic(attotime::from_hz(100)); } void kbdc8042_device::at_8042_set_outport(uint8_t data, int initial) diff --git a/src/devices/machine/8530scc.cpp b/src/devices/machine/8530scc.cpp index f90fa48734a..7096c8b791d 100644 --- a/src/devices/machine/8530scc.cpp +++ b/src/devices/machine/8530scc.cpp @@ -146,11 +146,11 @@ void scc8530_legacy_device::device_timer(timer_instance const &timer) if (rate) { attotime attorate = attotime::from_hz(rate); - pChan->baudtimer->adjust(attorate, 0, attorate); + pChan->baudtimer->adjust_periodic(attorate); } else { - pChan->baudtimer->adjust(attotime::never, 0, attotime::never); + pChan->baudtimer->adjust(attotime::never); } } @@ -401,7 +401,7 @@ void scc8530_legacy_device::putreg(int ch, uint8_t data) int brconst = pChan->reg_val[13]<<8 | pChan->reg_val[14]; int rate = clock() / brconst; - pChan->baudtimer->adjust(attotime::from_hz(rate), 0, attotime::from_hz(rate)); + pChan->baudtimer->adjust_periodic(attotime::from_hz(rate)); } break; diff --git a/src/devices/machine/aicartc.cpp b/src/devices/machine/aicartc.cpp index fea8ac9f127..862d8900427 100644 --- a/src/devices/machine/aicartc.cpp +++ b/src/devices/machine/aicartc.cpp @@ -55,7 +55,7 @@ void aicartc_device::device_validity_check(validity_checker &valid) const void aicartc_device::device_start() { m_clock_timer = timer_alloc(); - m_clock_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); + m_clock_timer->adjust_periodic(attotime::from_hz(clock())); } diff --git a/src/devices/machine/am2910.cpp b/src/devices/machine/am2910.cpp index 048c6d580e2..8e3607bd6c4 100644 --- a/src/devices/machine/am2910.cpp +++ b/src/devices/machine/am2910.cpp @@ -83,7 +83,7 @@ void am2910_device::device_reset() memset(m_stack, 0, sizeof(uint16_t) * 5); if (m_execute_timer) - m_execute_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); + m_execute_timer->adjust_periodic(attotime::from_hz(clock())); } void am2910_device::device_timer(timer_instance const &timer) diff --git a/src/devices/machine/am79c90.cpp b/src/devices/machine/am79c90.cpp index d7ce069ed42..08dc1695a98 100644 --- a/src/devices/machine/am79c90.cpp +++ b/src/devices/machine/am79c90.cpp @@ -88,7 +88,7 @@ void am7990_device_base::device_start() m_dma_out_cb.resolve_safe(); m_transmit_poll = timer_alloc(*this, FUNC(am7990_device_base::transmit_poll)); - m_transmit_poll->adjust(TX_POLL_PERIOD, 0, TX_POLL_PERIOD); + m_transmit_poll->adjust_periodic(TX_POLL_PERIOD); save_item(NAME(m_rap)); save_item(NAME(m_csr)); diff --git a/src/devices/machine/arm_iomd.cpp b/src/devices/machine/arm_iomd.cpp index dcb5d4cac87..bb2d8f69ff4 100644 --- a/src/devices/machine/arm_iomd.cpp +++ b/src/devices/machine/arm_iomd.cpp @@ -502,7 +502,7 @@ inline void arm_iomd_device::trigger_timer(unsigned Which) if(val==0) m_timer[Which]->adjust(attotime::never); else - m_timer[Which]->adjust(attotime::from_usec(val), 0, attotime::from_usec(val)); + m_timer[Which]->adjust_periodic(attotime::from_usec(val)); } // TODO: live updates aren't really supported here diff --git a/src/devices/machine/bq4847.cpp b/src/devices/machine/bq4847.cpp index 11420baf1a0..44cd6aee434 100644 --- a/src/devices/machine/bq4847.cpp +++ b/src/devices/machine/bq4847.cpp @@ -410,7 +410,7 @@ void bq4847_device::set_periodic_timer() if (rateval == 0) m_periodic_timer->reset(); else - m_periodic_timer->adjust(attotime::from_hz(rate), 0, attotime::from_hz(rate)); + m_periodic_timer->adjust_periodic(attotime::from_hz(rate)); } void bq4847_device::set_watchdog_timer(bool on) @@ -488,7 +488,7 @@ void bq4847_device::connect_osc(bool conn) if (conn) { // The internal update cycle is 1 sec - m_clock_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); + m_clock_timer->adjust_periodic(attotime::from_seconds(1)); set_periodic_timer(); } else diff --git a/src/devices/machine/bq48x2.cpp b/src/devices/machine/bq48x2.cpp index 59a937e6763..fa38098bc38 100644 --- a/src/devices/machine/bq48x2.cpp +++ b/src/devices/machine/bq48x2.cpp @@ -343,7 +343,7 @@ void bq48x2_device::write(offs_t address, uint8_t data) case reg_days: if (data & FLAG_FTE) // Test mode - m_periodic_timer->adjust(attotime::from_hz(1024), 0, attotime::from_hz(1024)); + m_periodic_timer->adjust_periodic(attotime::from_hz(1024)); else { // reset to periodic timing @@ -401,14 +401,14 @@ void bq48x2_device::set_periodic_timer() m_periodic_timer->reset(); break; case 1: - m_periodic_timer->adjust(attotime::from_msec(10), 0, attotime::from_msec(10)); + m_periodic_timer->adjust_periodic(attotime::from_msec(10)); break; case 2: - m_periodic_timer->adjust(attotime::from_msec(100), 0, attotime::from_msec(100)); + m_periodic_timer->adjust_periodic(attotime::from_msec(100)); break; default: rate = 1 << (16-rateval); - m_periodic_timer->adjust(attotime::from_hz(rate), 0, attotime::from_hz(rate)); + m_periodic_timer->adjust_periodic(attotime::from_hz(rate)); break; } } diff --git a/src/devices/machine/busmouse.cpp b/src/devices/machine/busmouse.cpp index b0daf5ad454..47daa44ec63 100644 --- a/src/devices/machine/busmouse.cpp +++ b/src/devices/machine/busmouse.cpp @@ -156,7 +156,7 @@ void bus_mouse_device::device_reset() { int hz = 2 * 15 * ioport("irq_rate")->read(); - m_irq_timer->adjust(attotime::from_hz(hz), 0, attotime::from_hz(hz)); + m_irq_timer->adjust_periodic(attotime::from_hz(hz)); irq = 0; irq_disabled = 1; diff --git a/src/devices/machine/cdp1879.cpp b/src/devices/machine/cdp1879.cpp index 4a21a360ef7..96430fd03bd 100644 --- a/src/devices/machine/cdp1879.cpp +++ b/src/devices/machine/cdp1879.cpp @@ -37,7 +37,7 @@ void cdp1879_device::device_start() { // allocate timers m_clock_timer = timer_alloc(); - m_clock_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); + m_clock_timer->adjust_periodic(attotime::from_seconds(1)); m_irq_w.resolve_safe(); diff --git a/src/devices/machine/com8116.cpp b/src/devices/machine/com8116.cpp index b68f8826fa1..bd986460a07 100644 --- a/src/devices/machine/com8116.cpp +++ b/src/devices/machine/com8116.cpp @@ -143,7 +143,7 @@ void com8116_device::device_start() if (!m_fx4_handler.isnull()) { m_fx4_timer = timer_alloc(TIMER_FX4); - m_fx4_timer->adjust(attotime::from_hz((clock() / 4) * 2), 0, attotime::from_hz((clock() / 4)) * 2); + m_fx4_timer->adjust_periodic(attotime::from_hz((clock() / 4) * 2)); } m_fr_timer = timer_alloc(TIMER_FR); m_ft_timer = timer_alloc(TIMER_FT); diff --git a/src/devices/machine/dp8573.cpp b/src/devices/machine/dp8573.cpp index aa1ab164cab..0260278a9ba 100644 --- a/src/devices/machine/dp8573.cpp +++ b/src/devices/machine/dp8573.cpp @@ -46,7 +46,7 @@ void dp8573_device::device_start() m_tscr = 0; - m_timer->adjust(attotime::from_msec(1), 0, attotime::from_msec(1)); + m_timer->adjust_periodic(attotime::from_msec(1)); } void dp8573_device::sync_time() diff --git a/src/devices/machine/ds1302.cpp b/src/devices/machine/ds1302.cpp index 1d0d3376483..54c8334d9c3 100644 --- a/src/devices/machine/ds1302.cpp +++ b/src/devices/machine/ds1302.cpp @@ -102,7 +102,7 @@ void ds1302_device::device_start() { // allocate timers m_clock_timer = timer_alloc(); - m_clock_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); + m_clock_timer->adjust_periodic(attotime::from_hz(clock() / 32768)); m_clk = 0; m_ce = 0; diff --git a/src/devices/machine/ds1386.cpp b/src/devices/machine/ds1386.cpp index 7d45b6cc686..9db09844e25 100644 --- a/src/devices/machine/ds1386.cpp +++ b/src/devices/machine/ds1386.cpp @@ -111,7 +111,7 @@ void ds1386_device::device_start() // allocate timers m_clock_timer = timer_alloc(CLOCK_TIMER); - m_clock_timer->adjust(attotime::from_hz(100), 0, attotime::from_hz(100)); + m_clock_timer->adjust_periodic(attotime::from_hz(100)); m_square_timer = timer_alloc(SQUAREWAVE_TIMER); m_square_timer->adjust(attotime::never); m_watchdog_timer = timer_alloc(WATCHDOG_TIMER); diff --git a/src/devices/machine/ds1994.cpp b/src/devices/machine/ds1994.cpp index 7c84d37e51f..1390f3eab53 100644 --- a/src/devices/machine/ds1994.cpp +++ b/src/devices/machine/ds1994.cpp @@ -119,7 +119,7 @@ void ds1994_device::device_start() m_timer_reset = timer_alloc(TIMER_RESET); m_timer_clock = timer_alloc(TIMER_CLOCK); - m_timer_clock->adjust(attotime::from_hz(256), 0, attotime::from_hz(256)); + m_timer_clock->adjust_periodic(attotime::from_hz(256)); } void ds1994_device::device_reset() diff --git a/src/devices/machine/ds2404.cpp b/src/devices/machine/ds2404.cpp index d2b54b0f79a..704e7b10db0 100644 --- a/src/devices/machine/ds2404.cpp +++ b/src/devices/machine/ds2404.cpp @@ -74,7 +74,7 @@ void ds2404_device::device_start() elem = STATE_IDLE; m_tick_timer = timer_alloc(0); - m_tick_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256)); + m_tick_timer->adjust_periodic(attotime::from_hz(256)); } diff --git a/src/devices/machine/e0516.cpp b/src/devices/machine/e0516.cpp index 2833c150e8b..fb3ea2731ee 100644 --- a/src/devices/machine/e0516.cpp +++ b/src/devices/machine/e0516.cpp @@ -55,7 +55,7 @@ void e0516_device::device_start() { // allocate timers m_timer = timer_alloc(); - m_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); + m_timer->adjust_periodic(attotime::from_hz(clock() / 32768)); // state saving save_item(NAME(m_cs)); diff --git a/src/devices/machine/fga002.cpp b/src/devices/machine/fga002.cpp index a1891fd481a..d111f3659b3 100644 --- a/src/devices/machine/fga002.cpp +++ b/src/devices/machine/fga002.cpp @@ -154,7 +154,7 @@ void fga002_device::device_timer(timer_instance const &timer) { if ((m_fga002[FGA_TIM0CTL] & REG_TIM0CTL_ZERO_STOP) == 0) { - fga_timer->adjust(attotime::never, TIMER_ID_FGA, attotime::never); + fga_timer->adjust(attotime::never, TIMER_ID_FGA); } else { @@ -408,27 +408,27 @@ void fga002_device::do_fga002reg_tim0ctl_w(uint8_t data) if ((data & REG_TIM0CTL_START_STOP) != (m_fga002[FGA_TIM0CTL] & REG_TIM0CTL_START_STOP)) { if ((data & REG_TIM0CTL_START_STOP) == 0) - fga_timer->adjust(attotime::never, TIMER_ID_FGA, attotime::never); + fga_timer->adjust(attotime::never, TIMER_ID_FGA); else { switch (data & REG_TIM0CTL_CLK_MSK) { - case REG_TIM0CTL_CLK_1_MIC: fga_timer->adjust(attotime::from_usec(1), TIMER_ID_FGA, attotime::from_usec(1)); break; - case REG_TIM0CTL_CLK_2_MIC: fga_timer->adjust(attotime::from_usec(2), TIMER_ID_FGA, attotime::from_usec(2)); break; - case REG_TIM0CTL_CLK_4_MIC: fga_timer->adjust(attotime::from_usec(4), TIMER_ID_FGA, attotime::from_usec(4)); break; - case REG_TIM0CTL_CLK_8_MIC: fga_timer->adjust(attotime::from_usec(8), TIMER_ID_FGA, attotime::from_usec(8)); break; - case REG_TIM0CTL_CLK_16_MIC: fga_timer->adjust(attotime::from_usec(16), TIMER_ID_FGA, attotime::from_usec(16)); break; - case REG_TIM0CTL_CLK_32_MIC: fga_timer->adjust(attotime::from_usec(32), TIMER_ID_FGA, attotime::from_usec(32)); break; - case REG_TIM0CTL_CLK_64_MIC: fga_timer->adjust(attotime::from_usec(64), TIMER_ID_FGA, attotime::from_usec(64)); break; - case REG_TIM0CTL_CLK_128_MIC: fga_timer->adjust(attotime::from_usec(128), TIMER_ID_FGA, attotime::from_usec(128)); break; - case REG_TIM0CTL_CLK_256_MIC: fga_timer->adjust(attotime::from_usec(256), TIMER_ID_FGA, attotime::from_usec(256)); break; - case REG_TIM0CTL_CLK_512_MIC: fga_timer->adjust(attotime::from_usec(512), TIMER_ID_FGA, attotime::from_usec(512)); break; - case REG_TIM0CTL_CLK_2_MIL: fga_timer->adjust(attotime::from_msec(2), TIMER_ID_FGA, attotime::from_msec(2)); break; - case REG_TIM0CTL_CLK_8_MIL: fga_timer->adjust(attotime::from_msec(8), TIMER_ID_FGA, attotime::from_msec(8)); break; - case REG_TIM0CTL_CLK_32_MIL: fga_timer->adjust(attotime::from_msec(32), TIMER_ID_FGA, attotime::from_msec(32)); break; - case REG_TIM0CTL_CLK_125_MIL: fga_timer->adjust(attotime::from_msec(125), TIMER_ID_FGA, attotime::from_msec(125)); break; - case REG_TIM0CTL_CLK_500_MIL: fga_timer->adjust(attotime::from_msec(500), TIMER_ID_FGA, attotime::from_msec(500)); break; - case REG_TIM0CTL_CLK_2_SEC: fga_timer->adjust(attotime::from_seconds(2), TIMER_ID_FGA, attotime::from_seconds(2)); break; + case REG_TIM0CTL_CLK_1_MIC: fga_timer->adjust_periodic(attotime::from_usec(1), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_2_MIC: fga_timer->adjust_periodic(attotime::from_usec(2), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_4_MIC: fga_timer->adjust_periodic(attotime::from_usec(4), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_8_MIC: fga_timer->adjust_periodic(attotime::from_usec(8), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_16_MIC: fga_timer->adjust_periodic(attotime::from_usec(16), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_32_MIC: fga_timer->adjust_periodic(attotime::from_usec(32), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_64_MIC: fga_timer->adjust_periodic(attotime::from_usec(64), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_128_MIC: fga_timer->adjust_periodic(attotime::from_usec(128), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_256_MIC: fga_timer->adjust_periodic(attotime::from_usec(256), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_512_MIC: fga_timer->adjust_periodic(attotime::from_usec(512), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_2_MIL: fga_timer->adjust_periodic(attotime::from_msec(2), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_8_MIL: fga_timer->adjust_periodic(attotime::from_msec(8), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_32_MIL: fga_timer->adjust_periodic(attotime::from_msec(32), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_125_MIL: fga_timer->adjust_periodic(attotime::from_msec(125), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_500_MIL: fga_timer->adjust_periodic(attotime::from_msec(500), TIMER_ID_FGA); break; + case REG_TIM0CTL_CLK_2_SEC: fga_timer->adjust_periodic(attotime::from_seconds(2), TIMER_ID_FGA); break; default: logerror("REG_TIM0CTL programmer error, please report\n"); break; // Should never happen } } diff --git a/src/devices/machine/generalplus_gpl16250soc.cpp b/src/devices/machine/generalplus_gpl16250soc.cpp index b85c98a13d8..4653b5296bc 100644 --- a/src/devices/machine/generalplus_gpl16250soc.cpp +++ b/src/devices/machine/generalplus_gpl16250soc.cpp @@ -1628,7 +1628,7 @@ void sunplus_gcm394_base_device::device_reset() m_system_dma_memtype = 0x0000; - m_unk_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); + m_unk_timer->adjust_periodic(attotime::from_hz(60)); m_spg_video->set_video_spaces(this->space(AS_PROGRAM), *m_cs_space, m_csbase); m_spg_video->reset(); diff --git a/src/devices/machine/hd63450.cpp b/src/devices/machine/hd63450.cpp index a747e98060c..745157e84d0 100644 --- a/src/devices/machine/hd63450.cpp +++ b/src/devices/machine/hd63450.cpp @@ -307,9 +307,9 @@ void hd63450_device::dma_transfer_start(int channel) else if (!(m_reg[channel].ocr & 2)) m_timer[channel]->adjust(attotime::from_usec(500), channel, m_our_clock[channel]); else if ((m_reg[channel].ocr & 3) == 3) - m_timer[channel]->adjust(attotime::from_usec(500), channel, attotime::never); + m_timer[channel]->adjust(attotime::from_usec(500), channel); else if ((m_reg[channel].ocr & 3) == 2) - m_timer[channel]->adjust(attotime::never, channel, attotime::never); + m_timer[channel]->adjust(attotime::never, channel); m_transfer_size[channel] = m_reg[channel].mtc; @@ -534,7 +534,7 @@ WRITE_LINE_MEMBER(hd63450_device::drq0_w) { // in cycle steal mode drq is supposed to be edge triggered single_transfer(0); - m_timer[0]->adjust(m_our_clock[0], 0, m_our_clock[0]); + m_timer[0]->adjust_periodic(m_our_clock[0], 0); } else if (!state) m_timer[0]->adjust(attotime::never); @@ -548,7 +548,7 @@ WRITE_LINE_MEMBER(hd63450_device::drq1_w) if ((m_reg[1].ocr & 2) && (state && !ostate)) { single_transfer(1); - m_timer[1]->adjust(m_our_clock[1], 1, m_our_clock[1]); + m_timer[1]->adjust_periodic(m_our_clock[1], 1); } else if (!state) m_timer[1]->adjust(attotime::never); @@ -562,7 +562,7 @@ WRITE_LINE_MEMBER(hd63450_device::drq2_w) if ((m_reg[2].ocr & 2) && (state && !ostate)) { single_transfer(2); - m_timer[2]->adjust(m_our_clock[2], 2, m_our_clock[2]); + m_timer[2]->adjust_periodic(m_our_clock[2], 2); } else if (!state) m_timer[2]->adjust(attotime::never); @@ -576,7 +576,7 @@ WRITE_LINE_MEMBER(hd63450_device::drq3_w) if ((m_reg[3].ocr & 2) && (state && !ostate)) { single_transfer(3); - m_timer[3]->adjust(m_our_clock[3], 3, m_our_clock[3]); + m_timer[3]->adjust_periodic(m_our_clock[3], 3); } else if (!state) m_timer[3]->adjust(attotime::never); diff --git a/src/devices/machine/hd64610.cpp b/src/devices/machine/hd64610.cpp index 3c9b067592b..a4f28a13f08 100644 --- a/src/devices/machine/hd64610.cpp +++ b/src/devices/machine/hd64610.cpp @@ -175,7 +175,7 @@ void hd64610_device::device_start() // allocate timers m_counter_timer = timer_alloc(TIMER_UPDATE_COUNTER); - m_counter_timer->adjust(attotime::from_hz(clock() / 256), 0, attotime::from_hz(clock() / 256)); + m_counter_timer->adjust_periodic(attotime::from_hz(clock() / 256)); // state saving save_item(NAME(m_regs)); diff --git a/src/devices/machine/i8279.cpp b/src/devices/machine/i8279.cpp index ed58648166e..9305c187d4b 100644 --- a/src/devices/machine/i8279.cpp +++ b/src/devices/machine/i8279.cpp @@ -181,7 +181,7 @@ void i8279_device::timer_adjust() if (m_scanclock != new_clock) { - m_timer->adjust(attotime::from_ticks(64, new_clock), 0, attotime::from_ticks(64, new_clock)); + m_timer->adjust_periodic(attotime::from_ticks(64, new_clock)); m_scanclock = new_clock; } diff --git a/src/devices/machine/icm7170.cpp b/src/devices/machine/icm7170.cpp index 534b5c4c4c7..65d6248ce6b 100644 --- a/src/devices/machine/icm7170.cpp +++ b/src/devices/machine/icm7170.cpp @@ -90,7 +90,7 @@ void icm7170_device::device_start() m_timer = timer_alloc(ICM7170_TIMER_ID); // TODO: frequency should be based on input clock and divisor - m_timer->adjust(attotime::from_hz(100), 0, attotime::from_hz(100)); + m_timer->adjust_periodic(attotime::from_hz(100)); m_timer->enable(false); save_item(NAME(m_regs)); diff --git a/src/devices/machine/kb3600.cpp b/src/devices/machine/kb3600.cpp index 1cb3960be48..86e88ddf8f2 100644 --- a/src/devices/machine/kb3600.cpp +++ b/src/devices/machine/kb3600.cpp @@ -83,7 +83,7 @@ void ay3600_device::device_start() // allocate timers m_scan_timer = timer_alloc(); - m_scan_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); + m_scan_timer->adjust_periodic(attotime::from_hz(60)); m_ako = 0; diff --git a/src/devices/machine/keyboard.ipp b/src/devices/machine/keyboard.ipp index 5cbe54d5095..fc864f1d2e2 100644 --- a/src/devices/machine/keyboard.ipp +++ b/src/devices/machine/keyboard.ipp @@ -53,7 +53,7 @@ template <uint8_t ROW_COUNT> void device_matrix_keyboard_interface<ROW_COUNT>::start_processing(const attotime &period) { m_processing = 1U; - m_scan_timer.adjust(period, 0, period); + m_scan_timer.adjust_periodic(period); } diff --git a/src/devices/machine/m3002.cpp b/src/devices/machine/m3002.cpp index 55339217544..b5827f3aef2 100644 --- a/src/devices/machine/m3002.cpp +++ b/src/devices/machine/m3002.cpp @@ -102,7 +102,7 @@ void m3002_device::device_start() void m3002_device::device_clock_changed() { attotime second = clocks_to_attotime(32768); - m_second_timer->adjust(second, 0, second); + m_second_timer->adjust_periodic(second); } diff --git a/src/devices/machine/mc14411.cpp b/src/devices/machine/mc14411.cpp index 7935de29cb1..41d3fde2461 100644 --- a/src/devices/machine/mc14411.cpp +++ b/src/devices/machine/mc14411.cpp @@ -181,7 +181,7 @@ void mc14411_device::arm_timer(int i) if (i < TIMER_F15) divider *= s_divider_select[m_divider]; attotime half_cycle = clocks_to_attotime(divider) / 2; // 2 flanks per cycle - m_fx_timer[i]->adjust(half_cycle, i, half_cycle); + m_fx_timer[i]->adjust_periodic(half_cycle, i); LOGSETUP(" - arming timer for F%d at %fHz (/%d)\n", i + 1, double(clock()) / divider, divider); } @@ -206,7 +206,7 @@ void mc14411_device::device_reset() if (m_reset == ASSERT_LINE) { - m_reset_timer->adjust(attotime::from_nsec((double)900), TIMER_ID_RESET, attotime::from_nsec((double)900)); + m_reset_timer->adjust_periodic(attotime::from_nsec((double)900), TIMER_ID_RESET); } } diff --git a/src/devices/machine/mc68328.cpp b/src/devices/machine/mc68328.cpp index 7a8fa1e3fd2..3c8637dc34a 100644 --- a/src/devices/machine/mc68328.cpp +++ b/src/devices/machine/mc68328.cpp @@ -583,7 +583,7 @@ void mc68328_device::device_reset() m_regs.rtcienr = 0x00; m_regs.stpwtch = 0x00; - m_rtc->adjust(attotime::from_hz(1), 0, attotime::from_hz(1)); + m_rtc->adjust_periodic(attotime::from_hz(1)); } diff --git a/src/devices/machine/mc68901.cpp b/src/devices/machine/mc68901.cpp index 4905629bd33..261e6046474 100644 --- a/src/devices/machine/mc68901.cpp +++ b/src/devices/machine/mc68901.cpp @@ -696,7 +696,7 @@ void mc68901_device::write(offs_t offset, u8 data) { int divisor = PRESCALER[m_tacr & 0x07]; LOG("MC68901 Timer A Delay Mode : %u Prescale\n", divisor); - m_timer[TIMER_A]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor)); + m_timer[TIMER_A]->adjust_periodic(attotime::from_hz(m_timer_clock / divisor)); } break; @@ -715,7 +715,7 @@ void mc68901_device::write(offs_t offset, u8 data) { int divisor = PRESCALER[m_tacr & 0x07]; LOG("MC68901 Timer A Pulse Width Mode : %u Prescale\n", divisor); - m_timer[TIMER_A]->adjust(attotime::never, 0, attotime::from_hz(m_timer_clock / divisor)); + m_timer[TIMER_A]->adjust(attotime::never); m_timer[TIMER_A]->enable(false); } break; @@ -751,7 +751,7 @@ void mc68901_device::write(offs_t offset, u8 data) { int divisor = PRESCALER[m_tbcr & 0x07]; LOG("MC68901 Timer B Delay Mode : %u Prescale\n", divisor); - m_timer[TIMER_B]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor)); + m_timer[TIMER_B]->adjust_periodic(attotime::from_hz(m_timer_clock / divisor)); } break; @@ -768,9 +768,8 @@ void mc68901_device::write(offs_t offset, u8 data) case TCR_TIMER_PULSE_100: case TCR_TIMER_PULSE_200: { - int divisor = PRESCALER[m_tbcr & 0x07]; LOG("MC68901 Timer B Pulse Width Mode : %u Prescale\n", DIVISOR); - m_timer[TIMER_B]->adjust(attotime::never, 0, attotime::from_hz(m_timer_clock / divisor)); + m_timer[TIMER_B]->adjust(attotime::never); m_timer[TIMER_B]->enable(false); } break; @@ -806,7 +805,7 @@ void mc68901_device::write(offs_t offset, u8 data) { int divisor = PRESCALER[m_tcdcr & 0x07]; LOG("MC68901 Timer D Delay Mode : %u Prescale\n", divisor); - m_timer[TIMER_D]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor)); + m_timer[TIMER_D]->adjust_periodic(attotime::from_hz(m_timer_clock / divisor)); } break; } @@ -828,7 +827,7 @@ void mc68901_device::write(offs_t offset, u8 data) { int divisor = PRESCALER[(m_tcdcr >> 4) & 0x07]; LOG("MC68901 Timer C Delay Mode : %u Prescale\n", divisor); - m_timer[TIMER_C]->adjust(attotime::from_hz(m_timer_clock / divisor), 0, attotime::from_hz(m_timer_clock / divisor)); + m_timer[TIMER_C]->adjust_periodic(attotime::from_hz(m_timer_clock / divisor)); } break; } diff --git a/src/devices/machine/mccs1850.cpp b/src/devices/machine/mccs1850.cpp index 3a272d8f65f..4f9793212a7 100644 --- a/src/devices/machine/mccs1850.cpp +++ b/src/devices/machine/mccs1850.cpp @@ -325,7 +325,7 @@ void mccs1850_device::device_start() // allocate timers m_clock_timer = timer_alloc(TIMER_CLOCK); - m_clock_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); + m_clock_timer->adjust_periodic(attotime::from_hz(clock() / 32768)); // state saving save_item(NAME(m_pse)); diff --git a/src/devices/machine/microtch.cpp b/src/devices/machine/microtch.cpp index 2e26e384c52..82274bfb06a 100644 --- a/src/devices/machine/microtch.cpp +++ b/src/devices/machine/microtch.cpp @@ -228,7 +228,7 @@ void microtouch_device::device_start() m_last_touch_state = -1; m_timer = timer_alloc(); - m_timer->adjust(attotime::from_hz(167*5), 0, attotime::from_hz(167*5)); + m_timer->adjust_periodic(attotime::from_hz(167*5)); m_format = FORMAT_UNKNOWN; m_mode = MODE_INACTIVE; diff --git a/src/devices/machine/mm5740.cpp b/src/devices/machine/mm5740.cpp index 43939ee9be2..925dd4a1acf 100644 --- a/src/devices/machine/mm5740.cpp +++ b/src/devices/machine/mm5740.cpp @@ -80,7 +80,7 @@ void mm5740_device::device_start() // allocate timers m_scan_timer = timer_alloc(); - m_scan_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); + m_scan_timer->adjust_periodic(attotime::from_hz(clock())); // state saving save_item(NAME(m_b)); diff --git a/src/devices/machine/mm58167.cpp b/src/devices/machine/mm58167.cpp index 4ba9308615d..4e3275344d2 100644 --- a/src/devices/machine/mm58167.cpp +++ b/src/devices/machine/mm58167.cpp @@ -68,7 +68,7 @@ void mm58167_device::device_start() { // allocate timers m_clock_timer = timer_alloc(); - m_clock_timer->adjust(attotime::from_hz(clock() / 32.768f), 0, attotime::from_hz(clock() / 32.768f)); + m_clock_timer->adjust_periodic(attotime::from_hz(clock() / 32.768f)); m_irq_w.resolve_safe(); diff --git a/src/devices/machine/mos6526.cpp b/src/devices/machine/mos6526.cpp index 8cf896c1922..7a274ec4832 100644 --- a/src/devices/machine/mos6526.cpp +++ b/src/devices/machine/mos6526.cpp @@ -645,7 +645,7 @@ void mos6526_device::device_start() if (m_tod_clock > 0) { m_tod_timer = timer_alloc(); - m_tod_timer->adjust(attotime::from_hz(m_tod_clock), 0, attotime::from_hz(m_tod_clock)); + m_tod_timer->adjust_periodic(attotime::from_hz(m_tod_clock)); } // state saving diff --git a/src/devices/machine/msm5832.cpp b/src/devices/machine/msm5832.cpp index 2e0dcae56da..12a4d914ae2 100644 --- a/src/devices/machine/msm5832.cpp +++ b/src/devices/machine/msm5832.cpp @@ -111,7 +111,7 @@ void msm5832_device::device_start() { // allocate timers m_clock_timer = timer_alloc(TIMER_CLOCK); - m_clock_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); + m_clock_timer->adjust_periodic(attotime::from_hz(clock() / 32768)); // state saving save_item(NAME(m_reg)); diff --git a/src/devices/machine/msm58321.cpp b/src/devices/machine/msm58321.cpp index 842879f3c0a..d31e64ccea3 100644 --- a/src/devices/machine/msm58321.cpp +++ b/src/devices/machine/msm58321.cpp @@ -210,7 +210,7 @@ void msm58321_device::device_start() // allocate timers m_clock_timer = timer_alloc(TIMER_CLOCK); - m_clock_timer->adjust(clocks_to_attotime(32768/1024), 0, clocks_to_attotime(32768/1024)); + m_clock_timer->adjust_periodic(clocks_to_attotime(32768/1024)); // busy signal active period is approximately 427 µs m_busy_timer = timer_alloc(TIMER_BUSY); diff --git a/src/devices/machine/pcf8573.cpp b/src/devices/machine/pcf8573.cpp index 860a443d84d..68e7cadf10f 100644 --- a/src/devices/machine/pcf8573.cpp +++ b/src/devices/machine/pcf8573.cpp @@ -62,7 +62,7 @@ void pcf8573_device::device_start() // allocate timers m_clock_timer = timer_alloc(); - m_clock_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); + m_clock_timer->adjust_periodic(attotime::from_hz(clock() / 32768)); // state saving save_item(NAME(m_scl)); diff --git a/src/devices/machine/pcf8583.cpp b/src/devices/machine/pcf8583.cpp index 5286c63bdea..2e13c41896b 100644 --- a/src/devices/machine/pcf8583.cpp +++ b/src/devices/machine/pcf8583.cpp @@ -56,7 +56,7 @@ pcf8583_device::pcf8583_device(const machine_config &mconfig, const char *tag, d void pcf8583_device::device_start() { m_timer = timer_alloc(TIMER_TICK); - m_timer->adjust(attotime::from_hz(100), 0, attotime::from_hz(100)); + m_timer->adjust_periodic(attotime::from_hz(100)); save_item(NAME(m_scl)); save_item(NAME(m_sdaw)); diff --git a/src/devices/machine/pcf8593.cpp b/src/devices/machine/pcf8593.cpp index 3a07050cae7..83e0cc70adc 100644 --- a/src/devices/machine/pcf8593.cpp +++ b/src/devices/machine/pcf8593.cpp @@ -64,7 +64,7 @@ void pcf8593_device::device_start() _logerror( 0, ("pcf8593_init\n")); memset(m_register, 0, sizeof(m_register)); m_timer = timer_alloc(TIMER_UPDATE_COUNTER); - m_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); + m_timer->adjust_periodic(attotime::from_seconds(1)); } //------------------------------------------------- diff --git a/src/devices/machine/r10788.cpp b/src/devices/machine/r10788.cpp index 56470527373..b48501c108e 100644 --- a/src/devices/machine/r10788.cpp +++ b/src/devices/machine/r10788.cpp @@ -82,7 +82,7 @@ void r10788_device::device_start() m_timer = timer_alloc(TIMER_DISPLAY); // recurring timer every 36 cycles - m_timer->adjust(clocks_to_attotime(36), 0, clocks_to_attotime(36)); + m_timer->adjust_periodic(clocks_to_attotime(36)); } /** diff --git a/src/devices/machine/ripple_counter.cpp b/src/devices/machine/ripple_counter.cpp index 881313164e8..037a2fc3a8c 100644 --- a/src/devices/machine/ripple_counter.cpp +++ b/src/devices/machine/ripple_counter.cpp @@ -111,7 +111,7 @@ void ripple_counter_device::device_start() void ripple_counter_device::device_clock_changed() { attotime freq = m_reset ? attotime::never : clocks_to_attotime(1); - m_count_timer->adjust(freq, 0, freq); + m_count_timer->adjust_periodic(freq, 0); } diff --git a/src/devices/machine/rp5c01.cpp b/src/devices/machine/rp5c01.cpp index 4fa58898c18..51081976af8 100644 --- a/src/devices/machine/rp5c01.cpp +++ b/src/devices/machine/rp5c01.cpp @@ -202,10 +202,10 @@ void rp5c01_device::device_start() if (clock() > 0) { m_clock_timer = timer_alloc(TIMER_CLOCK); - m_clock_timer->adjust(attotime::from_hz(clock() / 16384), 0, attotime::from_hz(clock() / 16384)); + m_clock_timer->adjust_periodic(attotime::from_hz(clock() / 16384)); m_16hz_timer = timer_alloc(TIMER_16HZ); - m_16hz_timer->adjust(attotime::from_hz(clock() / 1024), 0, attotime::from_hz(clock() / 1024)); + m_16hz_timer->adjust_periodic(attotime::from_hz(clock() / 1024)); } memset(m_reg, 0, sizeof(m_reg)); diff --git a/src/devices/machine/rp5c15.cpp b/src/devices/machine/rp5c15.cpp index 411909225a6..24ab1960d73 100644 --- a/src/devices/machine/rp5c15.cpp +++ b/src/devices/machine/rp5c15.cpp @@ -208,10 +208,10 @@ void rp5c15_device::device_start() // allocate timers m_clock_timer = timer_alloc(TIMER_CLOCK); - m_clock_timer->adjust(attotime::from_hz(clock() / 16384), 0, attotime::from_hz(clock() / 16384)); + m_clock_timer->adjust_periodic(attotime::from_hz(clock() / 16384)); m_16hz_timer = timer_alloc(TIMER_16HZ); - m_16hz_timer->adjust(attotime::from_hz(clock() / 1024), 0, attotime::from_hz(clock() / 1024)); + m_16hz_timer->adjust_periodic(attotime::from_hz(clock() / 1024)); m_clkout_timer = timer_alloc(TIMER_CLKOUT); @@ -378,23 +378,23 @@ void rp5c15_device::write(offs_t offset, uint8_t data) switch (data & 0x07) { case CLKOUT_16384_HZ: - m_clkout_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); + m_clkout_timer->adjust_periodic(attotime::from_hz(clock())); break; case CLKOUT_1024_HZ: - m_clkout_timer->adjust(attotime::from_hz(clock() / 16), 0, attotime::from_hz(clock() / 16)); + m_clkout_timer->adjust_periodic(attotime::from_hz(clock() / 16)); break; case CLKOUT_128_HZ: - m_clkout_timer->adjust(attotime::from_hz(clock() / 128), 0, attotime::from_hz(clock() / 128)); + m_clkout_timer->adjust_periodic(attotime::from_hz(clock() / 128)); break; case CLKOUT_16_HZ: - m_clkout_timer->adjust(attotime::from_hz(clock() / 1024), 0, attotime::from_hz(clock() / 1024)); + m_clkout_timer->adjust_periodic(attotime::from_hz(clock() / 1024)); break; case CLKOUT_1_HZ: - m_clkout_timer->adjust(attotime::from_hz(clock() / 16384), 0, attotime::from_hz(clock() / 16384)); + m_clkout_timer->adjust_periodic(attotime::from_hz(clock() / 16384)); break; case CLKOUT_1_DIV_60_HZ: diff --git a/src/devices/machine/rtc4543.cpp b/src/devices/machine/rtc4543.cpp index 2b4554f77d6..7bb4913042b 100644 --- a/src/devices/machine/rtc4543.cpp +++ b/src/devices/machine/rtc4543.cpp @@ -74,7 +74,7 @@ void rtc4543_device::device_start() // allocate timers m_clock_timer = timer_alloc(); - m_clock_timer->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); + m_clock_timer->adjust_periodic(attotime::from_hz(clock() / 32768)); // state saving save_item(NAME(m_ce)); diff --git a/src/devices/machine/rtc65271.cpp b/src/devices/machine/rtc65271.cpp index bc8261052bb..cdcd15f451a 100644 --- a/src/devices/machine/rtc65271.cpp +++ b/src/devices/machine/rtc65271.cpp @@ -678,7 +678,7 @@ rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag, void rtc65271_device::device_start() { m_update_timer = timer_alloc(*this, FUNC(rtc65271_device::rtc_begin_update_cb)); - m_update_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); + m_update_timer->adjust_periodic(attotime::from_seconds(1)); m_SQW_timer = timer_alloc(*this, FUNC(rtc65271_device::rtc_SQW_cb)); m_interrupt_cb.resolve(); diff --git a/src/devices/machine/rtc9701.cpp b/src/devices/machine/rtc9701.cpp index d5f8c175ad2..c67575932ab 100644 --- a/src/devices/machine/rtc9701.cpp +++ b/src/devices/machine/rtc9701.cpp @@ -93,7 +93,7 @@ void rtc9701_device::device_start() { /* let's call the timer callback every second */ m_timer = timer_alloc(*this, FUNC(rtc9701_device::timer_callback)); - m_timer->adjust(attotime::from_hz(clock() / XTAL(32'768)), 0, attotime::from_hz(clock() / XTAL(32'768))); + m_timer->adjust_periodic(attotime::from_hz(clock() / XTAL(32'768))); system_time systime; machine().base_datetime(systime); diff --git a/src/devices/machine/s3520cf.cpp b/src/devices/machine/s3520cf.cpp index 08f77422764..ed95155d9ed 100644 --- a/src/devices/machine/s3520cf.cpp +++ b/src/devices/machine/s3520cf.cpp @@ -106,7 +106,7 @@ void s3520cf_device::device_start() { /* let's call the timer callback every second for now */ m_timer = timer_alloc(*this, FUNC(s3520cf_device::timer_callback)); - m_timer->adjust(attotime::from_hz(clock() / XTAL(32'768)), 0, attotime::from_hz(clock() / XTAL(32'768))); + m_timer->adjust_periodic(attotime::from_hz(clock() / XTAL(32'768))); system_time systime; machine().base_datetime(systime); diff --git a/src/devices/machine/s3c24xx.cpp b/src/devices/machine/s3c24xx.cpp index 40cebd1b643..5de7ced7b3f 100644 --- a/src/devices/machine/s3c24xx.cpp +++ b/src/devices/machine/s3c24xx.cpp @@ -97,8 +97,7 @@ void s3c24xx_peripheral_types::rtc_t::reset() std::memset(®s, 0, sizeof(regs)); regs.almday = 1; regs.almmon = 1; - timer_update->adjust(attotime::never); - timer_update->adjust(attotime::from_msec(1000), 0, attotime::from_msec(1000)); + timer_update->adjust_periodic(attotime::from_msec(1000)); } void s3c24xx_peripheral_types::rtc_t::recalc() @@ -108,7 +107,7 @@ void s3c24xx_peripheral_types::rtc_t::recalc() uint32_t const ttc = BITS(regs.ticnt, 6, 0); double const freq = 128.0 / (ttc + 1); LOG("ttc %u freq %f\n", ttc, freq); - timer_tick_count->adjust(attotime::from_hz(freq), 0, attotime::from_hz(freq)); + timer_tick_count->adjust_periodic(attotime::from_hz(freq)); } else { diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx index 77928803397..335a982ba92 100644 --- a/src/devices/machine/s3c24xx.hxx +++ b/src/devices/machine/s3c24xx.hxx @@ -1425,7 +1425,7 @@ void S3C24_CLASS_NAME::s3c24xx_pwm_start(int timer) m_pwm.freq[timer] = freq; if (auto_reload) { - m_pwm.timer[timer]->adjust(attotime::from_hz(hz), timer, attotime::from_hz(hz)); + m_pwm.timer[timer]->adjust_periodic(attotime::from_hz(hz), timer); } else { @@ -2160,7 +2160,7 @@ void S3C24_CLASS_NAME::s3c24xx_wdt_start() freq = (double)pclk / (prescaler + 1) / clock; hz = freq / m_wdt.regs.wtcnt; LOGMASKED(LOG_WDT, "watchdog start: pclk %d prescaler %d clock %d freq %f hz %f\n", pclk, prescaler, clock, freq, hz); - m_wdt.timer->adjust( attotime::from_hz( hz), 0, attotime::from_hz( hz)); + m_wdt.timer->adjust_periodic( attotime::from_hz( hz)); #if defined(DEVICE_S3C2410) m_wdt.freq = freq; m_wdt.cnt = m_wdt.regs.wtcnt; @@ -2468,7 +2468,7 @@ void S3C24_CLASS_NAME::s3c24xx_iis_start() int pclk = s3c24xx_get_pclk(); double freq = ((double)pclk / (prescaler_control_a + 1) / codeclk_table[codeclk]) * 2; // why do I have to multiply by two? LOGMASKED(LOG_I2S, "IIS - pclk %d psc_enable %d psc_a %d psc_b %d codeclk %d freq %f\n", pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk_table[codeclk], freq); - m_iis.timer->adjust( attotime::from_hz( freq), 0, attotime::from_hz( freq)); + m_iis.timer->adjust_periodic( attotime::from_hz( freq)); } void S3C24_CLASS_NAME::s3c24xx_iis_stop() diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index b19eac7063c..d27ad6ee902 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -1155,7 +1155,7 @@ void s3c44b0_device::pwm_start(int timer) { if (auto_reload) { - m_pwm.timer[timer]->adjust(attotime::from_hz(hz), timer, attotime::from_hz(hz)); + m_pwm.timer[timer]->adjust_periodic(attotime::from_hz(hz), timer); } else { @@ -1609,7 +1609,7 @@ void s3c44b0_device::uart_w(int ch, uint32_t offset, uint32_t data, uint32_t mem mclk = get_mclk(); hz = (mclk / (m_uart->regs.ubrdiv + 1)) / 16; verboselog( *this, 5, "UART %d - mclk %08X hz %08X\n", ch, mclk, hz); - m_uart->timer->adjust(attotime::from_hz(hz), ch, attotime::from_hz(hz)); + m_uart->timer->adjust_periodic(attotime::from_hz(hz), ch); } break; } @@ -1696,7 +1696,7 @@ void s3c44b0_device::wdt_start() freq = (double)mclk / (prescaler + 1) / clock; hz = freq / m_wdt.regs.wtcnt; verboselog( *this, 5, "WDT mclk %d prescaler %d clock %d freq %f hz %f\n", mclk, prescaler, clock, freq, hz); - m_wdt.timer->adjust(attotime::from_hz(hz), 0, attotime::from_hz(hz)); + m_wdt.timer->adjust_periodic(attotime::from_hz(hz)); } void s3c44b0_device::wdt_stop() @@ -1912,7 +1912,7 @@ void s3c44b0_device::iis_start() freq = (double)mclk / div[prescaler]; hz = freq / 256 * 2; verboselog( *this, 5, "IIS mclk %d prescaler %d freq %f hz %f\n", mclk, prescaler, freq, hz); - m_iis.timer->adjust(attotime::from_hz(hz), 0, attotime::from_hz(hz)); + m_iis.timer->adjust_periodic(attotime::from_hz(hz)); } void s3c44b0_device::iis_stop() diff --git a/src/devices/machine/s_smp.cpp b/src/devices/machine/s_smp.cpp index c2dca533bc8..862c44c1b57 100644 --- a/src/devices/machine/s_smp.cpp +++ b/src/devices/machine/s_smp.cpp @@ -130,7 +130,7 @@ void s_smp_device::device_reset() } attotime period = attotime::from_ticks(32, clock()); - m_tick_timer->adjust(period, 0, period); + m_tick_timer->adjust_periodic(period); spc700_device::device_reset(); } @@ -142,7 +142,7 @@ void s_smp_device::device_reset() void s_smp_device::device_clock_changed() { attotime period = attotime::from_ticks(32, clock()); - m_tick_timer->adjust(period, 0, period); + m_tick_timer->adjust_periodic(period); } //------------------------------------------------- diff --git a/src/devices/machine/sa1110.cpp b/src/devices/machine/sa1110.cpp index 70f2f068ce1..c47bc148f2d 100644 --- a/src/devices/machine/sa1110.cpp +++ b/src/devices/machine/sa1110.cpp @@ -914,10 +914,10 @@ attotime sa1110_periphs_device::mcp_get_telecom_frame_rate() void sa1110_periphs_device::mcp_update_sample_rate() { const attotime audio_rate = mcp_get_audio_frame_rate(); - m_mcp_regs.audio_tx_timer->adjust(audio_rate, 0, audio_rate); + m_mcp_regs.audio_tx_timer->adjust_periodic(audio_rate); const attotime telecom_rate = mcp_get_telecom_frame_rate(); - m_mcp_regs.telecom_tx_timer->adjust(telecom_rate, 0, telecom_rate); + m_mcp_regs.telecom_tx_timer->adjust_periodic(telecom_rate); } void sa1110_periphs_device::mcp_set_enabled(bool enabled) @@ -1197,8 +1197,8 @@ void sa1110_periphs_device::ssp_update_enable_state() uint64_t bit_count = (m_ssp_regs.sscr0 & SSCR0_DSS_MASK) >> SSCR0_DSS_BIT; uint32_t clock_rate = 2 * (((m_ssp_regs.sscr0 & SSCR0_SCR_MASK) >> SSCR0_SCR_BIT) + 1); attotime packet_rate = attotime::from_ticks(bit_count * clock_rate, 3686400); - m_ssp_regs.rx_timer->adjust(packet_rate, 0, packet_rate); - m_ssp_regs.tx_timer->adjust(packet_rate, 0, packet_rate); + m_ssp_regs.rx_timer->adjust_periodic(packet_rate); + m_ssp_regs.tx_timer->adjust_periodic(packet_rate); } else { @@ -2567,7 +2567,7 @@ void sa1110_periphs_device::device_reset() m_rtc_regs.rcnr = 0; m_rtc_regs.rttr = 0; m_rtc_regs.rtsr = 0; - m_rtc_regs.tick_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); + m_rtc_regs.tick_timer->adjust_periodic(attotime::from_seconds(1)); // init power regs m_power_regs.pmcr = 0; diff --git a/src/devices/machine/sa1111.cpp b/src/devices/machine/sa1111.cpp index e35977793d5..649531a4e13 100644 --- a/src/devices/machine/sa1111.cpp +++ b/src/devices/machine/sa1111.cpp @@ -634,7 +634,7 @@ void sa1111_device::audio_start_tx_dma(const uint32_t buf) const uint32_t divisor = ((m_sk_regs.skaud & SKAUD_ACD_MASK) >> SKAUD_ACD_BIT) + 1; const uint32_t pll_clock = clock() * 39; attotime clock_period = attotime::from_ticks(divisor * 128, pll_clock); - m_audio_regs.tx_dma_timer->adjust(clock_period, 0, clock_period); + m_audio_regs.tx_dma_timer->adjust_periodic(clock_period); LOGMASKED(LOG_AUDIO_DMA, "audio_start_tx_dma, setting start address to %08x, Tx clock to %d / %d\n", m_audio_regs.sadta, pll_clock, divisor); } @@ -649,7 +649,7 @@ void sa1111_device::audio_start_rx_dma(const uint32_t buf) const uint32_t divisor = ((m_sk_regs.skaud & SKAUD_ACD_MASK) >> SKAUD_ACD_BIT) + 1; const uint32_t pll_clock = clock() * 39; attotime clock_period = attotime::from_ticks(divisor * 256, pll_clock); - m_audio_regs.rx_dma_timer->adjust(clock_period, 0, clock_period); + m_audio_regs.rx_dma_timer->adjust_periodic(clock_period); } void sa1111_device::audio_update_tx_fifo_levels() @@ -724,7 +724,7 @@ void sa1111_device::audio_tx_fifo_push(uint32_t data) const uint32_t divisor = ((m_sk_regs.skaud & SKAUD_ACD_MASK) >> SKAUD_ACD_BIT) + 1; const uint32_t pll_clock = clock() * 39; attotime clock_period = attotime::from_ticks(divisor * 256, pll_clock); - m_audio_regs.tx_timer->adjust(clock_period, 0, clock_period); + m_audio_regs.tx_timer->adjust_periodic(clock_period); } } } @@ -1293,8 +1293,8 @@ void sa1111_device::ssp_update_enable_state() uint64_t bit_count = (m_ssp_regs.sspcr0 & SSPCR0_DSS_MASK) >> SSPCR0_DSS_BIT; uint32_t clock_rate = 2 * (((m_ssp_regs.sspcr0 & SSPCR0_SCR_MASK) >> SSPCR0_SCR_BIT) + 1); attotime packet_rate = attotime::from_ticks(bit_count * clock_rate, 3686400); - m_ssp_regs.rx_timer->adjust(packet_rate, 0, packet_rate); - m_ssp_regs.tx_timer->adjust(packet_rate, 0, packet_rate); + m_ssp_regs.rx_timer->adjust_periodic(packet_rate); + m_ssp_regs.tx_timer->adjust_periodic(packet_rate); } else { diff --git a/src/devices/machine/scc68070.cpp b/src/devices/machine/scc68070.cpp index c5308d8e597..013f148a0aa 100644 --- a/src/devices/machine/scc68070.cpp +++ b/src/devices/machine/scc68070.cpp @@ -775,8 +775,8 @@ void scc68070_device::ucsr_w(uint8_t data) attotime rx_rate = attotime::from_ticks(s_baud_divisors[(data >> 4) & 7] * 10, 49152000); attotime tx_rate = attotime::from_ticks(s_baud_divisors[data & 7] * 10, 49152000); - m_uart.rx_timer->adjust(rx_rate, 0, rx_rate); - m_uart.tx_timer->adjust(tx_rate, 0, tx_rate); + m_uart.rx_timer->adjust_periodic(rx_rate); + m_uart.tx_timer->adjust_periodic(tx_rate); } uint8_t scc68070_device::ucr_r() diff --git a/src/devices/machine/scn_pci.cpp b/src/devices/machine/scn_pci.cpp index bd1e460ac3c..63df936ea57 100644 --- a/src/devices/machine/scn_pci.cpp +++ b/src/devices/machine/scn_pci.cpp @@ -1284,7 +1284,7 @@ void scn_pci_device::write_mode(u8 data) else { attotime brg_period = clocks_to_attotime(m_br_div[data & 0x0f]); - m_brg_timer->adjust(brg_period / 2, 0, brg_period / 2); + m_brg_timer->adjust_periodic(brg_period / 2); } } diff --git a/src/devices/machine/scnxx562.cpp b/src/devices/machine/scnxx562.cpp index 21d9f9824c0..7b8f1482468 100644 --- a/src/devices/machine/scnxx562.cpp +++ b/src/devices/machine/scnxx562.cpp @@ -759,7 +759,7 @@ void duscc_channel::device_timer(timer_instance const &timer) else // Pulse! { m_rtxc = 1; - rtxc_timer->adjust(attotime::from_hz(clock()), TIMER_ID_RTXC, attotime::from_hz(clock())); + rtxc_timer->adjust_periodic(attotime::from_hz(clock()), TIMER_ID_RTXC); } if (m_index == duscc_device::CHANNEL_A) m_uart->m_out_rtxca_cb(m_rtxc); @@ -777,7 +777,7 @@ void duscc_channel::device_timer(timer_instance const &timer) else // Pulse! { m_trxc = 1; - trxc_timer->adjust(attotime::from_hz(clock()), TIMER_ID_TRXC, attotime::from_hz(clock())); + trxc_timer->adjust_periodic(attotime::from_hz(clock()), TIMER_ID_TRXC); } if (m_index == duscc_device::CHANNEL_A) m_uart->m_out_trxca_cb(m_trxc); @@ -2007,7 +2007,7 @@ void duscc_channel::do_dusccreg_ccr_w(uint8_t data) /* Start. Starts the counteritimer and prescaler. */ case REG_CCR_START_TIMER: LOG("- Start Counter/Timer\n"); rate = 100; // TODO: calculate correct rate - duscc_timer->adjust(attotime::from_hz(rate), TIMER_ID_RTXC, attotime::from_hz(rate)); + duscc_timer->adjust_periodic(attotime::from_hz(rate), TIMER_ID_RTXC); break; /* Stop. Stops the counter/timer and prescaler. Since the command may be asynchronous with the selected clock source, diff --git a/src/devices/machine/smioc.cpp b/src/devices/machine/smioc.cpp index 3c6bc9a5392..6fb2a565e43 100644 --- a/src/devices/machine/smioc.cpp +++ b/src/devices/machine/smioc.cpp @@ -221,7 +221,7 @@ void smioc_device::device_start() m_m68k_r_cb.resolve_safe(0); m_m68k_w_cb.resolve_safe(); - m_451_timer->adjust(attotime::from_msec(200), 0, attotime::from_msec(200)); + m_451_timer->adjust_periodic(attotime::from_msec(200)); } //------------------------------------------------- diff --git a/src/devices/machine/spg290_cdservo.cpp b/src/devices/machine/spg290_cdservo.cpp index 004e3004cfb..6070ff8b90e 100644 --- a/src/devices/machine/spg290_cdservo.cpp +++ b/src/devices/machine/spg290_cdservo.cpp @@ -335,7 +335,7 @@ void spg290_cdservo_device::change_status() if (m_speed == 0 || !m_cdrom.found() || !m_cdrom->get_cdrom_file()) m_cdtimer->adjust(attotime::never); else - m_cdtimer->adjust(attotime::from_hz(75 * m_speed), 0, attotime::from_hz(75 * m_speed)); + m_cdtimer->adjust_periodic(attotime::from_hz(75 * m_speed)); } void spg290_cdservo_device::add_qsub(int sector, uint8_t addrctrl, uint8_t track, uint8_t index, uint32_t rel_msf, uint32_t abs_msf, uint16_t crc16) diff --git a/src/devices/machine/spg290_timer.cpp b/src/devices/machine/spg290_timer.cpp index 909fda5ccdc..f10ae3d4294 100644 --- a/src/devices/machine/spg290_timer.cpp +++ b/src/devices/machine/spg290_timer.cpp @@ -51,7 +51,7 @@ void spg290_timer_device::device_reset() void spg290_timer_device::device_clock_changed() { if (m_enabled) - m_tick_timer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock())); + m_tick_timer->adjust_periodic(attotime::from_hz(clock())); else m_tick_timer->adjust(attotime::never); } diff --git a/src/devices/machine/spg2xx_audio.cpp b/src/devices/machine/spg2xx_audio.cpp index 9f4db7be594..c59e131d54f 100644 --- a/src/devices/machine/spg2xx_audio.cpp +++ b/src/devices/machine/spg2xx_audio.cpp @@ -138,7 +138,7 @@ void spg2xx_audio_device::device_reset() m_audio_ctrl_regs[AUDIO_CHANNEL_REPEAT] = 0x3f; m_audio_ctrl_regs[AUDIO_CHANNEL_ENV_MODE] = 0x3f; - m_audio_beat->adjust(attotime::from_ticks(4, 281250), 0, attotime::from_ticks(4, 281250)); + m_audio_beat->adjust_periodic(attotime::from_ticks(4, 281250)); for (int i = 0; i < 16; i++) { @@ -480,7 +480,7 @@ void spg2xx_audio_device::audio_ctrl_w(offs_t offset, uint16_t data) m_audio_ctrl_regs[offset] |= mask; if (BIT(m_audio_ctrl_regs[AUDIO_CHANNEL_FIQ_ENABLE], channel_bit)) { - m_channel_irq[channel_bit]->adjust(attotime::from_hz(m_channel_rate[channel_bit]), 0, attotime::from_hz(m_channel_rate[channel_bit])); + m_channel_irq[channel_bit]->adjust_periodic(attotime::from_hz(m_channel_rate[channel_bit])); } else { diff --git a/src/devices/machine/spg2xx_io.cpp b/src/devices/machine/spg2xx_io.cpp index 07729bbb111..8d880ccb32e 100644 --- a/src/devices/machine/spg2xx_io.cpp +++ b/src/devices/machine/spg2xx_io.cpp @@ -200,9 +200,9 @@ void spg2xx_io_device::device_reset() std::fill_n(&m_extint[0], 2, false); - m_4khz_timer->adjust(attotime::from_hz(4096), 0, attotime::from_hz(4096)); + m_4khz_timer->adjust_periodic(attotime::from_hz(4096)); - m_rng_timer->adjust(attotime::from_hz(1234), 0, attotime::from_hz(1234)); // timer value is arbitrary, maybe should match system clock, but that would result in heavy switching + m_rng_timer->adjust_periodic(attotime::from_hz(1234)); // timer value is arbitrary, maybe should match system clock, but that would result in heavy switching m_tmb1->adjust(attotime::never); m_tmb2->adjust(attotime::never); @@ -688,13 +688,13 @@ void spg2xx_io_device::update_timer_b_rate() m_timer_src_c->adjust(attotime::never); break; case 2: - m_timer_src_c->adjust(attotime::from_hz(32768), 0, attotime::from_hz(32768)); + m_timer_src_c->adjust_periodic(attotime::from_hz(32768)); break; case 3: - m_timer_src_c->adjust(attotime::from_hz(8192), 0, attotime::from_hz(8192)); + m_timer_src_c->adjust_periodic(attotime::from_hz(8192)); break; case 4: - m_timer_src_c->adjust(attotime::from_hz(4096), 0, attotime::from_hz(4096)); + m_timer_src_c->adjust_periodic(attotime::from_hz(4096)); break; } } @@ -843,9 +843,9 @@ void spg2xx_io_device::io_w(offs_t offset, uint16_t data) m_io_regs[REG_TIMEBASE_SETUP] = data; const uint8_t hifreq = BIT(data, 4); const uint32_t tmb1freq = s_tmb1_freq[hifreq][data & 3]; - m_tmb1->adjust(attotime::from_hz(tmb1freq), 0, attotime::from_hz(tmb1freq)); + m_tmb1->adjust_periodic(attotime::from_hz(tmb1freq)); const uint32_t tmb2freq = s_tmb2_freq[hifreq][(data >> 2) & 3]; - m_tmb2->adjust(attotime::from_hz(tmb2freq), 0, attotime::from_hz(tmb2freq)); + m_tmb2->adjust_periodic(attotime::from_hz(tmb2freq)); break; } @@ -880,15 +880,15 @@ void spg2xx_io_device::io_w(offs_t offset, uint16_t data) m_timer_src_ab->adjust(attotime::never); break; case 2: - m_timer_src_ab->adjust(attotime::from_hz(32768), 0, attotime::from_hz(32768)); + m_timer_src_ab->adjust_periodic(attotime::from_hz(32768)); timer_a_rate = 32768; break; case 3: - m_timer_src_ab->adjust(attotime::from_hz(8192), 0, attotime::from_hz(8192)); + m_timer_src_ab->adjust_periodic(attotime::from_hz(8192)); timer_a_rate = 8192; break; case 4: - m_timer_src_ab->adjust(attotime::from_hz(4096), 0, attotime::from_hz(4096)); + m_timer_src_ab->adjust_periodic(attotime::from_hz(4096)); timer_a_rate = 4096; break; } @@ -1099,7 +1099,7 @@ void spg2xx_io_device::io_w(offs_t offset, uint16_t data) if (BIT(data, 10)) { m_io_regs[REG_ADC_DATA] &= ~0x8000; - m_adc_timer[adc_channel]->adjust(attotime::from_hz(8000), 0, attotime::from_hz(8000)); + m_adc_timer[adc_channel]->adjust_periodic(attotime::from_hz(8000)); } } else @@ -1334,7 +1334,7 @@ void spg2xx_io_device::io_extended_w(offs_t offset, uint16_t data) m_spi_tx_fifo_count++; attotime rate = attotime::from_ticks(m_spi_rate, clock()); - m_spi_tx_timer->adjust(rate, 0, rate); + m_spi_tx_timer->adjust_periodic(rate); } else { diff --git a/src/devices/machine/timekpr.cpp b/src/devices/machine/timekpr.cpp index b9028e9f69e..8b7306cb7d6 100644 --- a/src/devices/machine/timekpr.cpp +++ b/src/devices/machine/timekpr.cpp @@ -228,7 +228,7 @@ void timekeeper_device::device_start() save_item(NAME(m_watchdog_delay)); emu_timer *timer = timer_alloc(); - timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); + timer->adjust_periodic(attotime::from_seconds(1)); m_watchdog_timer = timer_alloc(*this, FUNC(timekeeper_device::watchdog_callback)); m_watchdog_timer->adjust(attotime::never); diff --git a/src/devices/machine/tms9901.cpp b/src/devices/machine/tms9901.cpp index 46aac576122..e45cb2587cc 100644 --- a/src/devices/machine/tms9901.cpp +++ b/src/devices/machine/tms9901.cpp @@ -604,7 +604,7 @@ void tms9901_device::device_start() if (clock() != 0) { m_decrementer = timer_alloc(DECREMENTER); - m_decrementer->adjust(attotime::from_hz(clock() / 64.), 0, attotime::from_hz(clock() / 64.)); + m_decrementer->adjust_periodic(attotime::from_hz(clock() / 64.)); } m_read_port.resolve(); diff --git a/src/devices/machine/upd1990a.cpp b/src/devices/machine/upd1990a.cpp index 4003778c91b..34a3d8ac385 100644 --- a/src/devices/machine/upd1990a.cpp +++ b/src/devices/machine/upd1990a.cpp @@ -93,7 +93,7 @@ void upd1990a_device::device_start() // allocate timers m_timer_clock = timer_alloc(TIMER_CLOCK); - m_timer_clock->adjust(attotime::from_hz(clock() / 32768.0), 0, attotime::from_hz(clock() / 32768.0)); // 1 second on XTAL(32'768) + m_timer_clock->adjust_periodic(attotime::from_hz(clock() / 32768.0)); // 1 second on XTAL(32'768) m_timer_tp = timer_alloc(TIMER_TP); m_timer_data_out = timer_alloc(TIMER_DATA_OUT); m_timer_test_mode = timer_alloc(TIMER_TEST_MODE); diff --git a/src/devices/machine/upd4991a.cpp b/src/devices/machine/upd4991a.cpp index b64e02e4ec3..d04d4d73e29 100644 --- a/src/devices/machine/upd4991a.cpp +++ b/src/devices/machine/upd4991a.cpp @@ -63,7 +63,7 @@ void upd4991a_device::device_validity_check(validity_checker &valid) const void upd4991a_device::device_start() { m_timer_clock = timer_alloc(TIMER_CLOCK); - m_timer_clock->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); + m_timer_clock->adjust_periodic(attotime::from_hz(clock() / 32768)); save_item(NAME(m_address)); } diff --git a/src/devices/machine/upd4992.cpp b/src/devices/machine/upd4992.cpp index ad2a90dff5e..99ea59f98e1 100644 --- a/src/devices/machine/upd4992.cpp +++ b/src/devices/machine/upd4992.cpp @@ -59,7 +59,7 @@ void upd4992_device::device_validity_check(validity_checker &valid) const void upd4992_device::device_start() { m_timer_clock = timer_alloc(TIMER_CLOCK); - m_timer_clock->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768)); + m_timer_clock->adjust_periodic(attotime::from_hz(clock() / 32768)); } diff --git a/src/devices/machine/v3021.cpp b/src/devices/machine/v3021.cpp index e64e7c81111..d452d541b7d 100644 --- a/src/devices/machine/v3021.cpp +++ b/src/devices/machine/v3021.cpp @@ -154,7 +154,7 @@ void v3021_device::device_start() { /* let's call the timer callback every second */ m_timer = timer_alloc(*this, FUNC(v3021_device::timer_callback)); - m_timer->adjust(attotime::from_hz(clock() / XTAL(32'768)), 0, attotime::from_hz(clock() / XTAL(32'768))); + m_timer->adjust_periodic(attotime::from_hz(clock() / XTAL(32'768))); copy_clock_to_ram(); diff --git a/src/devices/machine/wozfdc.cpp b/src/devices/machine/wozfdc.cpp index 1f06ad9d837..147f196f9d9 100644 --- a/src/devices/machine/wozfdc.cpp +++ b/src/devices/machine/wozfdc.cpp @@ -114,7 +114,7 @@ void wozfdc_device::device_reset() // Just a timer to be sure that the lss is updated from time to // time, so that there's no hiccup when it's talked to again. - timer->adjust(attotime::from_msec(10), 0, attotime::from_msec(10)); + timer->adjust_periodic(attotime::from_msec(10)); } void wozfdc_device::a3_update_drive_sel() diff --git a/src/devices/machine/ym2148.cpp b/src/devices/machine/ym2148.cpp index f1ea1b5dcd9..648fbbc9015 100644 --- a/src/devices/machine/ym2148.cpp +++ b/src/devices/machine/ym2148.cpp @@ -46,7 +46,7 @@ void ym2148_device::device_start() // Start a timer to trigger at clock / 8 / 16 const attotime rate = clocks_to_attotime(8 * 16); m_timer = timer_alloc(0); - m_timer->adjust(rate, 0, rate); + m_timer->adjust_periodic(rate); } diff --git a/src/devices/machine/ym3802.cpp b/src/devices/machine/ym3802.cpp index 73805331941..52770507ccd 100644 --- a/src/devices/machine/ym3802.cpp +++ b/src/devices/machine/ym3802.cpp @@ -162,7 +162,7 @@ void ym3802_device::reset_midi_timer() } if(rate != m_prev_rate) - m_midi_timer->adjust(attotime::from_hz(rate),0,attotime::from_hz(rate)); + m_midi_timer->adjust_periodic(attotime::from_hz(rate)); m_prev_rate = rate; logerror("MIDI Timer rate set to %iHz\n",rate); } @@ -263,12 +263,12 @@ void ym3802_device::write(offs_t offset, uint8_t data) const double rate = (m_reg[REG_CCR] & 0x02) ? m_clkm_rate / 4 : m_clkm_rate / 8; // start message to click counter - m_midi_counter_timer->adjust(attotime::from_hz(rate),0,attotime::from_hz(rate)); + m_midi_counter_timer->adjust_periodic(attotime::from_hz(rate)); } if((data & 0x07) == 3) { // stop message to click counter - m_midi_counter_timer->adjust(attotime::zero,0,attotime::never); + m_midi_counter_timer->adjust(attotime::zero); } } break; diff --git a/src/devices/machine/z80ctc.cpp b/src/devices/machine/z80ctc.cpp index 17ed606d085..295d484ad82 100644 --- a/src/devices/machine/z80ctc.cpp +++ b/src/devices/machine/z80ctc.cpp @@ -404,7 +404,7 @@ void z80ctc_channel_device::write(u8 data) if ((m_mode & MODE) == MODE_COUNTER || (m_mode & TRIGGER) == TRIGGER_AUTO) { attotime curperiod = period(); - m_timer->adjust(curperiod, 0, curperiod); + m_timer->adjust_periodic(curperiod); } // else set the bit indicating that we're waiting for the appropriate trigger @@ -513,7 +513,7 @@ TIMER_CALLBACK_MEMBER(z80ctc_channel_device::timer_callback) { attotime curperiod = period(); LOG("Period = %s\n", curperiod.as_string()); - m_timer->adjust(curperiod, 0, curperiod); + m_timer->adjust_periodic(curperiod); // we're no longer waiting m_mode &= ~WAITING_FOR_TRIG; diff --git a/src/devices/machine/z80scc.cpp b/src/devices/machine/z80scc.cpp index 24fa8e6399c..58c306dfef3 100644 --- a/src/devices/machine/z80scc.cpp +++ b/src/devices/machine/z80scc.cpp @@ -1199,7 +1199,7 @@ void z80scc_channel::device_timer(timer_instance const &timer) { // int rate = owner()->clock() / brconst; // attotime attorate = attotime::from_hz(rate); - // baudtimer->adjust(attorate, id, attorate); + // baudtimer->adjust_periodic(attorate, id); txc_w(m_brg_counter & 1); rxc_w(m_brg_counter & 1); m_brg_counter++; // Will just keep track of state in timer mode, not hardware counter value. @@ -1207,7 +1207,7 @@ void z80scc_channel::device_timer(timer_instance const &timer) else { LOG(" - turning off Baudrate timer\n"); - baudtimer->adjust(attotime::never, 0, attotime::never); + baudtimer->adjust(attotime::never); } } break; @@ -2287,7 +2287,7 @@ void z80scc_channel::do_sccreg_wr14(uint8_t data) if (data & WR14_BRG_SOURCE) // Do we use the PCLK as baudrate source { #if Z80SCC_USE_LOCAL_BRG - baudtimer->adjust(attotime::from_hz(rate), TIMER_ID_BAUD, attotime::from_hz(rate)); // Start the baudrate generator + baudtimer->adjust_periodic(attotime::from_hz(rate), TIMER_ID_BAUD); // Start the baudrate generator #if START_BIT_HUNT m_rcv_mode = RCV_SEEKING; #endif @@ -2297,7 +2297,7 @@ void z80scc_channel::do_sccreg_wr14(uint8_t data) else if ( (m_wr14 & WR14_BRG_ENABLE) && !(data & WR14_BRG_ENABLE) ) // baud rate generator being disabled? { #if Z80SCC_USE_LOCAL_BRG - baudtimer->adjust(attotime::never, TIMER_ID_BAUD, attotime::never); // Stop the baudrate generator + baudtimer->adjust(attotime::never, TIMER_ID_BAUD); // Stop the baudrate generator m_brg_counter = 0; #endif } diff --git a/src/devices/machine/z80sti.cpp b/src/devices/machine/z80sti.cpp index 98ab1a5a495..642657e0158 100644 --- a/src/devices/machine/z80sti.cpp +++ b/src/devices/machine/z80sti.cpp @@ -462,12 +462,12 @@ void z80sti_device::write(offs_t offset, uint8_t data) LOG("Z80STI Timer D Prescaler: %u\n", tdc); if (tcc) - m_timer[TIMER_C]->adjust(attotime::from_hz(clock() / tcc), TIMER_C, attotime::from_hz(clock() / tcc)); + m_timer[TIMER_C]->adjust_periodic(attotime::from_hz(clock() / tcc), TIMER_C); else m_timer[TIMER_C]->enable(false); if (tdc) - m_timer[TIMER_D]->adjust(attotime::from_hz(clock() / tdc), TIMER_D, attotime::from_hz(clock() / tdc)); + m_timer[TIMER_D]->adjust_periodic(attotime::from_hz(clock() / tdc), TIMER_D); else m_timer[TIMER_D]->enable(false); @@ -568,12 +568,12 @@ void z80sti_device::write(offs_t offset, uint8_t data) LOG("Z80STI Timer B Prescaler: %u\n", tbc); if (tac) - m_timer[TIMER_A]->adjust(attotime::from_hz(clock() / tac), TIMER_A, attotime::from_hz(clock() / tac)); + m_timer[TIMER_A]->adjust_periodic(attotime::from_hz(clock() / tac), TIMER_A); else m_timer[TIMER_A]->enable(false); if (tbc) - m_timer[TIMER_B]->adjust(attotime::from_hz(clock() / tbc), TIMER_B, attotime::from_hz(clock() / tbc)); + m_timer[TIMER_B]->adjust_periodic(attotime::from_hz(clock() / tbc), TIMER_B); else m_timer[TIMER_B]->enable(false); } diff --git a/src/devices/machine/z8536.cpp b/src/devices/machine/z8536.cpp index 0de327d5b80..316626aa9f2 100644 --- a/src/devices/machine/z8536.cpp +++ b/src/devices/machine/z8536.cpp @@ -827,7 +827,7 @@ void cio_base_device::device_start() // allocate timer m_timer = timer_alloc(); - m_timer->adjust(attotime::from_hz(clock() / 2), 0, attotime::from_hz(clock() / 2)); + m_timer->adjust_periodic(attotime::from_hz(clock() / 2)); // resolve callbacks m_write_irq.resolve_safe(); diff --git a/src/devices/sound/ad1848.cpp b/src/devices/sound/ad1848.cpp index a45c5f2043d..77008ca7797 100644 --- a/src/devices/sound/ad1848.cpp +++ b/src/devices/sound/ad1848.cpp @@ -101,7 +101,7 @@ void ad1848_device::write(offs_t offset, uint8_t data) // FIXME: provide external configuration for XTAL1 (24.576 MHz) and XTAL2 (16.9344 MHz) inputs attotime rate = m_play ? attotime::from_hz(((m_regs.dform & 1) ? 16.9344_MHz_XTAL : 24.576_MHz_XTAL) / div_factor[(m_regs.dform >> 1) & 7]) : attotime::never; - m_timer->adjust(rate, 0 , rate); + m_timer->adjust_periodic(rate); m_drq_cb(m_play ? ASSERT_LINE : CLEAR_LINE); break; } diff --git a/src/devices/sound/dave.cpp b/src/devices/sound/dave.cpp index df825a8f918..64f2000a8da 100644 --- a/src/devices/sound/dave.cpp +++ b/src/devices/sound/dave.cpp @@ -84,10 +84,10 @@ void dave_device::device_start() // allocate timers m_timer_1hz = timer_alloc(TIMER_1HZ); - m_timer_1hz->adjust(attotime::from_hz(2), 0, attotime::from_hz(2)); + m_timer_1hz->adjust_periodic(attotime::from_hz(2)); m_timer_50hz = timer_alloc(TIMER_50HZ); - m_timer_50hz->adjust(attotime::from_hz(2000), 0, attotime::from_hz(2000)); + m_timer_50hz->adjust_periodic(attotime::from_hz(2000)); // state saving save_item(NAME(m_segment)); @@ -480,14 +480,14 @@ void dave_device::io_w(offs_t offset, uint8_t data) case 0: { //logerror("1kHz\n"); - m_timer_50hz->adjust(attotime::from_hz(2000), 0, attotime::from_hz(2000)); + m_timer_50hz->adjust_periodic(attotime::from_hz(2000)); } break; case 1: { //logerror("50Hz\n"); - m_timer_50hz->adjust(attotime::from_hz(100), 0, attotime::from_hz(100)); + m_timer_50hz->adjust_periodic(attotime::from_hz(100)); } break; diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp index a318b30f7b9..cdfcb33bb1b 100644 --- a/src/devices/sound/es5503.cpp +++ b/src/devices/sound/es5503.cpp @@ -245,7 +245,7 @@ void es5503_device::device_clock_changed() m_mix_buffer.resize((output_rate/50)*8); attotime update_rate = output_rate ? attotime::from_hz(output_rate) : attotime::never; - m_timer->adjust(update_rate, 0, update_rate); + m_timer->adjust_periodic(update_rate); } void es5503_device::device_reset() diff --git a/src/devices/sound/gb.cpp b/src/devices/sound/gb.cpp index 58abcfecf15..b83140240d4 100644 --- a/src/devices/sound/gb.cpp +++ b/src/devices/sound/gb.cpp @@ -144,7 +144,7 @@ void gameboy_sound_device::device_start() { m_channel = stream_alloc(0, 2, SAMPLE_RATE_OUTPUT_ADAPTIVE); m_timer = timer_alloc(*this, FUNC(gameboy_sound_device::timer_callback)); - m_timer->adjust(clocks_to_attotime(FRAME_CYCLES/128), 0, clocks_to_attotime(FRAME_CYCLES/128)); + m_timer->adjust_periodic(clocks_to_attotime(FRAME_CYCLES/128)); save_item(NAME(m_last_updated)); save_item(NAME(m_snd_regs)); @@ -175,7 +175,7 @@ void gameboy_sound_device::device_start() void gameboy_sound_device::device_clock_changed() { - m_timer->adjust(clocks_to_attotime(FRAME_CYCLES / 128), 0, clocks_to_attotime(FRAME_CYCLES / 128)); + m_timer->adjust_periodic(clocks_to_attotime(FRAME_CYCLES / 128)); } diff --git a/src/devices/sound/huc6230.cpp b/src/devices/sound/huc6230.cpp index dda44676615..f1c47fc89c0 100644 --- a/src/devices/sound/huc6230.cpp +++ b/src/devices/sound/huc6230.cpp @@ -206,5 +206,5 @@ void huc6230_device::device_clock_changed() { m_stream->set_sample_rate(clock() / 6); attotime adpcm_period = clocks_to_attotime(682); - m_adpcm_timer->adjust(adpcm_period, 0, adpcm_period); + m_adpcm_timer->adjust_periodic(adpcm_period); } diff --git a/src/devices/sound/ics2115.cpp b/src/devices/sound/ics2115.cpp index 16377429d11..66957f42fca 100644 --- a/src/devices/sound/ics2115.cpp +++ b/src/devices/sound/ics2115.cpp @@ -434,7 +434,7 @@ int ics2115_device::fill_output(ics2115_voice& voice, std::vector<write_stream_v { constexpr int RAMP_SHIFT = 6; const u32 volacc = (voice.vol.acc >> 14) & 0xfff; - const u16 vlefti = volacc - m_panlaw[255 - voice.vol.pan]; // left index from acc - pan law + const u16 vlefti = volacc - m_panlaw[255 - voice.vol.pan]; // left index from acc - pan law const u16 vrighti = volacc - m_panlaw[voice.vol.pan]; // right index from acc - pan law //check negative values so no cracks, is it a hardware feature ? const u16 vleft = vlefti > 0 ? (m_volume[vlefti] * voice.state.ramp >> RAMP_SHIFT) : 0; @@ -1112,7 +1112,7 @@ void ics2115_device::recalc_timer(int timer) m_timer[timer].period = period; // Adjust the timer lengths if (period) // Reset the length - m_timer[timer].timer->adjust(attotime::from_nsec(period), 0, attotime::from_nsec(period)); + m_timer[timer].timer->adjust_periodic(attotime::from_nsec(period)); else // Kill the timer if length == 0 m_timer[timer].timer->adjust(attotime::never); } diff --git a/src/devices/sound/k053260.cpp b/src/devices/sound/k053260.cpp index 00f8640aed2..0733ed96a07 100644 --- a/src/devices/sound/k053260.cpp +++ b/src/devices/sound/k053260.cpp @@ -137,7 +137,7 @@ void k053260_device::device_start() void k053260_device::device_clock_changed() { m_stream->set_sample_rate(clock() / CLOCKS_PER_SAMPLE); - m_timer->adjust(attotime::from_ticks(16, clock()), 0, attotime::from_ticks(16, clock())); + m_timer->adjust_periodic(attotime::from_ticks(16, clock())); } @@ -147,7 +147,7 @@ void k053260_device::device_clock_changed() void k053260_device::device_reset() { - m_timer->adjust(attotime::from_ticks(16, clock()), 0, attotime::from_ticks(16, clock())); + m_timer->adjust_periodic(attotime::from_ticks(16, clock())); for (auto & elem : m_voice) elem.voice_reset(); diff --git a/src/devices/sound/k054539.cpp b/src/devices/sound/k054539.cpp index 3ea1829b935..dba1b7dbeb2 100644 --- a/src/devices/sound/k054539.cpp +++ b/src/devices/sound/k054539.cpp @@ -426,7 +426,7 @@ void k054539_device::write(offs_t offset, u8 data) { attotime period = attotime::from_hz((float)(38 + data) * (clock()/384.0f/14400.0f)) / 2; - m_timer->adjust(period, 0, period); + m_timer->adjust_periodic(period); m_timer_state = 0; m_timer_handler(m_timer_state); diff --git a/src/devices/sound/ks0164.cpp b/src/devices/sound/ks0164.cpp index 540a2c75099..0a2b88517e2 100644 --- a/src/devices/sound/ks0164.cpp +++ b/src/devices/sound/ks0164.cpp @@ -95,7 +95,7 @@ void ks0164_device::device_reset() m_midi_in = 0x00; m_midi_in_active = false; - m_timer->adjust(attotime::from_msec(1), 0, attotime::from_msec(1)); + m_timer->adjust_periodic(attotime::from_msec(1)); } void ks0164_device::device_timer(timer_instance const &timer) diff --git a/src/devices/sound/msm5205.cpp b/src/devices/sound/msm5205.cpp index f19bce790d6..56b27eb1b1e 100644 --- a/src/devices/sound/msm5205.cpp +++ b/src/devices/sound/msm5205.cpp @@ -346,7 +346,7 @@ void msm5205_device::device_clock_changed() logerror("/%d prescaler selected\n", prescaler); attotime half_period = clocks_to_attotime(prescaler / 2); - m_vck_timer->adjust(half_period, 0, half_period); + m_vck_timer->adjust_periodic(half_period); } else { diff --git a/src/devices/sound/tms5110.cpp b/src/devices/sound/tms5110.cpp index 7f21a791667..bdda5c6d9f8 100644 --- a/src/devices/sound/tms5110.cpp +++ b/src/devices/sound/tms5110.cpp @@ -1207,7 +1207,7 @@ int tms5110_device::romclk_hack_r() if (!m_romclk_hack_timer_started) { m_romclk_hack_timer_started = true; - m_romclk_hack_timer->adjust(attotime::from_hz(clock() / 40), 0, attotime::from_hz(clock() / 40)); + m_romclk_hack_timer->adjust_periodic(attotime::from_hz(clock() / 40)); } return m_romclk_hack_state; } diff --git a/src/devices/video/ef9345.cpp b/src/devices/video/ef9345.cpp index 7ca90ce7685..7e9ba89a257 100644 --- a/src/devices/video/ef9345.cpp +++ b/src/devices/video/ef9345.cpp @@ -139,7 +139,7 @@ void ef9345_device::device_start() m_screen_out.allocate(496, screen().height()); - m_blink_timer->adjust(attotime::from_msec(500), 0, attotime::from_msec(500)); + m_blink_timer->adjust_periodic(attotime::from_msec(500)); init_accented_chars(); diff --git a/src/devices/video/hd44352.cpp b/src/devices/video/hd44352.cpp index 471e2251e9b..db5e68565e2 100644 --- a/src/devices/video/hd44352.cpp +++ b/src/devices/video/hd44352.cpp @@ -58,7 +58,7 @@ void hd44352_device::device_start() m_on_cb.resolve_safe(); m_on_timer = timer_alloc(ON_TIMER); - m_on_timer->adjust(attotime::from_hz(m_clock/16384), 0, attotime::from_hz(m_clock/16384)); + m_on_timer->adjust_periodic(attotime::from_hz(m_clock/16384)); save_item( NAME(m_control_lines)); save_item( NAME(m_data_bus)); @@ -334,7 +334,7 @@ void hd44352_device::data_write(uint8_t data) default: on_timer_rate = 8192; break; } - m_on_timer->adjust(attotime::from_hz(m_clock/on_timer_rate), 0, attotime::from_hz(m_clock/on_timer_rate)); + m_on_timer->adjust_periodic(attotime::from_hz(m_clock/on_timer_rate)); } m_data_bus = 0xff; m_state = 0; diff --git a/src/devices/video/hd44780.cpp b/src/devices/video/hd44780.cpp index 6b00a9a7328..1ca59c57ecd 100644 --- a/src/devices/video/hd44780.cpp +++ b/src/devices/video/hd44780.cpp @@ -115,7 +115,7 @@ void hd44780_device::device_start() m_busy_timer = timer_alloc(TIMER_BUSY); m_blink_timer = timer_alloc(TIMER_BLINKING); - m_blink_timer->adjust(attotime::from_msec(409), 0, attotime::from_msec(409)); + m_blink_timer->adjust_periodic(attotime::from_msec(409)); // state saving save_item(NAME(m_busy_factor)); diff --git a/src/devices/video/hlcd0438.cpp b/src/devices/video/hlcd0438.cpp index 42317ddb087..808d2b8d1f2 100644 --- a/src/devices/video/hlcd0438.cpp +++ b/src/devices/video/hlcd0438.cpp @@ -38,7 +38,7 @@ void hlcd0438_device::device_start() // timer (when LCD pin is oscillator) m_lcd_timer = timer_alloc(); attotime period = (clock() != 0) ? attotime::from_hz(2 * clock()) : attotime::never; - m_lcd_timer->adjust(period, 0, period); + m_lcd_timer->adjust_periodic(period); // register for savestates save_item(NAME(m_data_in)); diff --git a/src/devices/video/hlcd0515.cpp b/src/devices/video/hlcd0515.cpp index 541cd1f1006..e1edf66f54e 100644 --- a/src/devices/video/hlcd0515.cpp +++ b/src/devices/video/hlcd0515.cpp @@ -65,7 +65,7 @@ void hlcd0515_device::device_start() // timer m_lcd_timer = timer_alloc(); attotime period = attotime::from_hz(clock() / 2); - m_lcd_timer->adjust(period, 0, period); + m_lcd_timer->adjust_periodic(period); // zerofill m_cs = 0; diff --git a/src/devices/video/hlcd0538.cpp b/src/devices/video/hlcd0538.cpp index a5f731313e9..a3ba23081af 100644 --- a/src/devices/video/hlcd0538.cpp +++ b/src/devices/video/hlcd0538.cpp @@ -53,7 +53,7 @@ void hlcd0538_device::device_start() // timer (when LCD pin is oscillator) m_lcd_timer = timer_alloc(); attotime period = (clock() != 0) ? attotime::from_hz(2 * clock()) : attotime::never; - m_lcd_timer->adjust(period, 0, period); + m_lcd_timer->adjust_periodic(period); // register for savestates save_item(NAME(m_lcd)); diff --git a/src/devices/video/pcf2100.cpp b/src/devices/video/pcf2100.cpp index 902c95ab1cf..0648498d928 100644 --- a/src/devices/video/pcf2100.cpp +++ b/src/devices/video/pcf2100.cpp @@ -61,7 +61,7 @@ void pcf2100_device::device_start() // timer m_lcd_timer = timer_alloc(); attotime period = attotime::from_hz(clock()); - m_lcd_timer->adjust(period, 0, period); + m_lcd_timer->adjust_periodic(period); // register for savestates save_item(NAME(m_shift)); diff --git a/src/devices/video/sed1500.cpp b/src/devices/video/sed1500.cpp index 6da9769898e..3cfd799f9b2 100644 --- a/src/devices/video/sed1500.cpp +++ b/src/devices/video/sed1500.cpp @@ -71,7 +71,7 @@ void sed1500_device::device_start() // timer m_lcd_timer = timer_alloc(); attotime period = attotime::from_hz(clock() / 64); - m_lcd_timer->adjust(period, 0, period); + m_lcd_timer->adjust_periodic(period); // register for savestates save_item(NAME(m_mode)); diff --git a/src/devices/video/v9938.cpp b/src/devices/video/v9938.cpp index e2e952c524b..fa1cdbdb035 100644 --- a/src/devices/video/v9938.cpp +++ b/src/devices/video/v9938.cpp @@ -708,7 +708,7 @@ void v99x8_device::device_reset() m_stat_reg[6] = 0xfc; // Start the timer - m_line_timer->adjust(attotime::from_ticks(HTOTAL*2, m_clock), 0, attotime::from_ticks(HTOTAL*2, m_clock)); + m_line_timer->adjust_periodic(attotime::from_ticks(HTOTAL*2, m_clock)); configure_pal_ntsc(); set_screen_parameters(); |
