diff options
author | Aaron Giles <aaron@aarongiles.com> | 2021-03-25 01:51:36 -0700 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2021-03-25 01:51:36 -0700 |
commit | 3887c4143155b46d3d0d780e438f25dd4507839d (patch) | |
tree | 7026769b218e3950cccf2e160042070fe74bb6c4 | |
parent | 71e97e887f03788e9dfb07ace3ea5288f6aec3c4 (diff) |
Use the device-provided timer_alloc instead of reaching around to the scheduler. Also change machine().scheduler().time() calls to just machine().time().
403 files changed, 775 insertions, 779 deletions
diff --git a/src/devices/bus/a2bus/a2parprn.cpp b/src/devices/bus/a2bus/a2parprn.cpp index c1ec975d1fb..b687f126f35 100644 --- a/src/devices/bus/a2bus/a2parprn.cpp +++ b/src/devices/bus/a2bus/a2parprn.cpp @@ -179,7 +179,7 @@ ioport_constructor a2bus_parprn_device::device_input_ports() const void a2bus_parprn_device::device_start() { - m_strobe_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2bus_parprn_device::update_strobe), this)); + m_strobe_timer = timer_alloc(*this, FUNC(a2bus_parprn_device::update_strobe)); save_item(NAME(m_next_strobe)); save_item(NAME(m_ack_latch)); diff --git a/src/devices/bus/a2bus/a2pic.cpp b/src/devices/bus/a2bus/a2pic.cpp index 4912cf53c0d..a7b909c1bd2 100644 --- a/src/devices/bus/a2bus/a2pic.cpp +++ b/src/devices/bus/a2bus/a2pic.cpp @@ -280,7 +280,7 @@ ioport_constructor a2bus_pic_device::device_input_ports() const void a2bus_pic_device::device_start() { - m_strobe_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2bus_pic_device::release_strobe), this)); + m_strobe_timer = timer_alloc(*this, FUNC(a2bus_pic_device::release_strobe)); m_firmware_base = 0x0100U; m_data_latch = 0xffU; diff --git a/src/devices/bus/a2bus/grapplerplus.cpp b/src/devices/bus/a2bus/grapplerplus.cpp index 480cfa1c8f9..e46871be71a 100644 --- a/src/devices/bus/a2bus/grapplerplus.cpp +++ b/src/devices/bus/a2bus/grapplerplus.cpp @@ -239,7 +239,7 @@ ioport_constructor a2bus_grapplerplus_device::device_input_ports() const void a2bus_grapplerplus_device::device_start() { - m_strobe_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2bus_grapplerplus_device::update_strobe), this)); + m_strobe_timer = timer_alloc(*this, FUNC(a2bus_grapplerplus_device::update_strobe)); m_next_strobe = 1U; diff --git a/src/devices/bus/a2bus/uniprint.cpp b/src/devices/bus/a2bus/uniprint.cpp index f98e2a44a45..54e154b2bd3 100644 --- a/src/devices/bus/a2bus/uniprint.cpp +++ b/src/devices/bus/a2bus/uniprint.cpp @@ -160,7 +160,7 @@ ioport_constructor a2bus_uniprint_device::device_input_ports() const void a2bus_uniprint_device::device_start() { - m_strobe_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2bus_uniprint_device::update_strobe), this)); + m_strobe_timer = timer_alloc(*this, FUNC(a2bus_uniprint_device::update_strobe)); m_next_strobe = 1U; diff --git a/src/devices/bus/amiga/keyboard/mitsumi.cpp b/src/devices/bus/amiga/keyboard/mitsumi.cpp index 038d8bb72d7..1e0218ab5e0 100644 --- a/src/devices/bus/amiga/keyboard/mitsumi.cpp +++ b/src/devices/bus/amiga/keyboard/mitsumi.cpp @@ -209,8 +209,8 @@ protected: { mitsumi_keyboard_base::device_start(); - m_wd_timeout = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mitsumi_watchdog_keyboard_base::wd_timeout), this)); - m_wd_pulse = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mitsumi_watchdog_keyboard_base::wd_pulse), this)); + m_wd_timeout = timer_alloc(*this, FUNC(mitsumi_watchdog_keyboard_base::wd_timeout)); + m_wd_pulse = timer_alloc(*this, FUNC(mitsumi_watchdog_keyboard_base::wd_pulse)); m_pd7 = 0x01U; @@ -284,7 +284,7 @@ protected: { mitsumi_watchdog_keyboard_base::device_start(); - m_reset_pulse = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a500_keyboard_base::reset_pulse), this)); + m_reset_pulse = timer_alloc(*this, FUNC(a500_keyboard_base::reset_pulse)); m_reset_active = 0U; @@ -344,7 +344,7 @@ protected: { mitsumi_keyboard_base::device_start(); - m_reset_pulse = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a600_keyboard_base::reset_pulse), this)); + m_reset_pulse = timer_alloc(*this, FUNC(a600_keyboard_base::reset_pulse)); m_reset_trigger = 0U; m_reset_active = 0U; diff --git a/src/devices/bus/bbc/userport/pointer.cpp b/src/devices/bus/bbc/userport/pointer.cpp index d8272766d98..445f526a548 100644 --- a/src/devices/bus/bbc/userport/pointer.cpp +++ b/src/devices/bus/bbc/userport/pointer.cpp @@ -151,7 +151,7 @@ bbc_tracker_device::bbc_tracker_device(const machine_config &mconfig, const char void bbc_pointer_device::device_start() { - m_pointer_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bbc_pointer_device::pointer_poll), this)); + m_pointer_timer = timer_alloc(*this, FUNC(bbc_pointer_device::pointer_poll)); m_pointer_timer->adjust(attotime::zero, 0, attotime::from_hz(1400)); } diff --git a/src/devices/bus/ieee488/hp9122c.cpp b/src/devices/bus/ieee488/hp9122c.cpp index 0c6788c213d..27d0dc8ae10 100644 --- a/src/devices/bus/ieee488/hp9122c.cpp +++ b/src/devices/bus/ieee488/hp9122c.cpp @@ -91,7 +91,7 @@ void hp9122c_device::device_start() save_item(NAME(m_ds0)); save_item(NAME(m_ds1)); - m_motor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp9122c_device::motor_timeout), this)); + m_motor_timer = timer_alloc(*this, FUNC(hp9122c_device::motor_timeout)); } TIMER_CALLBACK_MEMBER(hp9122c_device::motor_timeout) diff --git a/src/devices/bus/intellec4/tapereader.cpp b/src/devices/bus/intellec4/tapereader.cpp index 1f32815fbd5..a1e4458d4f8 100644 --- a/src/devices/bus/intellec4/tapereader.cpp +++ b/src/devices/bus/intellec4/tapereader.cpp @@ -43,7 +43,7 @@ void imm4_90_device::call_unload() void imm4_90_device::device_start() { - m_step_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(imm4_90_device::step), this)); + m_step_timer = timer_alloc(*this, FUNC(imm4_90_device::step)); save_item(NAME(m_data)); save_item(NAME(m_ready)); diff --git a/src/devices/bus/interpro/sr/gt.cpp b/src/devices/bus/interpro/sr/gt.cpp index 4005aca569f..7c94404d9ab 100644 --- a/src/devices/bus/interpro/sr/gt.cpp +++ b/src/devices/bus/interpro/sr/gt.cpp @@ -616,9 +616,9 @@ void gt_device_base::device_start() save_item(NAME(m_control)); // allocate timers - m_blit_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt_device_base::blit), this)); - m_line_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt_device_base::line), this)); - m_done_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt_device_base::done), this)); + m_blit_timer = timer_alloc(*this, FUNC(gt_device_base::blit)); + m_line_timer = timer_alloc(*this, FUNC(gt_device_base::line)); + m_done_timer = timer_alloc(*this, FUNC(gt_device_base::done)); } void gt_device_base::control_w(offs_t offset, u32 data, u32 mem_mask) diff --git a/src/devices/bus/isa/mc1502_fdc.cpp b/src/devices/bus/isa/mc1502_fdc.cpp index 85c8eda25aa..a9229afa065 100644 --- a/src/devices/bus/isa/mc1502_fdc.cpp +++ b/src/devices/bus/isa/mc1502_fdc.cpp @@ -217,7 +217,7 @@ void mc1502_fdc_device::device_start() m_isa->install_device(0x0048, 0x004b, read8sm_delegate(*m_fdc, FUNC(fd1793_device::read)), write8sm_delegate(*m_fdc, FUNC(fd1793_device::write))); m_isa->install_device(0x004c, 0x004f, read8sm_delegate(*this, FUNC(mc1502_fdc_device::mc1502_fdcv2_r)), write8sm_delegate(*this, FUNC(mc1502_fdc_device::mc1502_fdc_w))); - motor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc1502_fdc_device::motor_callback),this)); + motor_timer = timer_alloc(*this, FUNC(mc1502_fdc_device::motor_callback)); motor_on = 0; m_control = 0; } diff --git a/src/devices/bus/isa/s3virge.cpp b/src/devices/bus/isa/s3virge.cpp index e660f6cc388..700a737d847 100644 --- a/src/devices/bus/isa/s3virge.cpp +++ b/src/devices/bus/isa/s3virge.cpp @@ -83,7 +83,7 @@ void s3virge_vga_device::device_start() save_item(vga.sequencer.data,"Sequencer Registers"); save_item(vga.attribute.data,"Attribute Registers"); - m_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vga_device::vblank_timer_cb),this)); + m_vblank_timer = timer_alloc(*this, FUNC(vga_device::vblank_timer_cb)); m_draw_timer = timer_alloc(TIMER_DRAW_STEP); memset(&s3, 0, sizeof(s3)); diff --git a/src/devices/bus/isa/trident.cpp b/src/devices/bus/isa/trident.cpp index 5fc2d2d6d19..e6fad769cf6 100644 --- a/src/devices/bus/isa/trident.cpp +++ b/src/devices/bus/isa/trident.cpp @@ -181,7 +181,7 @@ void trident_vga_device::device_start() save_pointer(tri.accel_pattern,"Pattern Data", 0x80); save_pointer(tri.lutdac_reg,"LUTDAC registers", 0x100); - m_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vga_device::vblank_timer_cb),this)); + m_vblank_timer = timer_alloc(*this, FUNC(vga_device::vblank_timer_cb)); vga.svga_intf.seq_regcount = 0x0f; vga.svga_intf.crtc_regcount = 0x60; memset(&tri, 0, sizeof(tri)); diff --git a/src/devices/bus/mackbd/keyboard.cpp b/src/devices/bus/mackbd/keyboard.cpp index 5857a807985..70608dcc76d 100644 --- a/src/devices/bus/mackbd/keyboard.cpp +++ b/src/devices/bus/mackbd/keyboard.cpp @@ -278,8 +278,8 @@ protected: virtual void device_start() override { - m_watchdog_timeout = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(peripheral_base::watchdog_timeout), this)); - m_watchdog_output = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(peripheral_base::watchdog_output), this)); + m_watchdog_timeout = timer_alloc(*this, FUNC(peripheral_base::watchdog_timeout)); + m_watchdog_output = timer_alloc(*this, FUNC(peripheral_base::watchdog_output)); m_row_drive = make_bitmask<u16>(Rows); m_host_clock_out = 1U; diff --git a/src/devices/bus/nasbus/floppy.cpp b/src/devices/bus/nasbus/floppy.cpp index 3ada48aa19a..815ba725be8 100644 --- a/src/devices/bus/nasbus/floppy.cpp +++ b/src/devices/bus/nasbus/floppy.cpp @@ -80,7 +80,7 @@ nascom_fdc_device::nascom_fdc_device(const machine_config &mconfig, const char * void nascom_fdc_device::device_start() { // timer to turn off the drive motor line - m_motor = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nascom_fdc_device::motor_off), this)); + m_motor = timer_alloc(*this, FUNC(nascom_fdc_device::motor_off)); save_item(NAME(m_select)); } diff --git a/src/devices/bus/pc_kbd/hle_mouse.cpp b/src/devices/bus/pc_kbd/hle_mouse.cpp index 9cb96f94983..1521560d913 100644 --- a/src/devices/bus/pc_kbd/hle_mouse.cpp +++ b/src/devices/bus/pc_kbd/hle_mouse.cpp @@ -104,8 +104,8 @@ void hle_ps2_mouse_device::device_start() set_pc_kbdc_device(); - m_serial = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hle_ps2_mouse_device::serial), this)); - m_sample = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hle_ps2_mouse_device::sample), this)); + m_serial = timer_alloc(*this, FUNC(hle_ps2_mouse_device::serial)); + m_sample = timer_alloc(*this, FUNC(hle_ps2_mouse_device::sample)); } void hle_ps2_mouse_device::device_reset() diff --git a/src/devices/bus/psx/ctlrport.cpp b/src/devices/bus/psx/ctlrport.cpp index c043ac1bab0..72bca6dfff6 100644 --- a/src/devices/bus/psx/ctlrport.cpp +++ b/src/devices/bus/psx/ctlrport.cpp @@ -112,7 +112,7 @@ void device_psx_controller_interface::interface_pre_start() { m_owner = dynamic_cast<psx_controller_port_device *>(device().owner()); if (!m_ack_timer) - m_ack_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_psx_controller_interface::ack_timer), this)); + m_ack_timer = device().timer_alloc(*this, FUNC(device_psx_controller_interface::ack_timer)); } void device_psx_controller_interface::interface_pre_reset() diff --git a/src/devices/bus/psx/memcard.cpp b/src/devices/bus/psx/memcard.cpp index 7f53c69dcfa..2ea2ff81dde 100644 --- a/src/devices/bus/psx/memcard.cpp +++ b/src/devices/bus/psx/memcard.cpp @@ -67,7 +67,7 @@ psxcard_device::psxcard_device(const machine_config &mconfig, const char *tag, d void psxcard_device::device_start() { m_owner = dynamic_cast<psx_controller_port_device *>(owner()); - m_ack_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(psxcard_device::ack_timer), this)); + m_ack_timer = timer_alloc(*this, FUNC(psxcard_device::ack_timer)); m_ack = true; m_disabled = false; diff --git a/src/devices/bus/s100/ascsasi.cpp b/src/devices/bus/s100/ascsasi.cpp index ef8b2d329e3..660914827a4 100644 --- a/src/devices/bus/s100/ascsasi.cpp +++ b/src/devices/bus/s100/ascsasi.cpp @@ -89,8 +89,8 @@ asc_sasi_device::asc_sasi_device(const machine_config &mconfig, const char *tag, void asc_sasi_device::device_start() { // initialize timers - m_sel_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(asc_sasi_device::sel_off), this)); - m_rst_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(asc_sasi_device::rst_off), this)); + m_sel_off_timer = timer_alloc(*this, FUNC(asc_sasi_device::sel_off)); + m_rst_off_timer = timer_alloc(*this, FUNC(asc_sasi_device::rst_off)); // save state save_item(NAME(m_data_latch)); diff --git a/src/devices/bus/spc1000/fdd.cpp b/src/devices/bus/spc1000/fdd.cpp index 36c4c90b958..c544392f4fb 100644 --- a/src/devices/bus/spc1000/fdd.cpp +++ b/src/devices/bus/spc1000/fdd.cpp @@ -156,7 +156,7 @@ spc1000_fdd_exp_device::spc1000_fdd_exp_device(const machine_config &mconfig, co void spc1000_fdd_exp_device::device_start() { - m_timer_tc = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(spc1000_fdd_exp_device::tc_off), this)); + m_timer_tc = timer_alloc(*this, FUNC(spc1000_fdd_exp_device::tc_off)); } //------------------------------------------------- diff --git a/src/devices/bus/ss50/dc5.cpp b/src/devices/bus/ss50/dc5.cpp index 764b6ada245..b83aedebb60 100644 --- a/src/devices/bus/ss50/dc5.cpp +++ b/src/devices/bus/ss50/dc5.cpp @@ -292,7 +292,7 @@ void ss50_dc5_device::device_start() m_fdc_status = 0; m_control_register = 0; m_fdc_side = 0; - m_floppy_motor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ss50_dc5_device::floppy_motor_callback),this)); + m_floppy_motor_timer = timer_alloc(*this, FUNC(ss50_dc5_device::floppy_motor_callback)); m_motor_timer_out = 0; m_fdc->set_force_ready(0); m_fdc_prog_clock_div = 12; diff --git a/src/devices/bus/ss50/mpt.cpp b/src/devices/bus/ss50/mpt.cpp index 4664f72a047..c102beb4b09 100644 --- a/src/devices/bus/ss50/mpt.cpp +++ b/src/devices/bus/ss50/mpt.cpp @@ -90,7 +90,7 @@ void ss50_mpt_device::device_add_mconfig(machine_config &config) void ss50_mpt_device::device_start() { - m_mpt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ss50_mpt_device::mpt_timer_callback),this)); + m_mpt_timer = timer_alloc(*this, FUNC(ss50_mpt_device::mpt_timer_callback)); m_mpt_timer_state = 0; save_item(NAME(m_mpt_timer_state)); diff --git a/src/devices/bus/ti8x/ti8x.cpp b/src/devices/bus/ti8x/ti8x.cpp index f8ec86c06a8..88079b206cf 100644 --- a/src/devices/bus/ti8x/ti8x.cpp +++ b/src/devices/bus/ti8x/ti8x.cpp @@ -121,7 +121,7 @@ void device_ti8x_link_port_bit_interface::interface_pre_start() device_ti8x_link_port_interface::interface_pre_start(); if (!m_error_timer) - m_error_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_ti8x_link_port_bit_interface::bit_timeout), this)); + m_error_timer = device().timer_alloc(*this, FUNC(device_ti8x_link_port_bit_interface::bit_timeout)); m_bit_phase = IDLE; m_tx_bit_buffer = EMPTY; diff --git a/src/devices/bus/vcs/dpc.h b/src/devices/bus/vcs/dpc.h index 0f5971cf419..b3f3a199d52 100644 --- a/src/devices/bus/vcs/dpc.h +++ b/src/devices/bus/vcs/dpc.h @@ -13,7 +13,7 @@ // TO DO: DPC should be made a separate device! -// m_dpc.oscillator = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2600_state::modeDPC_timer_callback),this)); +// m_dpc.oscillator = timer_alloc(*this, FUNC(a2600_state::modeDPC_timer_callback)); class dpc_device : public device_t { diff --git a/src/devices/bus/vsmile/pad.cpp b/src/devices/bus/vsmile/pad.cpp index 5cf7940ab39..9e64dc1f155 100644 --- a/src/devices/bus/vsmile/pad.cpp +++ b/src/devices/bus/vsmile/pad.cpp @@ -49,8 +49,7 @@ void vsmile_pad_device::device_start() { vsmile_ctrl_device_base::device_start(); - m_idle_timer = machine().scheduler().timer_alloc( - timer_expired_delegate(FUNC(vsmile_pad_device::handle_idle), this)); + m_idle_timer = timer_alloc(*this, FUNC(vsmile_pad_device::handle_idle)); m_idle_timer->adjust(attotime::from_seconds(1)); m_sent_joy = 0x0000U; diff --git a/src/devices/bus/vsmile/vsmile_ctrl.cpp b/src/devices/bus/vsmile/vsmile_ctrl.cpp index db29bd82a9b..0348a0e05b4 100644 --- a/src/devices/bus/vsmile/vsmile_ctrl.cpp +++ b/src/devices/bus/vsmile/vsmile_ctrl.cpp @@ -115,12 +115,10 @@ vsmile_ctrl_device_base::~vsmile_ctrl_device_base() void vsmile_ctrl_device_base::device_start() { // allocate a timer to limit transmit rate to something realistic - m_tx_timer = machine().scheduler().timer_alloc( - timer_expired_delegate(FUNC(vsmile_ctrl_device_base::tx_timer_expired), this)); + m_tx_timer = timer_alloc(*this, FUNC(vsmile_ctrl_device_base::tx_timer_expired)); // allocate a timer for RTS timeouts - m_rts_timer = machine().scheduler().timer_alloc( - timer_expired_delegate(FUNC(vsmile_ctrl_device_base::rts_timer_expired), this)); + m_rts_timer = timer_alloc(*this, FUNC(vsmile_ctrl_device_base::rts_timer_expired)); // start with transmit queue empty m_tx_fifo_head = m_tx_fifo_tail = 0U; diff --git a/src/devices/cpu/alto2/a2disk.cpp b/src/devices/cpu/alto2/a2disk.cpp index fa9392695dc..faab8ee5558 100644 --- a/src/devices/cpu/alto2/a2disk.cpp +++ b/src/devices/cpu/alto2/a2disk.cpp @@ -1749,16 +1749,16 @@ void alto2_cpu_device::init_disk() m_dsk.kcom = 066000; - m_dsk.strobon_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::disk_strobon),this)); + m_dsk.strobon_timer = timer_alloc(*this, FUNC(alto2_cpu_device::disk_strobon)); m_dsk.strobon_timer->reset(); - m_dsk.seclate_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::disk_seclate),this)); + m_dsk.seclate_timer = timer_alloc(*this, FUNC(alto2_cpu_device::disk_seclate)); m_dsk.seclate_timer->reset(); - m_dsk.ok_to_run_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::disk_ok_to_run),this)); + m_dsk.ok_to_run_timer = timer_alloc(*this, FUNC(alto2_cpu_device::disk_ok_to_run)); m_dsk.ok_to_run_timer->adjust(attotime::from_nsec(35 * ALTO2_UCYCLE / 1000), 1); - m_dsk.ready_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::disk_ready_mf31a),this)); + m_dsk.ready_timer = timer_alloc(*this, FUNC(alto2_cpu_device::disk_ready_mf31a)); m_dsk.ready_timer->reset(); m_dsk.bitclk_time[0] = static_cast<int>(attotime::from_nsec(300).as_attoseconds() / 1000000); diff --git a/src/devices/cpu/alto2/a2ether.cpp b/src/devices/cpu/alto2/a2ether.cpp index 2c1a3d56a89..bc9da2db27a 100644 --- a/src/devices/cpu/alto2/a2ether.cpp +++ b/src/devices/cpu/alto2/a2ether.cpp @@ -1325,10 +1325,10 @@ void alto2_cpu_device::init_ether(int task) m_eth.rx_packet = std::make_unique<uint16_t[]>(sizeof(uint16_t)*ALTO2_ETHER_PACKET_SIZE); m_eth.tx_packet = std::make_unique<uint16_t[]>(sizeof(uint16_t)*ALTO2_ETHER_PACKET_SIZE); - m_eth.tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::tx_packet),this)); + m_eth.tx_timer = timer_alloc(*this, FUNC(alto2_cpu_device::tx_packet)); m_eth.tx_timer->reset(); - m_eth.rx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::rx_breath_of_life),this)); + m_eth.rx_timer = timer_alloc(*this, FUNC(alto2_cpu_device::rx_breath_of_life)); m_eth.rx_timer->reset(); } diff --git a/src/devices/cpu/amis2000/amis2000.cpp b/src/devices/cpu/amis2000/amis2000.cpp index 0558f5117db..50f3653d78a 100644 --- a/src/devices/cpu/amis2000/amis2000.cpp +++ b/src/devices/cpu/amis2000/amis2000.cpp @@ -194,7 +194,7 @@ void amis2152_cpu_device::device_start() { amis2000_base_device::device_start(); - m_d2f_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(amis2152_cpu_device::d2f_timer_cb), this)); + m_d2f_timer = timer_alloc(*this, FUNC(amis2152_cpu_device::d2f_timer_cb)); // zerofill m_d2f_latch = 0; diff --git a/src/devices/cpu/e0c6200/e0c6s46.cpp b/src/devices/cpu/e0c6200/e0c6s46.cpp index 7c5b1196fb0..877cfb9612b 100644 --- a/src/devices/cpu/e0c6200/e0c6s46.cpp +++ b/src/devices/cpu/e0c6200/e0c6s46.cpp @@ -83,11 +83,11 @@ void e0c6s46_device::device_start() m_pixel_update_cb.resolve(); // create timers - m_core_256_handle = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(e0c6s46_device::core_256_cb), this)); + m_core_256_handle = timer_alloc(*this, FUNC(e0c6s46_device::core_256_cb)); m_core_256_handle->adjust(attotime::from_ticks(64, unscaled_clock())); - m_prgtimer_handle = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(e0c6s46_device::prgtimer_cb), this)); + m_prgtimer_handle = timer_alloc(*this, FUNC(e0c6s46_device::prgtimer_cb)); m_prgtimer_handle->adjust(attotime::never); - m_buzzer_handle = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(e0c6s46_device::buzzer_cb), this)); + m_buzzer_handle = timer_alloc(*this, FUNC(e0c6s46_device::buzzer_cb)); m_buzzer_handle->adjust(attotime::never); // zerofill diff --git a/src/devices/cpu/e132xs/e132xs.cpp b/src/devices/cpu/e132xs/e132xs.cpp index c328c0a35d7..1d8f4092021 100644 --- a/src/devices/cpu/e132xs/e132xs.cpp +++ b/src/devices/cpu/e132xs/e132xs.cpp @@ -1142,7 +1142,7 @@ void hyperstone_device::init(int scale_mask) } m_io = &space(AS_IO); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hyperstone_device::timer_callback), this)); + m_timer = timer_alloc(*this, FUNC(hyperstone_device::timer_callback)); m_core->clock_scale_mask = scale_mask; for (uint8_t i = 0; i < 16; i++) diff --git a/src/devices/cpu/f2mc16/mb9061x.cpp b/src/devices/cpu/f2mc16/mb9061x.cpp index 3017633df3b..35ff9507672 100644 --- a/src/devices/cpu/f2mc16/mb9061x.cpp +++ b/src/devices/cpu/f2mc16/mb9061x.cpp @@ -40,11 +40,11 @@ void mb9061x_device::device_start() { f2mc16_device::device_start(); - m_tbtc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mb9061x_device::tbtc_tick), this)); + m_tbtc_timer = timer_alloc(*this, FUNC(mb9061x_device::tbtc_tick)); m_tbtc_timer->adjust(attotime::never); - m_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mb9061x_device::timer0_tick), this)); + m_timer[0] = timer_alloc(*this, FUNC(mb9061x_device::timer0_tick)); m_timer[0]->adjust(attotime::never); - m_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mb9061x_device::timer1_tick), this)); + m_timer[1] = timer_alloc(*this, FUNC(mb9061x_device::timer1_tick)); m_timer[1]->adjust(attotime::never); } diff --git a/src/devices/cpu/m37710/m37710.cpp b/src/devices/cpu/m37710/m37710.cpp index 9067979db62..43c5e70dbc0 100644 --- a/src/devices/cpu/m37710/m37710.cpp +++ b/src/devices/cpu/m37710/m37710.cpp @@ -1329,12 +1329,12 @@ void m37710_cpu_device::device_start() for (int i = 0; i < 8; i++) { - m_timers[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m37710_cpu_device::m37710_timer_cb), this)); + m_timers[i] = timer_alloc(*this, FUNC(m37710_cpu_device::m37710_timer_cb)); m_reload[i] = attotime::never; m_timer_out[i] = 0; } - m_ad_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m37710_cpu_device::ad_timer_cb), this)); + m_ad_timer = timer_alloc(*this, FUNC(m37710_cpu_device::ad_timer_cb)); save_item(NAME(m_a)); save_item(NAME(m_b)); diff --git a/src/devices/cpu/m6502/st2204.cpp b/src/devices/cpu/m6502/st2204.cpp index 2523f34d5a8..119361269b7 100644 --- a/src/devices/cpu/m6502/st2204.cpp +++ b/src/devices/cpu/m6502/st2204.cpp @@ -91,9 +91,9 @@ void st2204_device::device_start() init_base_timer(0x0020); init_lcd_timer(0x0040); - m_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::t0_interrupt), this)); - m_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::t1_interrupt), this)); - m_psg_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::psg_interrupt), this)); + m_timer[0] = timer_alloc(*this, FUNC(st2204_device::t0_interrupt)); + m_timer[1] = timer_alloc(*this, FUNC(st2204_device::t1_interrupt)); + m_psg_timer = timer_alloc(*this, FUNC(st2204_device::psg_interrupt)); save_item(NAME(m_tmode)); save_item(NAME(m_tcntr)); diff --git a/src/devices/cpu/m6502/st2205u.cpp b/src/devices/cpu/m6502/st2205u.cpp index 15d8992384c..d87e09a7674 100644 --- a/src/devices/cpu/m6502/st2205u.cpp +++ b/src/devices/cpu/m6502/st2205u.cpp @@ -101,10 +101,10 @@ st2302u_device::st2302u_device(const machine_config &mconfig, const char *tag, d void st2205u_base_device::base_init(std::unique_ptr<mi_st2xxx> &&intf) { - m_timer_12bit[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::t0_interrupt), this)); - m_timer_12bit[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::t1_interrupt), this)); - m_timer_12bit[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::t2_interrupt), this)); - m_timer_12bit[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::t3_interrupt), this)); + m_timer_12bit[0] = timer_alloc(*this, FUNC(st2205u_device::t0_interrupt)); + m_timer_12bit[1] = timer_alloc(*this, FUNC(st2205u_device::t1_interrupt)); + m_timer_12bit[2] = timer_alloc(*this, FUNC(st2205u_device::t2_interrupt)); + m_timer_12bit[3] = timer_alloc(*this, FUNC(st2205u_device::t3_interrupt)); init_base_timer(0x0040); init_lcd_timer(0x0080); diff --git a/src/devices/cpu/m6502/st2xxx.cpp b/src/devices/cpu/m6502/st2xxx.cpp index 2c24f65f653..68164c60dc3 100644 --- a/src/devices/cpu/m6502/st2xxx.cpp +++ b/src/devices/cpu/m6502/st2xxx.cpp @@ -130,7 +130,7 @@ void st2xxx_device::init_base_timer(u16 ireq) if (st2xxx_bt_divider(n) != 0) { m_bt_mask |= 1 << n; - m_base_timer[n] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2xxx_device::bt_interrupt), this)); + m_base_timer[n] = timer_alloc(*this, FUNC(st2xxx_device::bt_interrupt)); } } @@ -149,7 +149,7 @@ void st2xxx_device::init_lcd_timer(u16 ireq) m_lcd_ireq = ireq; assert(m_lcd_ireq != 0); - m_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2xxx_device::lcd_interrupt), this)); + m_lcd_timer = timer_alloc(*this, FUNC(st2xxx_device::lcd_interrupt)); } void st2xxx_device::save_common_registers() diff --git a/src/devices/cpu/m6800/m6801.cpp b/src/devices/cpu/m6800/m6801.cpp index de9cae8e9fd..1e20cd10afc 100644 --- a/src/devices/cpu/m6800/m6801.cpp +++ b/src/devices/cpu/m6800/m6801.cpp @@ -930,7 +930,7 @@ void m6801_cpu_device::device_start() { m6800_cpu_device::device_start(); - m_sci_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m6801_cpu_device::sci_tick),this)); + m_sci_timer = timer_alloc(*this, FUNC(m6801_cpu_device::sci_tick)); m_port_ddr[3] = 0; m_port_data[3] = 0; diff --git a/src/devices/cpu/mb88xx/mb88xx.cpp b/src/devices/cpu/mb88xx/mb88xx.cpp index fe07ba80d2c..aff96787497 100644 --- a/src/devices/cpu/mb88xx/mb88xx.cpp +++ b/src/devices/cpu/mb88xx/mb88xx.cpp @@ -194,7 +194,7 @@ void mb88_cpu_device::device_start() m_read_si.resolve_safe(0); m_write_so.resolve_safe(); - m_serial = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mb88_cpu_device::serial_timer), this)); + m_serial = timer_alloc(*this, FUNC(mb88_cpu_device::serial_timer)); m_ctr = 0; diff --git a/src/devices/cpu/mips/mips3.cpp b/src/devices/cpu/mips/mips3.cpp index f82ae82da50..45ead83f293 100644 --- a/src/devices/cpu/mips/mips3.cpp +++ b/src/devices/cpu/mips/mips3.cpp @@ -432,7 +432,7 @@ void mips3_device::device_start() m_program->accessors(m_memory); /* allocate a timer for the compare interrupt */ - m_compare_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mips3_device::compare_int_callback), this)); + m_compare_int_timer = timer_alloc(*this, FUNC(mips3_device::compare_int_callback)); uint32_t flags = 0; /* initialize the UML generator */ diff --git a/src/devices/cpu/mips/r4000.cpp b/src/devices/cpu/mips/r4000.cpp index d88210c9d79..270209c74e3 100644 --- a/src/devices/cpu/mips/r4000.cpp +++ b/src/devices/cpu/mips/r4000.cpp @@ -185,7 +185,7 @@ void r4000_base_device::device_start() m_hard_reset = true; - m_cp0_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(r4000_base_device::cp0_timer_callback), this)); + m_cp0_timer = timer_alloc(*this, FUNC(r4000_base_device::cp0_timer_callback)); // compute icache line selection mask and allocate tag and data unsigned const config_ic = (m_cp0[CP0_Config] & CONFIG_IC) >> 9; diff --git a/src/devices/cpu/mn10200/mn10200.cpp b/src/devices/cpu/mn10200/mn10200.cpp index 0f989d9844b..af0e7565a6c 100644 --- a/src/devices/cpu/mn10200/mn10200.cpp +++ b/src/devices/cpu/mn10200/mn10200.cpp @@ -151,7 +151,7 @@ void mn10200_device::device_start() for (int tmr = 0; tmr < MN10200_NUM_TIMERS_8BIT; tmr++) { - m_timer_timers[tmr] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mn10200_device::simple_timer_cb), this)); + m_timer_timers[tmr] = timer_alloc(*this, FUNC(mn10200_device::simple_timer_cb)); m_timer_timers[tmr]->adjust(attotime::never, tmr); } diff --git a/src/devices/cpu/nec/v25.cpp b/src/devices/cpu/nec/v25.cpp index 8a44732d07d..76128dacbd6 100644 --- a/src/devices/cpu/nec/v25.cpp +++ b/src/devices/cpu/nec/v25.cpp @@ -557,7 +557,7 @@ void v25_common_device::device_start() m_E16 = 0; for (i = 0; i < 4; i++) - m_timers[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(v25_common_device::v25_timer_callback),this)); + m_timers[i] = timer_alloc(*this, FUNC(v25_common_device::v25_timer_callback)); std::fill_n(&m_intp_state[0], 3, 0); std::fill_n(&m_ems[0], 3, 0); diff --git a/src/devices/cpu/powerpc/ppccom.cpp b/src/devices/cpu/powerpc/ppccom.cpp index 1ff153ca1b6..37b24044cca 100644 --- a/src/devices/cpu/powerpc/ppccom.cpp +++ b/src/devices/cpu/powerpc/ppccom.cpp @@ -753,22 +753,22 @@ void ppc_device::device_start() /* allocate a timer for the compare interrupt */ if ((m_cap & PPCCAP_OEA) && (m_tb_divisor)) - m_decrementer_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ppc_device::decrementer_int_callback), this)); + m_decrementer_int_timer = timer_alloc(*this, FUNC(ppc_device::decrementer_int_callback)); /* and for the 4XX interrupts if needed */ if (m_cap & PPCCAP_4XX) { - m_fit_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ppc_device::ppc4xx_fit_callback), this)); - m_pit_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ppc_device::ppc4xx_pit_callback), this)); - m_spu.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ppc_device::ppc4xx_spu_callback), this)); + m_fit_timer = timer_alloc(*this, FUNC(ppc_device::ppc4xx_fit_callback)); + m_pit_timer = timer_alloc(*this, FUNC(ppc_device::ppc4xx_pit_callback)); + m_spu.timer = timer_alloc(*this, FUNC(ppc_device::ppc4xx_spu_callback)); } if (m_cap & PPCCAP_4XX) { - m_buffered_dma_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ppc_device::ppc4xx_buffered_dma_callback), this)); - m_buffered_dma_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ppc_device::ppc4xx_buffered_dma_callback), this)); - m_buffered_dma_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ppc_device::ppc4xx_buffered_dma_callback), this)); - m_buffered_dma_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ppc_device::ppc4xx_buffered_dma_callback), this)); + m_buffered_dma_timer[0] = timer_alloc(*this, FUNC(ppc_device::ppc4xx_buffered_dma_callback)); + m_buffered_dma_timer[1] = timer_alloc(*this, FUNC(ppc_device::ppc4xx_buffered_dma_callback)); + m_buffered_dma_timer[2] = timer_alloc(*this, FUNC(ppc_device::ppc4xx_buffered_dma_callback)); + m_buffered_dma_timer[3] = timer_alloc(*this, FUNC(ppc_device::ppc4xx_buffered_dma_callback)); m_buffered_dma_rate[0] = 10000; m_buffered_dma_rate[1] = 10000; diff --git a/src/devices/cpu/rii/riscii.cpp b/src/devices/cpu/rii/riscii.cpp index 804280dc6e1..54e452338e3 100644 --- a/src/devices/cpu/rii/riscii.cpp +++ b/src/devices/cpu/rii/riscii.cpp @@ -206,8 +206,8 @@ void riscii_series_device::device_start() set_icountptr(m_icount); - m_timer0 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(riscii_series_device::timer0), this)); - m_speech_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(riscii_series_device::speech_timer), this)); + m_timer0 = timer_alloc(*this, FUNC(riscii_series_device::timer0)); + m_speech_timer = timer_alloc(*this, FUNC(riscii_series_device::speech_timer)); state_add<u32>(RII_PC, "PC", [this]() { return m_pc; }, [this](u32 pc) { debug_set_pc(pc); }).mask(m_pcmask); state_add<u32>(STATE_GENPC, "GENPC", [this]() { return m_pc; }, [this](u32 pc) { debug_set_pc(pc); }).mask(m_pcmask).noshow(); diff --git a/src/devices/cpu/sc61860/sc61860.cpp b/src/devices/cpu/sc61860/sc61860.cpp index bd99080a9b5..d77ca6ffa9b 100644 --- a/src/devices/cpu/sc61860/sc61860.cpp +++ b/src/devices/cpu/sc61860/sc61860.cpp @@ -106,7 +106,7 @@ void sc61860_device::device_reset() void sc61860_device::device_start() { - m_2ms_tick_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sc61860_device::sc61860_2ms_tick), this)); + 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)); space(AS_PROGRAM).cache(m_cache); diff --git a/src/devices/cpu/sh/sh2.cpp b/src/devices/cpu/sh/sh2.cpp index d46a2f5fdc0..57bb1629e2e 100644 --- a/src/devices/cpu/sh/sh2.cpp +++ b/src/devices/cpu/sh/sh2.cpp @@ -515,15 +515,15 @@ void sh2_device::device_start() { sh_common_execution::device_start(); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh2_device::sh2_timer_callback), this)); + m_timer = timer_alloc(*this, FUNC(sh2_device::sh2_timer_callback)); m_timer->adjust(attotime::never); - m_wdtimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh2_device::sh2_wdtimer_callback), this)); + m_wdtimer = timer_alloc(*this, FUNC(sh2_device::sh2_wdtimer_callback)); m_wdtimer->adjust(attotime::never); - m_dma_current_active_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh2_device::sh2_dma_current_active_callback), this)); + m_dma_current_active_timer[0] = timer_alloc(*this, FUNC(sh2_device::sh2_dma_current_active_callback)); m_dma_current_active_timer[0]->adjust(attotime::never); - m_dma_current_active_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh2_device::sh2_dma_current_active_callback), this)); + m_dma_current_active_timer[1] = timer_alloc(*this, FUNC(sh2_device::sh2_dma_current_active_callback)); m_dma_current_active_timer[1]->adjust(attotime::never); /* resolve callbacks */ diff --git a/src/devices/cpu/sh/sh4.cpp b/src/devices/cpu/sh/sh4.cpp index acfd0dbfc8a..f3b9c6ac890 100644 --- a/src/devices/cpu/sh/sh4.cpp +++ b/src/devices/cpu/sh/sh4.cpp @@ -2038,21 +2038,21 @@ void sh34_base_device::device_start() for (int i = 0; i < 3; i++) { - m_timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh34_base_device::sh4_timer_callback), this)); + m_timer[i] = timer_alloc(*this, FUNC(sh34_base_device::sh4_timer_callback)); m_timer[i]->adjust(attotime::never, i); } for (int i = 0; i < 4; i++) { - m_dma_timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh34_base_device::sh4_dmac_callback), this)); + m_dma_timer[i] = timer_alloc(*this, FUNC(sh34_base_device::sh4_dmac_callback)); m_dma_timer[i]->adjust(attotime::never, i); } - m_refresh_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh34_base_device::sh4_refresh_timer_callback), this)); + m_refresh_timer = timer_alloc(*this, FUNC(sh34_base_device::sh4_refresh_timer_callback)); m_refresh_timer->adjust(attotime::never); m_refresh_timer_base = 0; - m_rtc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh34_base_device::sh4_rtc_timer_callback), this)); + m_rtc_timer = timer_alloc(*this, FUNC(sh34_base_device::sh4_rtc_timer_callback)); m_rtc_timer->adjust(attotime::never); sh4_parse_configuration(); diff --git a/src/devices/cpu/sharc/sharc.cpp b/src/devices/cpu/sharc/sharc.cpp index ded941af415..97c1eb2afeb 100644 --- a/src/devices/cpu/sharc/sharc.cpp +++ b/src/devices/cpu/sharc/sharc.cpp @@ -576,7 +576,7 @@ void adsp21062_device::device_start() m_core->cache_dirty = 1; - m_core->delayed_iop_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(adsp21062_device::sharc_iop_delayed_write_callback), this)); + m_core->delayed_iop_timer = timer_alloc(*this, FUNC(adsp21062_device::sharc_iop_delayed_write_callback)); for (auto & elem : m_core->dma_op) { @@ -590,7 +590,7 @@ void adsp21062_device::device_start() elem.pmode = 0; elem.chained_direction = 0; elem.active = false; - elem.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(adsp21062_device::sharc_dma_callback), this)); + elem.timer = timer_alloc(*this, FUNC(adsp21062_device::sharc_dma_callback)); } for (int i=0; i < 16; i++) diff --git a/src/devices/cpu/sm510/sm510base.cpp b/src/devices/cpu/sm510/sm510base.cpp index cca35da7730..27fe81e5161 100644 --- a/src/devices/cpu/sm510/sm510base.cpp +++ b/src/devices/cpu/sm510/sm510base.cpp @@ -216,7 +216,7 @@ TIMER_CALLBACK_MEMBER(sm510_base_device::lcd_timer_cb) 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 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sm510_base_device::lcd_timer_cb), this)); + 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); } @@ -266,7 +266,7 @@ TIMER_CALLBACK_MEMBER(sm510_base_device::div_timer_cb) void sm510_base_device::init_divider() { - m_div_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sm510_base_device::div_timer_cb), this)); + 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())); } diff --git a/src/devices/cpu/tlcs870/tlcs870.cpp b/src/devices/cpu/tlcs870/tlcs870.cpp index 2766804a50a..5994fdc5fad 100644 --- a/src/devices/cpu/tlcs870/tlcs870.cpp +++ b/src/devices/cpu/tlcs870/tlcs870.cpp @@ -1245,13 +1245,13 @@ void tlcs870_device::device_start() m_port_analog_in_cb.resolve_all_safe(0xff); m_serial_out_cb.resolve_all_safe(); - m_serial_transmit_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs870_device::sio0_transmit_cb), this)); - m_serial_transmit_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs870_device::sio1_transmit_cb), this)); + m_serial_transmit_timer[0] = timer_alloc(*this, FUNC(tlcs870_device::sio0_transmit_cb)); + m_serial_transmit_timer[1] = timer_alloc(*this, FUNC(tlcs870_device::sio1_transmit_cb)); - m_tcx_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs870_device::tc1_cb), this)); - m_tcx_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs870_device::tc2_cb), this)); - m_tcx_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs870_device::tc3_cb), this)); - m_tcx_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs870_device::tc4_cb), this)); + m_tcx_timer[0] = timer_alloc(*this, FUNC(tlcs870_device::tc1_cb)); + m_tcx_timer[1] = timer_alloc(*this, FUNC(tlcs870_device::tc2_cb)); + m_tcx_timer[2] = timer_alloc(*this, FUNC(tlcs870_device::tc3_cb)); + m_tcx_timer[3] = timer_alloc(*this, FUNC(tlcs870_device::tc4_cb)); } diff --git a/src/devices/cpu/tlcs90/tlcs90.cpp b/src/devices/cpu/tlcs90/tlcs90.cpp index bd02b9cc197..7a6e923ac35 100644 --- a/src/devices/cpu/tlcs90/tlcs90.cpp +++ b/src/devices/cpu/tlcs90/tlcs90.cpp @@ -2951,9 +2951,9 @@ void tlcs90_device::device_start() // Timers for (int i = 0; i < 4; i++) - m_timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs90_device::t90_timer_callback),this)); + m_timer[i] = timer_alloc(*this, FUNC(tlcs90_device::t90_timer_callback)); - m_timer[4] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tlcs90_device::t90_timer4_callback),this)); + m_timer[4] = timer_alloc(*this, FUNC(tlcs90_device::t90_timer4_callback)); state_add( T90_PC, "PC", m_pc.w.l).formatstr("%04X"); state_add( T90_SP, "SP", m_sp.w.l).formatstr("%04X"); diff --git a/src/devices/cpu/tms7000/tms7000.cpp b/src/devices/cpu/tms7000/tms7000.cpp index ea7893f8cea..02c8195c333 100644 --- a/src/devices/cpu/tms7000/tms7000.cpp +++ b/src/devices/cpu/tms7000/tms7000.cpp @@ -222,7 +222,7 @@ void tms7000_device::device_start() for (int tmr = 0; tmr < 2; tmr++) { - m_timer_handle[tmr] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tms7000_device::simple_timer_cb), this)); + m_timer_handle[tmr] = timer_alloc(*this, FUNC(tms7000_device::simple_timer_cb)); m_timer_handle[tmr]->adjust(attotime::never, tmr); m_timer_data[tmr] = 0; diff --git a/src/devices/cpu/ucom4/ucom4.cpp b/src/devices/cpu/ucom4/ucom4.cpp index 8d98f1d2f94..0643283f0ab 100644 --- a/src/devices/cpu/ucom4/ucom4.cpp +++ b/src/devices/cpu/ucom4/ucom4.cpp @@ -167,7 +167,7 @@ void ucom4_cpu_device::device_start() m_datamask = (1 << m_datawidth) - 1; m_dph_mask = m_datamask >> 4; - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ucom4_cpu_device::simple_timer_cb), this)); + m_timer = timer_alloc(*this, FUNC(ucom4_cpu_device::simple_timer_cb)); // resolve callbacks m_read_a.resolve_safe(0); diff --git a/src/devices/cpu/z8/z8.cpp b/src/devices/cpu/z8/z8.cpp index b2f4a20e4fe..9475d8e3edb 100644 --- a/src/devices/cpu/z8/z8.cpp +++ b/src/devices/cpu/z8/z8.cpp @@ -1262,8 +1262,8 @@ void z8_device::device_start() space(AS_IO).specific(m_regs); /* allocate timers */ - m_internal_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z8_device::timeout<0>), this)); - m_internal_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z8_device::timeout<1>), this)); + m_internal_timer[0] = timer_alloc(*this, FUNC(z8_device::timeout<0>)); + m_internal_timer[1] = timer_alloc(*this, FUNC(z8_device::timeout<1>)); /* Clear state */ std::fill(std::begin(m_irq_line), std::end(m_irq_line), CLEAR_LINE); diff --git a/src/devices/cpu/z80/kp63.cpp b/src/devices/cpu/z80/kp63.cpp index a1a9e5913c8..8ccb201a0e1 100644 --- a/src/devices/cpu/z80/kp63.cpp +++ b/src/devices/cpu/z80/kp63.cpp @@ -153,20 +153,20 @@ TIMER_CALLBACK_MEMBER(kp63_device::pwm_off) void kp63_device::device_start() { // Setup timers - m_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::timer_expired<0>), this)); - m_strobe_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::strobe_off<0>), this)); - m_pwm_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::pwm_off<0>), this)); - m_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::timer_expired<1>), this)); - m_strobe_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::strobe_off<1>), this)); - m_pwm_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::pwm_off<1>), this)); - m_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::timer_expired<2>), this)); - m_strobe_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::strobe_off<2>), this)); - m_pwm_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::pwm_off<2>), this)); + m_timer[0] = timer_alloc(*this, FUNC(kp63_device::timer_expired<0>)); + m_strobe_timer[0] = timer_alloc(*this, FUNC(kp63_device::strobe_off<0>)); + m_pwm_timer[0] = timer_alloc(*this, FUNC(kp63_device::pwm_off<0>)); + m_timer[1] = timer_alloc(*this, FUNC(kp63_device::timer_expired<1>)); + m_strobe_timer[1] = timer_alloc(*this, FUNC(kp63_device::strobe_off<1>)); + m_pwm_timer[1] = timer_alloc(*this, FUNC(kp63_device::pwm_off<1>)); + m_timer[2] = timer_alloc(*this, FUNC(kp63_device::timer_expired<2>)); + m_strobe_timer[2] = timer_alloc(*this, FUNC(kp63_device::strobe_off<2>)); + m_pwm_timer[2] = timer_alloc(*this, FUNC(kp63_device::pwm_off<2>)); if (c_num_counters > 3) { - m_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::timer_expired<3>), this)); - m_strobe_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::strobe_off<3>), this)); - m_pwm_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kp63_device::pwm_off<3>), this)); + m_timer[3] = timer_alloc(*this, FUNC(kp63_device::timer_expired<3>)); + m_strobe_timer[3] = timer_alloc(*this, FUNC(kp63_device::strobe_off<3>)); + m_pwm_timer[3] = timer_alloc(*this, FUNC(kp63_device::pwm_off<3>)); } // Save state diff --git a/src/devices/cpu/z80/tmpz84c015.cpp b/src/devices/cpu/z80/tmpz84c015.cpp index 329aec51f9f..a3f3da95bb5 100644 --- a/src/devices/cpu/z80/tmpz84c015.cpp +++ b/src/devices/cpu/z80/tmpz84c015.cpp @@ -116,7 +116,7 @@ void tmpz84c015_device::device_start() m_wdtout_cb.resolve(); // setup watchdog timer - m_watchdog_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tmpz84c015_device::watchdog_timeout), this)); + m_watchdog_timer = timer_alloc(*this, FUNC(tmpz84c015_device::watchdog_timeout)); // register for save states save_item(NAME(m_irq_priority)); diff --git a/src/devices/imagedev/flopdrv.cpp b/src/devices/imagedev/flopdrv.cpp index 05b213ad18e..fe20667198e 100644 --- a/src/devices/imagedev/flopdrv.cpp +++ b/src/devices/imagedev/flopdrv.cpp @@ -123,7 +123,7 @@ void legacy_floppy_image_device::floppy_drive_init() /* initialise flags */ m_flags = 0; m_index_pulse_callback = nullptr; - m_index_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(legacy_floppy_image_device::floppy_drive_index_callback),this)); + m_index_timer = timer_alloc(*this, FUNC(legacy_floppy_image_device::floppy_drive_index_callback)); m_idx = 0; floppy_drive_set_geometry(m_config->floppy_type); diff --git a/src/devices/imagedev/snapquik.cpp b/src/devices/imagedev/snapquik.cpp index 4ac355f6cf4..d5b1cd802f3 100644 --- a/src/devices/imagedev/snapquik.cpp +++ b/src/devices/imagedev/snapquik.cpp @@ -60,7 +60,7 @@ void snapshot_image_device::device_start() m_load.resolve(); /* allocate a timer */ - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(snapshot_image_device::process_snapshot_or_quickload),this)); + m_timer = timer_alloc(*this, FUNC(snapshot_image_device::process_snapshot_or_quickload)); } /*------------------------------------------------- diff --git a/src/devices/machine/68307tmu.cpp b/src/devices/machine/68307tmu.cpp index 06d9f57234d..9c1763c23e8 100644 --- a/src/devices/machine/68307tmu.cpp +++ b/src/devices/machine/68307tmu.cpp @@ -134,12 +134,12 @@ void m68307_cpu_device::m68307_timer::init(m68307_cpu_device *device) single_timer* tptr; tptr = &singletimer[0]; - tptr->mametimer = device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68307_timer::timer0_callback),this), parent); + tptr->mametimer = device->timer_alloc(*this, FUNC(m68307_timer::timer0_callback), parent); tptr = &singletimer[1]; - tptr->mametimer = device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68307_timer::timer1_callback),this), parent); + tptr->mametimer = device->timer_alloc(*this, FUNC(m68307_timer::timer1_callback), parent); - wd_mametimer = device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68307_timer::wd_timer_callback),this), parent); + wd_mametimer = device->timer_alloc(*this, FUNC(m68307_timer::wd_timer_callback)); } uint16_t m68307_cpu_device::m68307_timer::read_tcn(uint16_t mem_mask, int which) diff --git a/src/devices/machine/68340sim.cpp b/src/devices/machine/68340sim.cpp index 7e1f8457224..8f5d48fd3f3 100644 --- a/src/devices/machine/68340sim.cpp +++ b/src/devices/machine/68340sim.cpp @@ -438,7 +438,7 @@ void m68340_cpu_device::start_68340_sim() { LOG("%s\n", FUNCNAME); LOGCLOCK( " - Clock: %d [0x%08x]\n", clock(), clock()); - m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68340_cpu_device::periodic_interrupt_timer_callback),this)); + m_irq_timer = timer_alloc(*this, FUNC(m68340_cpu_device::periodic_interrupt_timer_callback)); // resolve callbacks Port A m_pa_out_cb.resolve_safe(); diff --git a/src/devices/machine/68340tmu.cpp b/src/devices/machine/68340tmu.cpp index d66f1f2387c..e08ae83e64c 100644 --- a/src/devices/machine/68340tmu.cpp +++ b/src/devices/machine/68340tmu.cpp @@ -312,7 +312,7 @@ void mc68340_timer_module_device::device_start() m_cpu = downcast<m68340_cpu_device *>(owner()); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc68340_timer_module_device::timer_callback),this)); + m_timer = timer_alloc(*this, FUNC(mc68340_timer_module_device::timer_callback)); // Resolve Timer callbacks m_tout_out_cb.resolve_safe(); diff --git a/src/devices/machine/74123.cpp b/src/devices/machine/74123.cpp index 4e7197dcc3e..64636baed8b 100644 --- a/src/devices/machine/74123.cpp +++ b/src/devices/machine/74123.cpp @@ -50,7 +50,7 @@ void ttl74123_device::device_start() m_output_callback.enregister(*this, FUNC(ttl74123_device::output_callback)); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ttl74123_device::clear_callback),this)); + m_timer = timer_alloc(*this, FUNC(ttl74123_device::clear_callback)); /* register for state saving */ save_item(NAME(m_a)); diff --git a/src/devices/machine/8364_paula.cpp b/src/devices/machine/8364_paula.cpp index 6869ffb3395..f144051d11a 100644 --- a/src/devices/machine/8364_paula.cpp +++ b/src/devices/machine/8364_paula.cpp @@ -54,7 +54,7 @@ void paula_8364_device::device_start() m_channel[i].curticks = 0; m_channel[i].manualmode = false; m_channel[i].curlocation = 0; - m_channel[i].irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(paula_8364_device::signal_irq), this)); + m_channel[i].irq_timer = timer_alloc(*this, FUNC(paula_8364_device::signal_irq)); } // create the stream diff --git a/src/devices/machine/acorn_ioc.cpp b/src/devices/machine/acorn_ioc.cpp index 1a879cb7a2d..af30917e018 100644 --- a/src/devices/machine/acorn_ioc.cpp +++ b/src/devices/machine/acorn_ioc.cpp @@ -51,7 +51,7 @@ void acorn_ioc_device::device_resolve_objects() void acorn_ioc_device::device_start() { for (int i=0; i <4; i++) - m_timers[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(acorn_ioc_device::timer_tick), this)); + m_timers[i] = timer_alloc(*this, FUNC(acorn_ioc_device::timer_tick)); save_item(NAME(m_ir)); save_item(NAME(m_if)); diff --git a/src/devices/machine/adc0804.cpp b/src/devices/machine/adc0804.cpp index 048b99734b6..01edde71d70 100644 --- a/src/devices/machine/adc0804.cpp +++ b/src/devices/machine/adc0804.cpp @@ -118,7 +118,7 @@ void adc0804_device::device_start() m_fclk_rc = attotime::from_double(m_res * m_cap / 1.1); // create timer - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(adc0804_device::conversion_done), this)); + m_timer = timer_alloc(*this, FUNC(adc0804_device::conversion_done)); // save state if (m_rd_mode == RD_BITBANGED) diff --git a/src/devices/machine/aic6250.cpp b/src/devices/machine/aic6250.cpp index 71859bdee05..7e18c8f7465 100644 --- a/src/devices/machine/aic6250.cpp +++ b/src/devices/machine/aic6250.cpp @@ -182,7 +182,7 @@ void aic6250_device::device_start() m_rev_cntrl = 0x02; - m_state_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aic6250_device::state_loop), this)); + m_state_timer = timer_alloc(*this, FUNC(aic6250_device::state_loop)); m_state = IDLE; m_int_asserted = false; diff --git a/src/devices/machine/akiko.cpp b/src/devices/machine/akiko.cpp index f88a68aa79a..331559f50fc 100644 --- a/src/devices/machine/akiko.cpp +++ b/src/devices/machine/akiko.cpp @@ -132,8 +132,8 @@ void akiko_device::device_start() m_cdrom_cmd_resp = 0; m_cdrom_toc = nullptr; - m_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(akiko_device::dma_proc), this)); - m_frame_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(akiko_device::frame_proc), this)); + m_dma_timer = timer_alloc(*this, FUNC(akiko_device::dma_proc)); + m_frame_timer = timer_alloc(*this, FUNC(akiko_device::frame_proc)); } //------------------------------------------------- diff --git a/src/devices/machine/am79c90.cpp b/src/devices/machine/am79c90.cpp index c48a8cd8236..957c6b75748 100644 --- a/src/devices/machine/am79c90.cpp +++ b/src/devices/machine/am79c90.cpp @@ -87,7 +87,7 @@ void am7990_device_base::device_start() m_dma_in_cb.resolve_safe(0); m_dma_out_cb.resolve_safe(); - m_transmit_poll = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(am7990_device_base::transmit_poll), this)); + m_transmit_poll = timer_alloc(*this, FUNC(am7990_device_base::transmit_poll)); m_transmit_poll->adjust(TX_POLL_PERIOD, 0, TX_POLL_PERIOD); save_item(NAME(m_rap)); diff --git a/src/devices/machine/bq4847.cpp b/src/devices/machine/bq4847.cpp index 7dd9031c814..11420baf1a0 100644 --- a/src/devices/machine/bq4847.cpp +++ b/src/devices/machine/bq4847.cpp @@ -502,13 +502,13 @@ void bq4847_device::connect_osc(bool conn) void bq4847_device::device_start() { - m_clock_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bq4847_device::rtc_clock_cb), this)); + m_clock_timer = timer_alloc(*this, FUNC(bq4847_device::rtc_clock_cb)); // Periodic timer - m_periodic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bq4847_device::rtc_periodic_cb), this)); + m_periodic_timer = timer_alloc(*this, FUNC(bq4847_device::rtc_periodic_cb)); // Watchdog timer - m_watchdog_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bq4847_device::rtc_watchdog_cb), this)); + m_watchdog_timer = timer_alloc(*this, FUNC(bq4847_device::rtc_watchdog_cb)); // Interrupt line m_interrupt_cb.resolve_safe(); diff --git a/src/devices/machine/bq48x2.cpp b/src/devices/machine/bq48x2.cpp index 40bfde5a754..59a937e6763 100644 --- a/src/devices/machine/bq48x2.cpp +++ b/src/devices/machine/bq48x2.cpp @@ -507,13 +507,13 @@ int bq48x2_device::get_delay() void bq48x2_device::device_start() { - m_clock_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bq48x2_device::rtc_clock_cb), this)); + m_clock_timer = timer_alloc(*this, FUNC(bq48x2_device::rtc_clock_cb)); // Periodic timer - m_periodic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bq48x2_device::rtc_periodic_cb), this)); + m_periodic_timer = timer_alloc(*this, FUNC(bq48x2_device::rtc_periodic_cb)); // Watchdog timer - m_watchdog_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bq48x2_device::rtc_watchdog_cb), this)); + m_watchdog_timer = timer_alloc(*this, FUNC(bq48x2_device::rtc_watchdog_cb)); // Interrupt line m_interrupt_cb.resolve_safe(); diff --git a/src/devices/machine/cdp1852.cpp b/src/devices/machine/cdp1852.cpp index b98b9a34fef..1ef08210442 100644 --- a/src/devices/machine/cdp1852.cpp +++ b/src/devices/machine/cdp1852.cpp @@ -66,8 +66,8 @@ void cdp1852_device::device_start() m_write_data.resolve_safe(); // allocate timers - m_update_do_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdp1852_device::update_do), this)); - m_update_sr_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdp1852_device::update_sr), this)); + m_update_do_timer = timer_alloc(*this, FUNC(cdp1852_device::update_do)); + m_update_sr_timer = timer_alloc(*this, FUNC(cdp1852_device::update_sr)); // register for state saving save_item(NAME(m_new_data)); diff --git a/src/devices/machine/cxd1185.cpp b/src/devices/machine/cxd1185.cpp index b599d307783..8229adf44c3 100644 --- a/src/devices/machine/cxd1185.cpp +++ b/src/devices/machine/cxd1185.cpp @@ -100,7 +100,7 @@ void cxd1185_device::device_start() save_item(NAME(m_scsi_ctrl)); save_item(NAME(m_ioport)); - m_state_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cxd1185_device::state_timer), this)); + m_state_timer = timer_alloc(*this, FUNC(cxd1185_device::state_timer)); m_state = IDLE; m_irq_asserted = false; diff --git a/src/devices/machine/dp83932c.cpp b/src/devices/machine/dp83932c.cpp index c08a16b655c..cf61f1f9149 100644 --- a/src/devices/machine/dp83932c.cpp +++ b/src/devices/machine/dp83932c.cpp @@ -82,7 +82,7 @@ void dp83932c_device::device_start() { m_out_int.resolve(); - m_command = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dp83932c_device::command), this)); + m_command = timer_alloc(*this, FUNC(dp83932c_device::command)); save_item(NAME(m_int_state)); save_item(NAME(m_reg)); diff --git a/src/devices/machine/edlc.cpp b/src/devices/machine/edlc.cpp index 9749191afe2..1e24ceb9b1e 100644 --- a/src/devices/machine/edlc.cpp +++ b/src/devices/machine/edlc.cpp @@ -67,8 +67,8 @@ void seeq8003_device::device_start() //save_item(NAME(m_rx_fifo)); //save_item(NAME(m_tx_fifo)); - m_tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(seeq8003_device::transmit), this)); - m_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(seeq8003_device::interrupt), this)); + m_tx_timer = timer_alloc(*this, FUNC(seeq8003_device::transmit)); + m_int_timer = timer_alloc(*this, FUNC(seeq8003_device::interrupt)); m_int_state = 0; m_reset_state = 1; diff --git a/src/devices/machine/exorterm.cpp b/src/devices/machine/exorterm.cpp index 915f492405b..b71e71ca116 100644 --- a/src/devices/machine/exorterm.cpp +++ b/src/devices/machine/exorterm.cpp @@ -761,8 +761,8 @@ void exorterm155_device::device_start() save_item(NAME(m_kbd_start_holdoff)); // Keyboard - m_kbd_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(exorterm155_device::kbd_scan_row), this)); - m_kbd_repeat_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(exorterm155_device::kbd_repeat_cb), this)); + m_kbd_scan_timer = timer_alloc(*this, FUNC(exorterm155_device::kbd_scan_row)); + m_kbd_repeat_timer = timer_alloc(*this, FUNC(exorterm155_device::kbd_repeat_cb)); kbd_reset_state(); kbd_repeat_stop(); diff --git a/src/devices/machine/f3853.cpp b/src/devices/machine/f3853.cpp index 4f7b6ff798b..e617ad9b7c6 100644 --- a/src/devices/machine/f3853.cpp +++ b/src/devices/machine/f3853.cpp @@ -113,7 +113,7 @@ void f3853_device::device_start() reg = reg << 1 | (BIT(reg,7) ^ BIT(reg,5) ^ BIT(reg,4) ^ BIT(reg,3) ^ 1); } - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(f3853_device::timer_callback),this)); + m_timer = timer_alloc(*this, FUNC(f3853_device::timer_callback)); // zerofill (what's not in constructor) m_external_int_enable = false; diff --git a/src/devices/machine/gt64xxx.cpp b/src/devices/machine/gt64xxx.cpp index 54ea16d5e3d..33634e613ca 100644 --- a/src/devices/machine/gt64xxx.cpp +++ b/src/devices/machine/gt64xxx.cpp @@ -205,7 +205,7 @@ void gt64xxx_device::device_start() status = 0x0; // DMA timer - m_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt64xxx_device::perform_dma), this)); + m_dma_timer = timer_alloc(*this, FUNC(gt64xxx_device::perform_dma)); // Leave the timer disabled. m_dma_timer->adjust(attotime::never, 0, DMA_TIMER_PERIOD); @@ -228,10 +228,10 @@ void gt64xxx_device::device_start() } /* allocate timers for the galileo */ - m_timer[0].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt64xxx_device::timer_callback), this)); - m_timer[1].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt64xxx_device::timer_callback), this)); - m_timer[2].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt64xxx_device::timer_callback), this)); - m_timer[3].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gt64xxx_device::timer_callback), this)); + m_timer[0].timer = timer_alloc(*this, FUNC(gt64xxx_device::timer_callback)); + m_timer[1].timer = timer_alloc(*this, FUNC(gt64xxx_device::timer_callback)); + m_timer[2].timer = timer_alloc(*this, FUNC(gt64xxx_device::timer_callback)); + m_timer[3].timer = timer_alloc(*this, FUNC(gt64xxx_device::timer_callback)); // Save states save_item(NAME(m_pci_stall_state)); diff --git a/src/devices/machine/hd63450.cpp b/src/devices/machine/hd63450.cpp index 86d8a9e101c..d1bcf2aff1b 100644 --- a/src/devices/machine/hd63450.cpp +++ b/src/devices/machine/hd63450.cpp @@ -50,7 +50,7 @@ void hd63450_device::device_start() // Initialise timers and registers for (int x = 0; x < 4; x++) - m_timer[x] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hd63450_device::dma_transfer_timer), this)); + m_timer[x] = timer_alloc(*this, FUNC(hd63450_device::dma_transfer_timer)); save_item(STRUCT_MEMBER(m_reg, csr)); save_item(STRUCT_MEMBER(m_reg, cer)); diff --git a/src/devices/machine/i8155.cpp b/src/devices/machine/i8155.cpp index 996faed2f42..ece0ccf5970 100644 --- a/src/devices/machine/i8155.cpp +++ b/src/devices/machine/i8155.cpp @@ -321,8 +321,8 @@ void i8155_device::device_start() m_ram = make_unique_clear<uint8_t[]>(256); // allocate timers - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(i8155_device::timer_half_counted), this)); - m_timer_tc = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(i8155_device::timer_tc), this)); + m_timer = timer_alloc(*this, FUNC(i8155_device::timer_half_counted)); + m_timer_tc = timer_alloc(*this, FUNC(i8155_device::timer_tc)); // register for state saving save_item(NAME(m_io_m)); diff --git a/src/devices/machine/i82357.cpp b/src/devices/machine/i82357.cpp index 80319a8a52a..e0b4a0e7171 100644 --- a/src/devices/machine/i82357.cpp +++ b/src/devices/machine/i82357.cpp @@ -210,7 +210,7 @@ void i82357_device::device_start() m_out_nmi.resolve_safe(); m_out_spkr.resolve_safe(); - m_nmi_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(i82357_device::nmi_check), this)); + m_nmi_check = timer_alloc(*this, FUNC(i82357_device::nmi_check)); } void i82357_device::device_reset() diff --git a/src/devices/machine/i8279.cpp b/src/devices/machine/i8279.cpp index 474dfbbf170..ed58648166e 100644 --- a/src/devices/machine/i8279.cpp +++ b/src/devices/machine/i8279.cpp @@ -120,7 +120,7 @@ void i8279_device::device_start() m_in_shift_cb.resolve(); m_in_ctrl_cb.resolve(); m_scanclock = clock(); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(i8279_device::timerproc_callback), this)); + m_timer = timer_alloc(*this, FUNC(i8279_device::timerproc_callback)); // save state save_item(NAME(m_d_ram)); diff --git a/src/devices/machine/iopsio2.cpp b/src/devices/machine/iopsio2.cpp index 6ffe90c0737..19b03f8bd2e 100644 --- a/src/devices/machine/iopsio2.cpp +++ b/src/devices/machine/iopsio2.cpp @@ -32,7 +32,7 @@ iop_sio2_device::~iop_sio2_device() void iop_sio2_device::device_start() { if (!m_response_timer) - m_response_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(iop_sio2_device::response_timer), this)); + m_response_timer = timer_alloc(*this, FUNC(iop_sio2_device::response_timer)); save_item(NAME(m_buffer)); save_item(NAME(m_curr_byte)); diff --git a/src/devices/machine/ioptimer.cpp b/src/devices/machine/ioptimer.cpp index 487c795ef26..8c44bc256c8 100644 --- a/src/devices/machine/ioptimer.cpp +++ b/src/devices/machine/ioptimer.cpp @@ -39,10 +39,10 @@ void iop_timer_device::device_start() m_int_cb.resolve_safe(); if (!m_compare_timer) - m_compare_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(iop_timer_device::compare), this)); + m_compare_timer = timer_alloc(*this, FUNC(iop_timer_device::compare)); if (!m_overflow_timer) - m_overflow_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(iop_timer_device::overflow), this)); + m_overflow_timer = timer_alloc(*this, FUNC(iop_timer_device::overflow)); } void iop_timer_device::device_reset() @@ -116,7 +116,7 @@ void iop_timer_device::update_overflow_timer() void iop_timer_device::update_count() { - attotime curr_time = machine().scheduler().time(); + attotime curr_time = machine().time(); attotime time_delta = curr_time - m_last_update_time; m_last_update_time = curr_time; m_elapsed_time += time_delta; diff --git a/src/devices/machine/keyboard.ipp b/src/devices/machine/keyboard.ipp index 12dfb7b1a5a..d638a7722cd 100644 --- a/src/devices/machine/keyboard.ipp +++ b/src/devices/machine/keyboard.ipp @@ -34,9 +34,9 @@ template <uint8_t ROW_COUNT> void device_matrix_keyboard_interface<ROW_COUNT>::interface_pre_start() { if (!m_scan_timer) - m_scan_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_matrix_keyboard_interface<ROW_COUNT>::scan_row), this)); + m_scan_timer = device().timer_alloc(*this, FUNC(device_matrix_keyboard_interface<ROW_COUNT>::scan_row)); if (!m_typematic_timer) - m_typematic_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_matrix_keyboard_interface<ROW_COUNT>::typematic), this)); + m_typematic_timer = device().timer_alloc(*this, FUNC(device_matrix_keyboard_interface<ROW_COUNT>::typematic)); reset_key_state(); typematic_stop(); } diff --git a/src/devices/machine/m3002.cpp b/src/devices/machine/m3002.cpp index fd93666a55f..55339217544 100644 --- a/src/devices/machine/m3002.cpp +++ b/src/devices/machine/m3002.cpp @@ -83,7 +83,7 @@ void m3002_device::device_resolve_objects() void m3002_device::device_start() { // Setup timer - m_second_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m3002_device::second_timer), this)); + m_second_timer = timer_alloc(*this, FUNC(m3002_device::second_timer)); // Save internal state save_item(NAME(m_ram)); diff --git a/src/devices/machine/mb87030.cpp b/src/devices/machine/mb87030.cpp index a9c87cfc11b..f18a2651233 100644 --- a/src/devices/machine/mb87030.cpp +++ b/src/devices/machine/mb87030.cpp @@ -433,8 +433,8 @@ void mb87030_device::step(bool timeout) void mb87030_device::device_start() { - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mb87030_device::timeout), this)); - m_delay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mb87030_device::delay_timeout), this)); + m_timer = timer_alloc(*this, FUNC(mb87030_device::timeout)); + m_delay_timer = timer_alloc(*this, FUNC(mb87030_device::delay_timeout)); m_irq_handler.resolve_safe(); m_dreq_handler.resolve_safe(); diff --git a/src/devices/machine/mc68328.cpp b/src/devices/machine/mc68328.cpp index e3690287710..7a8fa1e3fd2 100644 --- a/src/devices/machine/mc68328.cpp +++ b/src/devices/machine/mc68328.cpp @@ -438,10 +438,10 @@ void mc68328_device::device_start() { m68000_device::device_start(); - m_gptimer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc68328_device::timer1_hit),this)); - m_gptimer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc68328_device::timer2_hit),this)); - m_rtc = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc68328_device::rtc_tick),this)); - m_pwm = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc68328_device::pwm_transition),this)); + m_gptimer[0] = timer_alloc(*this, FUNC(mc68328_device::timer1_hit)); + m_gptimer[1] = timer_alloc(*this, FUNC(mc68328_device::timer2_hit)); + m_rtc = timer_alloc(*this, FUNC(mc68328_device::rtc_tick)); + m_pwm = timer_alloc(*this, FUNC(mc68328_device::pwm_transition)); register_state_save(); } diff --git a/src/devices/machine/mc6846.cpp b/src/devices/machine/mc6846.cpp index 72b3f1added..dc399e2a1f7 100644 --- a/src/devices/machine/mc6846.cpp +++ b/src/devices/machine/mc6846.cpp @@ -62,8 +62,8 @@ mc6846_device::mc6846_device(const machine_config &mconfig, const char *tag, dev void mc6846_device::device_start() { - m_interval = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc6846_device::timer_expire), this)); - m_one_shot = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc6846_device::timer_one_shot), this)); + m_interval = timer_alloc(*this, FUNC(mc6846_device::timer_expire)); + m_one_shot = timer_alloc(*this, FUNC(mc6846_device::timer_one_shot)); m_out_port_cb.resolve(); /* 8-bit output */ m_out_cp2_cb.resolve(); /* 1-bit output */ diff --git a/src/devices/machine/mc6854.cpp b/src/devices/machine/mc6854.cpp index ed5eb02b8b5..b8a4edb5788 100644 --- a/src/devices/machine/mc6854.cpp +++ b/src/devices/machine/mc6854.cpp @@ -194,7 +194,7 @@ void mc6854_device::device_start() m_out_rts_cb.resolve_safe(); m_out_dtr_cb.resolve_safe(); - m_ttimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc6854_device::tfifo_cb), this)); + m_ttimer = timer_alloc(*this, FUNC(mc6854_device::tfifo_cb)); save_item(NAME(m_cr1)); save_item(NAME(m_cr2)); diff --git a/src/devices/machine/mc68681.cpp b/src/devices/machine/mc68681.cpp index 6ab7e2f69fe..a5282bbe3fd 100644 --- a/src/devices/machine/mc68681.cpp +++ b/src/devices/machine/mc68681.cpp @@ -208,7 +208,7 @@ void duart_base_device::device_start() read_inport.resolve(); write_outport.resolve_safe(); - duart_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(duart_base_device::duart_timer_callback),this), nullptr); + duart_timer = timer_alloc(*this, FUNC(duart_base_device::duart_timer_callback)); save_item(NAME(ACR)); save_item(NAME(IMR)); diff --git a/src/devices/machine/mcf5206e.cpp b/src/devices/machine/mcf5206e.cpp index 776223dc530..4dc30d1ea4c 100644 --- a/src/devices/machine/mcf5206e.cpp +++ b/src/devices/machine/mcf5206e.cpp @@ -846,7 +846,7 @@ void mcf5206e_peripheral_device::device_start() { init_regs(true); - m_timer1 = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( mcf5206e_peripheral_device::timer1_callback ), this) ); + m_timer1 = timer_alloc(*this, FUNC( mcf5206e_peripheral_device::timer1_callback )); save_item(NAME(m_ICR)); save_item(NAME(m_CSAR)); diff --git a/src/devices/machine/mm5307.cpp b/src/devices/machine/mm5307.cpp index 312d7cff86b..37c0c4d226a 100644 --- a/src/devices/machine/mm5307.cpp +++ b/src/devices/machine/mm5307.cpp @@ -140,7 +140,7 @@ void mm5307_device::device_resolve_objects() void mm5307_device::device_start() { // Create timer - m_periodic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mm5307_device::periodic_update), this)); + m_periodic_timer = timer_alloc(*this, FUNC(mm5307_device::periodic_update)); // Register for saving save_item(NAME(m_freq_control)); diff --git a/src/devices/machine/mm58274c.cpp b/src/devices/machine/mm58274c.cpp index c7e7f49a78e..797210e4d84 100644 --- a/src/devices/machine/mm58274c.cpp +++ b/src/devices/machine/mm58274c.cpp @@ -61,9 +61,9 @@ mm58274c_device::mm58274c_device(const machine_config &mconfig, const char *tag, void mm58274c_device::device_start() { - m_increment_rtc = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mm58274c_device::rtc_increment_cb),this)); + m_increment_rtc = timer_alloc(*this, FUNC(mm58274c_device::rtc_increment_cb)); m_increment_rtc->adjust(attotime::zero, 0, attotime::from_msec(100)); - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mm58274c_device::rtc_interrupt_cb),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(mm58274c_device::rtc_interrupt_cb)); // register for state saving save_item(NAME(m_mode24)); diff --git a/src/devices/machine/ncr5380n.cpp b/src/devices/machine/ncr5380n.cpp index a74b744f9da..1e9e932d40c 100644 --- a/src/devices/machine/ncr5380n.cpp +++ b/src/devices/machine/ncr5380n.cpp @@ -72,7 +72,7 @@ void ncr5380n_device::device_start() m_irq_handler.resolve_safe(); m_drq_handler.resolve_safe(); - m_state_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ncr5380n_device::state_timer), this)); + m_state_timer = timer_alloc(*this, FUNC(ncr5380n_device::state_timer)); save_item(NAME(m_state)); diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index a83715111c3..23b9838fc24 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -380,7 +380,7 @@ void netlist_mame_device::log_add(char const* param, double value, bool isfloat) return; // make a new entry - buffer_entry entry = { machine().scheduler().time(), isfloat, value, param }; + buffer_entry entry = { machine().time(), isfloat, value, param }; // flush out half of the old entries if we hit the buffer limit if (m_buffer.size() >= MAX_BUFFER_ENTRIES) diff --git a/src/devices/machine/ns32081.cpp b/src/devices/machine/ns32081.cpp index c27ffde6595..53c6a7718d8 100644 --- a/src/devices/machine/ns32081.cpp +++ b/src/devices/machine/ns32081.cpp @@ -102,7 +102,7 @@ void ns32081_device::device_start() save_item(NAME(m_state)); save_item(NAME(m_tcy)); - m_complete = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ns32081_device::complete), this)); + m_complete = timer_alloc(*this, FUNC(ns32081_device::complete)); } void ns32081_device::device_reset() diff --git a/src/devices/machine/ns32202.cpp b/src/devices/machine/ns32202.cpp index 669a2e63e7f..ddc953d4c22 100644 --- a/src/devices/machine/ns32202.cpp +++ b/src/devices/machine/ns32202.cpp @@ -102,9 +102,9 @@ void ns32202_device::device_start() save_item(NAME(m_out_int_state)); save_item(NAME(m_out_cout_state)); - m_interrupt = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ns32202_device::interrupt), this)); - m_counter[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ns32202_device::counter<0>), this)); - m_counter[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ns32202_device::counter<1>), this)); + m_interrupt = timer_alloc(*this, FUNC(ns32202_device::interrupt)); + m_counter[0] = timer_alloc(*this, FUNC(ns32202_device::counter<0>)); + m_counter[1] = timer_alloc(*this, FUNC(ns32202_device::counter<1>)); } void ns32202_device::device_reset() diff --git a/src/devices/machine/ps2timer.cpp b/src/devices/machine/ps2timer.cpp index 2f7111b1a22..a80c9caad9c 100644 --- a/src/devices/machine/ps2timer.cpp +++ b/src/devices/machine/ps2timer.cpp @@ -42,10 +42,10 @@ ps2_timer_device::ps2_timer_device(const machine_config &mconfig, const char *ta void ps2_timer_device::device_start() { if (!m_compare_timer) - m_compare_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ps2_timer_device::compare), this)); + m_compare_timer = timer_alloc(*this, FUNC(ps2_timer_device::compare)); if (!m_overflow_timer) - m_overflow_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ps2_timer_device::overflow), this)); + m_overflow_timer = timer_alloc(*this, FUNC(ps2_timer_device::overflow)); } void ps2_timer_device::device_reset() @@ -122,7 +122,7 @@ void ps2_timer_device::update_count() break; } - attotime curr_time = machine().scheduler().time(); + attotime curr_time = machine().time(); attotime time_delta = curr_time - m_last_update_time; m_last_update_time = curr_time; m_elapsed_time += time_delta; diff --git a/src/devices/machine/rtc65271.cpp b/src/devices/machine/rtc65271.cpp index 91706e20170..1103f4c5daa 100644 --- a/src/devices/machine/rtc65271.cpp +++ b/src/devices/machine/rtc65271.cpp @@ -668,9 +668,9 @@ rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag, //------------------------------------------------- void rtc65271_device::device_start() { - m_update_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rtc65271_device::rtc_begin_update_cb), this)); + 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_SQW_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rtc65271_device::rtc_SQW_cb), this)); + m_SQW_timer = timer_alloc(*this, FUNC(rtc65271_device::rtc_SQW_cb)); m_interrupt_cb.resolve(); m_rtc_end_update_cb.enregister(*this, FUNC(rtc65271_device::rtc_end_update_cb)); diff --git a/src/devices/machine/rtc9701.cpp b/src/devices/machine/rtc9701.cpp index a8ccc5cec7f..d5f8c175ad2 100644 --- a/src/devices/machine/rtc9701.cpp +++ b/src/devices/machine/rtc9701.cpp @@ -92,7 +92,7 @@ void rtc9701_device::device_validity_check(validity_checker &valid) const void rtc9701_device::device_start() { /* let's call the timer callback every second */ - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rtc9701_device::timer_callback), this)); + 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))); system_time systime; diff --git a/src/devices/machine/s3520cf.cpp b/src/devices/machine/s3520cf.cpp index abdd1d83638..08f77422764 100644 --- a/src/devices/machine/s3520cf.cpp +++ b/src/devices/machine/s3520cf.cpp @@ -105,7 +105,7 @@ void s3520cf_device::device_validity_check(validity_checker &valid) const void s3520cf_device::device_start() { /* let's call the timer callback every second for now */ - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3520cf_device::timer_callback), this)); + 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))); system_time systime; diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx index acddd0ad7e0..4ff9ce627d6 100644 --- a/src/devices/machine/s3c24xx.hxx +++ b/src/devices/machine/s3c24xx.hxx @@ -3272,15 +3272,15 @@ void S3C24_CLASS_NAME::s3c24xx_device_start() m_nand_data_w_cb.resolve(); #endif for (int i = 0; i < 5; i++) - m_pwm.timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(S3C24_CLASS_NAME::s3c24xx_pwm_timer_exp), this)); + m_pwm.timer[i] = timer_alloc(*this, FUNC(S3C24_CLASS_NAME::s3c24xx_pwm_timer_exp)); for (auto & elem : m_dma) - elem.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(S3C24_CLASS_NAME::s3c24xx_dma_timer_exp), this)); - m_iic.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(S3C24_CLASS_NAME::s3c24xx_iic_timer_exp), this)); - m_iis.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(S3C24_CLASS_NAME::s3c24xx_iis_timer_exp), this)); - m_lcd.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(S3C24_CLASS_NAME::s3c24xx_lcd_timer_exp), this)); - m_rtc.timer_tick_count = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(S3C24_CLASS_NAME::s3c24xx_rtc_timer_tick_count_exp), this)); - m_rtc.timer_update = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(S3C24_CLASS_NAME::s3c24xx_rtc_timer_update_exp), this)); - m_wdt.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(S3C24_CLASS_NAME::s3c24xx_wdt_timer_exp), this)); + elem.timer = timer_alloc(*this, FUNC(S3C24_CLASS_NAME::s3c24xx_dma_timer_exp)); + m_iic.timer = timer_alloc(*this, FUNC(S3C24_CLASS_NAME::s3c24xx_iic_timer_exp)); + m_iis.timer = timer_alloc(*this, FUNC(S3C24_CLASS_NAME::s3c24xx_iis_timer_exp)); + m_lcd.timer = timer_alloc(*this, FUNC(S3C24_CLASS_NAME::s3c24xx_lcd_timer_exp)); + m_rtc.timer_tick_count = timer_alloc(*this, FUNC(S3C24_CLASS_NAME::s3c24xx_rtc_timer_tick_count_exp)); + m_rtc.timer_update = timer_alloc(*this, FUNC(S3C24_CLASS_NAME::s3c24xx_rtc_timer_update_exp)); + m_wdt.timer = timer_alloc(*this, FUNC(S3C24_CLASS_NAME::s3c24xx_wdt_timer_exp)); #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) int om0 = iface_core_pin_r(S3C24XX_CORE_PIN_OM0); diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index bf3a1ed811c..460f774e68a 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -268,17 +268,17 @@ void s3c44b0_device::device_start() m_cpu->space(AS_PROGRAM).cache(m_cache); - for (int i = 0; i < 6; i++) m_pwm.timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::pwm_timer_exp),this)); - for (auto & elem : m_uart) elem.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::uart_timer_exp),this)); - for (auto & elem : m_zdma) elem.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::zdma_timer_exp),this)); - for (auto & elem : m_bdma) elem.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::bdma_timer_exp),this)); - - m_lcd.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::lcd_timer_exp),this)); - m_wdt.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::wdt_timer_exp),this)); - m_sio.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::sio_timer_exp),this)); - m_adc.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::adc_timer_exp),this)); - m_iic.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::iic_timer_exp),this)); - m_iis.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::iis_timer_exp),this)); + for (int i = 0; i < 6; i++) m_pwm.timer[i] = timer_alloc(*this, FUNC(s3c44b0_device::pwm_timer_exp)); + for (auto & elem : m_uart) elem.timer = timer_alloc(*this, FUNC(s3c44b0_device::uart_timer_exp)); + for (auto & elem : m_zdma) elem.timer = timer_alloc(*this, FUNC(s3c44b0_device::zdma_timer_exp)); + for (auto & elem : m_bdma) elem.timer = timer_alloc(*this, FUNC(s3c44b0_device::bdma_timer_exp)); + + m_lcd.timer = timer_alloc(*this, FUNC(s3c44b0_device::lcd_timer_exp)); + m_wdt.timer = timer_alloc(*this, FUNC(s3c44b0_device::wdt_timer_exp)); + m_sio.timer = timer_alloc(*this, FUNC(s3c44b0_device::sio_timer_exp)); + m_adc.timer = timer_alloc(*this, FUNC(s3c44b0_device::adc_timer_exp)); + m_iic.timer = timer_alloc(*this, FUNC(s3c44b0_device::iic_timer_exp)); + m_iis.timer = timer_alloc(*this, FUNC(s3c44b0_device::iis_timer_exp)); video_start(); diff --git a/src/devices/machine/sa1110.cpp b/src/devices/machine/sa1110.cpp index 11afedeef51..70f2f068ce1 100644 --- a/src/devices/machine/sa1110.cpp +++ b/src/devices/machine/sa1110.cpp @@ -2314,12 +2314,12 @@ void sa1110_periphs_device::device_start() save_item(NAME(m_icp_regs.uart.rx_fifo_read_idx)); save_item(NAME(m_icp_regs.uart.rx_fifo_write_idx)); save_item(NAME(m_icp_regs.uart.rx_fifo_count)); - m_icp_regs.uart_rx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::icp_rx_callback), this)); + m_icp_regs.uart_rx_timer = timer_alloc(*this, FUNC(sa1110_periphs_device::icp_rx_callback)); save_item(NAME(m_icp_regs.uart.tx_fifo)); save_item(NAME(m_icp_regs.uart.tx_fifo_read_idx)); save_item(NAME(m_icp_regs.uart.tx_fifo_write_idx)); save_item(NAME(m_icp_regs.uart.tx_fifo_count)); - m_icp_regs.uart_tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::icp_tx_callback), this)); + m_icp_regs.uart_tx_timer = timer_alloc(*this, FUNC(sa1110_periphs_device::icp_tx_callback)); save_item(NAME(m_icp_regs.uart.rx_break_interlock)); save_item(NAME(m_icp_regs.utcr4)); @@ -2331,12 +2331,12 @@ void sa1110_periphs_device::device_start() save_item(NAME(m_icp_regs.hssp.rx_fifo_read_idx)); save_item(NAME(m_icp_regs.hssp.rx_fifo_write_idx)); save_item(NAME(m_icp_regs.hssp.rx_fifo_count)); - m_icp_regs.hssp.rx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::hssp_rx_callback), this)); + m_icp_regs.hssp.rx_timer = timer_alloc(*this, FUNC(sa1110_periphs_device::hssp_rx_callback)); save_item(NAME(m_icp_regs.hssp.tx_fifo)); save_item(NAME(m_icp_regs.hssp.tx_fifo_read_idx)); save_item(NAME(m_icp_regs.hssp.tx_fifo_write_idx)); save_item(NAME(m_icp_regs.hssp.tx_fifo_count)); - m_icp_regs.hssp.tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::hssp_tx_callback), this)); + m_icp_regs.hssp.tx_timer = timer_alloc(*this, FUNC(sa1110_periphs_device::hssp_tx_callback)); save_item(NAME(m_uart_regs.utcr)); save_item(NAME(m_uart_regs.utsr0)); @@ -2363,7 +2363,7 @@ void sa1110_periphs_device::device_start() save_item(NAME(m_mcp_regs.audio_tx_fifo_read_idx)); save_item(NAME(m_mcp_regs.audio_tx_fifo_write_idx)); save_item(NAME(m_mcp_regs.audio_tx_fifo_count)); - m_mcp_regs.audio_tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::mcp_audio_tx_callback), this)); + m_mcp_regs.audio_tx_timer = timer_alloc(*this, FUNC(sa1110_periphs_device::mcp_audio_tx_callback)); save_item(NAME(m_mcp_regs.telecom_rx_fifo)); save_item(NAME(m_mcp_regs.telecom_rx_fifo_read_idx)); save_item(NAME(m_mcp_regs.telecom_rx_fifo_write_idx)); @@ -2372,7 +2372,7 @@ void sa1110_periphs_device::device_start() save_item(NAME(m_mcp_regs.telecom_tx_fifo_read_idx)); save_item(NAME(m_mcp_regs.telecom_tx_fifo_write_idx)); save_item(NAME(m_mcp_regs.telecom_tx_fifo_count)); - m_mcp_regs.telecom_tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::mcp_telecom_tx_callback), this)); + m_mcp_regs.telecom_tx_timer = timer_alloc(*this, FUNC(sa1110_periphs_device::mcp_telecom_tx_callback)); save_item(NAME(m_ssp_regs.sscr0)); save_item(NAME(m_ssp_regs.sscr1)); @@ -2381,12 +2381,12 @@ void sa1110_periphs_device::device_start() save_item(NAME(m_ssp_regs.rx_fifo_read_idx)); save_item(NAME(m_ssp_regs.rx_fifo_write_idx)); save_item(NAME(m_ssp_regs.rx_fifo_count)); - m_ssp_regs.rx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::ssp_rx_callback), this)); + m_ssp_regs.rx_timer = timer_alloc(*this, FUNC(sa1110_periphs_device::ssp_rx_callback)); save_item(NAME(m_ssp_regs.tx_fifo)); save_item(NAME(m_ssp_regs.tx_fifo_read_idx)); save_item(NAME(m_ssp_regs.tx_fifo_write_idx)); save_item(NAME(m_ssp_regs.tx_fifo_count)); - m_ssp_regs.tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::ssp_tx_callback), this)); + m_ssp_regs.tx_timer = timer_alloc(*this, FUNC(sa1110_periphs_device::ssp_tx_callback)); save_item(NAME(m_ostmr_regs.osmr)); save_item(NAME(m_ostmr_regs.oscr)); @@ -2395,14 +2395,14 @@ void sa1110_periphs_device::device_start() save_item(NAME(m_ostmr_regs.oier)); for (int i = 0; i < 4; i++) { - m_ostmr_regs.timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::ostimer_tick_cb), this)); + m_ostmr_regs.timer[i] = timer_alloc(*this, FUNC(sa1110_periphs_device::ostimer_tick_cb)); } save_item(NAME(m_rtc_regs.rtar)); save_item(NAME(m_rtc_regs.rcnr)); save_item(NAME(m_rtc_regs.rttr)); save_item(NAME(m_rtc_regs.rtsr)); - m_rtc_regs.tick_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1110_periphs_device::rtc_tick_cb), this)); + m_rtc_regs.tick_timer = timer_alloc(*this, FUNC(sa1110_periphs_device::rtc_tick_cb)); save_item(NAME(m_power_regs.pmcr)); save_item(NAME(m_power_regs.pssr)); diff --git a/src/devices/machine/sa1111.cpp b/src/devices/machine/sa1111.cpp index 89ebf0a1784..e35977793d5 100644 --- a/src/devices/machine/sa1111.cpp +++ b/src/devices/machine/sa1111.cpp @@ -2080,13 +2080,13 @@ void sa1111_device::device_start() save_item(NAME(m_card_regs.pcssr)); save_item(NAME(m_card_regs.pcsr)); - m_audio_regs.rx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1111_device::audio_rx_callback), this)); - m_audio_regs.rx_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1111_device::audio_rx_dma_callback), this)); - m_audio_regs.tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1111_device::audio_tx_callback), this)); - m_audio_regs.tx_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1111_device::audio_tx_dma_callback), this)); + m_audio_regs.rx_timer = timer_alloc(*this, FUNC(sa1111_device::audio_rx_callback)); + m_audio_regs.rx_dma_timer = timer_alloc(*this, FUNC(sa1111_device::audio_rx_dma_callback)); + m_audio_regs.tx_timer = timer_alloc(*this, FUNC(sa1111_device::audio_tx_callback)); + m_audio_regs.tx_dma_timer = timer_alloc(*this, FUNC(sa1111_device::audio_tx_dma_callback)); - m_ssp_regs.rx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1111_device::ssp_rx_callback), this)); - m_ssp_regs.tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sa1111_device::ssp_tx_callback), this)); + m_ssp_regs.rx_timer = timer_alloc(*this, FUNC(sa1111_device::ssp_rx_callback)); + m_ssp_regs.tx_timer = timer_alloc(*this, FUNC(sa1111_device::ssp_tx_callback)); m_irq_out.resolve_safe(); m_gpio_out.resolve_all_safe(); diff --git a/src/devices/machine/scn_pci.cpp b/src/devices/machine/scn_pci.cpp index 73ef2590e66..bd1e460ac3c 100644 --- a/src/devices/machine/scn_pci.cpp +++ b/src/devices/machine/scn_pci.cpp @@ -303,7 +303,7 @@ void scn2641_device::device_resolve_objects() void scn_pci_device::device_start() { // Create timer for baud rate generator - m_brg_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scn_pci_device::brg_tick), this)); + m_brg_timer = timer_alloc(*this, FUNC(scn_pci_device::brg_tick)); // Save state save_item(NAME(m_rhr)); diff --git a/src/devices/machine/sensorboard.cpp b/src/devices/machine/sensorboard.cpp index 72b7b57f6d5..785fdc8d569 100644 --- a/src/devices/machine/sensorboard.cpp +++ b/src/devices/machine/sensorboard.cpp @@ -114,8 +114,8 @@ void sensorboard_device::device_start() m_out_count.resolve(); } - m_undotimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sensorboard_device::undo_tick),this)); - m_sensortimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sensorboard_device::sensor_off),this)); + m_undotimer = timer_alloc(*this, FUNC(sensorboard_device::undo_tick)); + m_sensortimer = timer_alloc(*this, FUNC(sensorboard_device::sensor_off)); cancel_sensor(); u16 wmask = ~((1 << m_width) - 1); diff --git a/src/devices/machine/smc91c9x.cpp b/src/devices/machine/smc91c9x.cpp index 7d85deee42b..1959e334697 100644 --- a/src/devices/machine/smc91c9x.cpp +++ b/src/devices/machine/smc91c9x.cpp @@ -83,7 +83,7 @@ void smc91c9x_device::device_start() m_buffer = std::make_unique<u8[]>(ETHER_BUFFER_SIZE * m_num_ebuf); // TX timer - m_tx_poll = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(smc91c9x_device::tx_poll), this)); + m_tx_poll = timer_alloc(*this, FUNC(smc91c9x_device::tx_poll)); m_irq_handler.resolve_safe(); @@ -576,7 +576,7 @@ TIMER_CALLBACK_MEMBER(smc91c9x_device::tx_poll) m_tx_active = 1; m_tx_poll->enable(false); - LOGMASKED(LOG_TX, "Start sending packet %d length = %d time: %s\n", packet_num, length, machine().scheduler().time().as_string()); + LOGMASKED(LOG_TX, "Start sending packet %d length = %d time: %s\n", packet_num, length, machine().time().as_string()); dump_bytes(&tx_buffer[4], length); // Write loopback data and save result @@ -608,7 +608,7 @@ void smc91c9x_device::send_complete_cb(int result) const int packet_num = pop_queued_tx(); uint8_t *const tx_buffer = &m_buffer[packet_num * ETHER_BUFFER_SIZE]; - LOGMASKED(LOG_TX, "End sending packet %d result = %d time: %s\n", packet_num, result, machine().scheduler().time().as_string()); + LOGMASKED(LOG_TX, "End sending packet %d result = %d time: %s\n", packet_num, result, machine().time().as_string()); /* update the EPH register */ m_reg[B0_EPH_STATUS] |= TX_SUC; @@ -764,7 +764,7 @@ void smc91c9x_device::process_command(uint16_t data) if (!m_tx_active && !m_tx_poll->enabled()) { m_tx_poll->adjust(attotime::from_usec(10)); - LOG("Start polling time: %s\n", machine().scheduler().time().as_string()); + LOG("Start polling time: %s\n", machine().time().as_string()); } } break; diff --git a/src/devices/machine/timekpr.cpp b/src/devices/machine/timekpr.cpp index 2666fb2af78..3571a068478 100644 --- a/src/devices/machine/timekpr.cpp +++ b/src/devices/machine/timekpr.cpp @@ -230,7 +230,7 @@ void timekeeper_device::device_start() emu_timer *timer = timer_alloc(); timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); - m_watchdog_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(timekeeper_device::watchdog_callback), this)); + m_watchdog_timer = timer_alloc(*this, FUNC(timekeeper_device::watchdog_callback)); m_watchdog_timer->adjust(attotime::never); m_reset_cb.resolve_safe(); m_irq_cb.resolve_safe(); diff --git a/src/devices/machine/tmp68301.cpp b/src/devices/machine/tmp68301.cpp index f6cd84dd318..1829064d876 100644 --- a/src/devices/machine/tmp68301.cpp +++ b/src/devices/machine/tmp68301.cpp @@ -161,7 +161,7 @@ void tmp68301_device::device_start() m68000_device::device_start(); for (int i = 0; i < 3; i++) - m_tmp68301_timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tmp68301_device::timer_callback), this)); + m_tmp68301_timer[i] = timer_alloc(*this, FUNC(tmp68301_device::timer_callback)); m_in_parallel_cb.resolve_safe(0); m_out_parallel_cb.resolve_safe(); diff --git a/src/devices/machine/upd7001.cpp b/src/devices/machine/upd7001.cpp index d4607e7a479..2d675b4a76c 100644 --- a/src/devices/machine/upd7001.cpp +++ b/src/devices/machine/upd7001.cpp @@ -85,8 +85,8 @@ void upd7001_device::device_start() m_fck_rc = attotime::from_double(m_res * m_cap * 1.97); // initialize timers - m_conv_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(upd7001_device::conversion_done), this)); - m_scsk_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(upd7001_device::output_enabled), this)); + m_conv_timer = timer_alloc(*this, FUNC(upd7001_device::conversion_done)); + m_scsk_timer = timer_alloc(*this, FUNC(upd7001_device::output_enabled)); // save state save_item(NAME(m_cs_active)); diff --git a/src/devices/machine/upd71071.cpp b/src/devices/machine/upd71071.cpp index de46ffe53c5..f5a4735a6b2 100644 --- a/src/devices/machine/upd71071.cpp +++ b/src/devices/machine/upd71071.cpp @@ -117,7 +117,7 @@ void upd71071_device::device_start() m_dma_write_cb.resolve_all_safe(); m_out_dack_cb.resolve_all_safe(); for (auto &elem : m_timer) - elem = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(upd71071_device::dma_transfer_timer), this)); + elem = timer_alloc(*this, FUNC(upd71071_device::dma_transfer_timer)); m_selected_channel = 0; m_reg.device_control = 0; diff --git a/src/devices/machine/v3021.cpp b/src/devices/machine/v3021.cpp index 559a617340a..e64e7c81111 100644 --- a/src/devices/machine/v3021.cpp +++ b/src/devices/machine/v3021.cpp @@ -153,7 +153,7 @@ void v3021_device::device_validity_check(validity_checker &valid) const void v3021_device::device_start() { /* let's call the timer callback every second */ - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(v3021_device::timer_callback), this)); + 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))); copy_clock_to_ram(); diff --git a/src/devices/machine/vrc4373.cpp b/src/devices/machine/vrc4373.cpp index d0dbb96e55a..5d5f84d5f3f 100644 --- a/src/devices/machine/vrc4373.cpp +++ b/src/devices/machine/vrc4373.cpp @@ -151,7 +151,7 @@ void vrc4373_device::device_start() m_cpu->add_fastram(0x1fc00000, 0x1fcfffff, true, m_romRegion->base()); // DMA timer - m_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vrc4373_device::dma_transfer), this)); + m_dma_timer = timer_alloc(*this, FUNC(vrc4373_device::dma_transfer)); // Leave the timer disabled. m_dma_timer->adjust(attotime::never, 0, DMA_TIMER_PERIOD); diff --git a/src/devices/machine/vrc5074.cpp b/src/devices/machine/vrc5074.cpp index a2e1c0ea061..dc6ef41e8cb 100644 --- a/src/devices/machine/vrc5074.cpp +++ b/src/devices/machine/vrc5074.cpp @@ -230,14 +230,14 @@ void vrc5074_device::device_start() m_cpu->add_fastram(0x1fc00000, 0x1fcfffff, true, m_romRegion->base()); // DMA timer - m_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vrc5074_device::dma_transfer), this)); + m_dma_timer = timer_alloc(*this, FUNC(vrc5074_device::dma_transfer)); // Leave the timer disabled. m_dma_timer->adjust(attotime::never, 0, DMA_TIMER_PERIOD); /* allocate timers for the NILE */ - m_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate()); - m_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate()); - m_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vrc5074_device::nile_timer_callback), this)); - m_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vrc5074_device::nile_timer_callback), this)); + m_timer[0] = timer_alloc(); + m_timer[1] = timer_alloc(); + m_timer[2] = timer_alloc(*this, FUNC(vrc5074_device::nile_timer_callback)); + m_timer[3] = timer_alloc(*this, FUNC(vrc5074_device::nile_timer_callback)); // Save states // m_sdram diff --git a/src/devices/machine/vrender0.cpp b/src/devices/machine/vrender0.cpp index c97a40a5736..18600936368 100644 --- a/src/devices/machine/vrender0.cpp +++ b/src/devices/machine/vrender0.cpp @@ -165,7 +165,7 @@ void vrender0soc_device::device_start() fatalerror("%s: bus clock not setup properly",this->tag()); for (int i = 0; i < 4; i++) - m_Timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vrender0soc_device::Timercb),this), (void*)(uintptr_t)i); + m_Timer[i] = timer_alloc(*this, FUNC(vrender0soc_device::Timercb), (void*)(uintptr_t)i); write_tx.resolve_all_safe(); diff --git a/src/devices/machine/z8038.cpp b/src/devices/machine/z8038.cpp index b5c375b408e..202decf92a9 100644 --- a/src/devices/machine/z8038.cpp +++ b/src/devices/machine/z8038.cpp @@ -91,7 +91,7 @@ void z8038_device::device_start() //save_item(NAME(m_fifo)); - m_int_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z8038_device::int_check), this)); + m_int_check = timer_alloc(*this, FUNC(z8038_device::int_check)); // suppress startup interrupt line changes m_port[0].int_asserted = false; diff --git a/src/devices/machine/z80ctc.cpp b/src/devices/machine/z80ctc.cpp index c3004b1fade..17ed606d085 100644 --- a/src/devices/machine/z80ctc.cpp +++ b/src/devices/machine/z80ctc.cpp @@ -307,7 +307,7 @@ z80ctc_channel_device::z80ctc_channel_device(const machine_config &mconfig, cons void z80ctc_channel_device::device_start() { // initialize state - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80ctc_channel_device::timer_callback), this)); + m_timer = timer_alloc(*this, FUNC(z80ctc_channel_device::timer_callback)); // register for save states save_item(NAME(m_mode)); diff --git a/src/devices/machine/z80dma.cpp b/src/devices/machine/z80dma.cpp index c892200514f..a1152626c08 100644 --- a/src/devices/machine/z80dma.cpp +++ b/src/devices/machine/z80dma.cpp @@ -181,7 +181,7 @@ void z80dma_device::device_start() m_out_iorq_cb.resolve_safe(); // allocate timer - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80dma_device::timerproc), this)); + m_timer = timer_alloc(*this, FUNC(z80dma_device::timerproc)); m_rdy_write_callback.enregister(*this, FUNC(z80dma_device::rdy_write_callback)); // register for state saving diff --git a/src/devices/machine/z80sio.cpp b/src/devices/machine/z80sio.cpp index 5095dd4cb9b..bc6f44404af 100644 --- a/src/devices/machine/z80sio.cpp +++ b/src/devices/machine/z80sio.cpp @@ -1087,7 +1087,7 @@ void mk68564_channel::device_start() { z80sio_channel::device_start(); - m_brg_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mk68564_channel::brg_timeout), this)); + m_brg_timer = timer_alloc(*this, FUNC(mk68564_channel::brg_timeout)); save_item(NAME(m_tx_auto_enable)); save_item(NAME(m_brg_tc)); diff --git a/src/devices/sound/aica.cpp b/src/devices/sound/aica.cpp index 21d5fa081d0..4f1d127762d 100644 --- a/src/devices/sound/aica.cpp +++ b/src/devices/sound/aica.cpp @@ -437,9 +437,9 @@ void aica_device::Init() space().specific(m_DSP.space); space().cache(m_DSP.cache); - m_timerA = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aica_device::timerA_cb), this)); - m_timerB = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aica_device::timerB_cb), this)); - m_timerC = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aica_device::timerC_cb), this)); + m_timerA = timer_alloc(*this, FUNC(aica_device::timerA_cb)); + m_timerB = timer_alloc(*this, FUNC(aica_device::timerB_cb)); + m_timerC = timer_alloc(*this, FUNC(aica_device::timerC_cb)); for (i = 0; i < 0x400; ++i) { diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp index 62e32707f6c..26e5a7dc11d 100644 --- a/src/devices/sound/c140.cpp +++ b/src/devices/sound/c140.cpp @@ -117,7 +117,7 @@ void c140_device::device_start() m_sample_rate = m_baserate = clock(); m_int1_callback.resolve_safe(); - m_int1_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(c140_device::int1_on), this)); + m_int1_timer = timer_alloc(*this, FUNC(c140_device::int1_on)); m_stream = stream_alloc(0, 2, m_sample_rate); diff --git a/src/devices/sound/gb.cpp b/src/devices/sound/gb.cpp index 2fc1c81e5b0..58abcfecf15 100644 --- a/src/devices/sound/gb.cpp +++ b/src/devices/sound/gb.cpp @@ -143,7 +143,7 @@ cgb04_apu_device::cgb04_apu_device(const machine_config &mconfig, const char *ta void gameboy_sound_device::device_start() { m_channel = stream_alloc(0, 2, SAMPLE_RATE_OUTPUT_ADAPTIVE); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gameboy_sound_device::timer_callback),this)); + 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)); save_item(NAME(m_last_updated)); diff --git a/src/devices/sound/huc6230.cpp b/src/devices/sound/huc6230.cpp index 31e143fea8c..cbf09cb9a9b 100644 --- a/src/devices/sound/huc6230.cpp +++ b/src/devices/sound/huc6230.cpp @@ -176,7 +176,7 @@ void huc6230_device::device_start() m_vca_cb.resolve_safe(); m_stream = stream_alloc(2, 2, clock() / 6); - m_adpcm_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(huc6230_device::adpcm_timer),this)); + m_adpcm_timer = timer_alloc(*this, FUNC(huc6230_device::adpcm_timer)); for (int i = 0; i < 2; i++) { diff --git a/src/devices/sound/ics2115.cpp b/src/devices/sound/ics2115.cpp index 868bcb70bc4..928c3f2a8fc 100644 --- a/src/devices/sound/ics2115.cpp +++ b/src/devices/sound/ics2115.cpp @@ -61,8 +61,8 @@ void ics2115_device::device_start() space(0).cache(m_cache); - m_timer[0].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ics2115_device::timer_cb_0),this), this); - m_timer[1].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ics2115_device::timer_cb_1),this), this); + m_timer[0].timer = timer_alloc(*this, FUNC(ics2115_device::timer_cb_0)); + m_timer[1].timer = timer_alloc(*this, FUNC(ics2115_device::timer_cb_1)); m_stream = stream_alloc(0, 2, clock() / (32 * 32)); m_irq_cb.resolve_safe(); diff --git a/src/devices/sound/iopspu.cpp b/src/devices/sound/iopspu.cpp index 0267c31eadb..be0de6c2a4f 100644 --- a/src/devices/sound/iopspu.cpp +++ b/src/devices/sound/iopspu.cpp @@ -31,10 +31,10 @@ void iop_spu_device::device_start() m_ram = std::make_unique<uint16_t[]>(2 * 1024 * 1024); // ? if (!m_core[0].m_autodma_done_timer_hack) - m_core[0].m_autodma_done_timer_hack = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(iop_spu_device::autodma_done_timer_hack), this), 0); + m_core[0].m_autodma_done_timer_hack = timer_alloc(*this, FUNC(iop_spu_device::autodma_done_timer_hack), 0); if (!m_core[1].m_autodma_done_timer_hack) - m_core[1].m_autodma_done_timer_hack = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(iop_spu_device::autodma_done_timer_hack), this), (void*)1); + m_core[1].m_autodma_done_timer_hack = timer_alloc(*this, FUNC(iop_spu_device::autodma_done_timer_hack), (void*)1); save_item(NAME(m_core[0].m_status)); save_item(NAME(m_core[0].m_start_port_addr)); diff --git a/src/devices/sound/mea8000.cpp b/src/devices/sound/mea8000.cpp index 3cf2ad51a6e..e9d26dbad62 100644 --- a/src/devices/sound/mea8000.cpp +++ b/src/devices/sound/mea8000.cpp @@ -137,7 +137,7 @@ void mea8000_device::device_start() m_stream = stream_alloc(0, 1, clock() / 60); save_item(NAME(m_output)); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mea8000_device::timer_expire),this)); + m_timer = timer_alloc(*this, FUNC(mea8000_device::timer_expire)); save_item(NAME(m_state)); save_item(NAME(m_buf)); diff --git a/src/devices/sound/scsp.cpp b/src/devices/sound/scsp.cpp index b340da3d237..f7df68508eb 100644 --- a/src/devices/sound/scsp.cpp +++ b/src/devices/sound/scsp.cpp @@ -579,9 +579,9 @@ void scsp_device::init() m_MidiOutR = m_MidiOutW = 0; m_DSP.space = &this->space(); - m_timerA = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scsp_device::timerA_cb), this)); - m_timerB = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scsp_device::timerB_cb), this)); - m_timerC = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scsp_device::timerC_cb), this)); + m_timerA = timer_alloc(*this, FUNC(scsp_device::timerA_cb)); + m_timerB = timer_alloc(*this, FUNC(scsp_device::timerB_cb)); + m_timerC = timer_alloc(*this, FUNC(scsp_device::timerC_cb)); for (i = 0; i < 0x400; ++i) { diff --git a/src/devices/sound/sp0256.cpp b/src/devices/sound/sp0256.cpp index 5188d3bc31f..0d0a4b9047e 100644 --- a/src/devices/sound/sp0256.cpp +++ b/src/devices/sound/sp0256.cpp @@ -106,7 +106,7 @@ void sp0256_device::device_start() // TODO: because of this, check if the bitrev functions are even used anywhere else // bitrevbuff(m_rom, 0, 0xffff); - m_lrq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sp0256_device::set_lrq_timer_proc),this)); + m_lrq_timer = timer_alloc(*this, FUNC(sp0256_device::set_lrq_timer_proc)); // save device variables save_item(NAME(m_sby_line)); diff --git a/src/devices/sound/upd1771.cpp b/src/devices/sound/upd1771.cpp index 2ec1d767ba0..5fd3af2cfaf 100644 --- a/src/devices/sound/upd1771.cpp +++ b/src/devices/sound/upd1771.cpp @@ -253,7 +253,7 @@ void upd1771c_device::device_start() /* resolve callbacks */ m_ack_handler.resolve_safe(); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(upd1771c_device::ack_callback),this)); + m_timer = timer_alloc(*this, FUNC(upd1771c_device::ack_callback)); m_channel = stream_alloc(0, 1, clock() / 4); diff --git a/src/devices/sound/ymfm.cpp b/src/devices/sound/ymfm.cpp index 0bf70cea995..59c818097ae 100644 --- a/src/devices/sound/ymfm.cpp +++ b/src/devices/sound/ymfm.cpp @@ -1286,7 +1286,7 @@ void ymfm_engine_base<RegisterType>::save(device_t &device) { // allocate our timers for (int tnum = 0; tnum < 2; tnum++) - m_timer[tnum] = device.machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ymfm_engine_base::timer_handler), this)); + m_timer[tnum] = device.timer_alloc(*this, FUNC(ymfm_engine_base::timer_handler)); // resolve the IRQ handler while we're here m_irq_handler.resolve(); diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp index ec0a9d8dc96..fa9c085da27 100644 --- a/src/devices/video/315_5313.cpp +++ b/src/devices/video/315_5313.cpp @@ -369,9 +369,9 @@ void sega315_5313_device::device_start() if (m_use_alt_timing) save_pointer(NAME(m_render_line), 1280); - m_irq6_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega315_5313_device::irq6_on_timer_callback), this)); - m_irq4_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega315_5313_device::irq4_on_timer_callback), this)); - m_render_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega315_5313_device::render_scanline), this)); + m_irq6_on_timer = timer_alloc(*this, FUNC(sega315_5313_device::irq6_on_timer_callback)); + m_irq4_on_timer = timer_alloc(*this, FUNC(sega315_5313_device::irq4_on_timer_callback)); + m_render_timer = timer_alloc(*this, FUNC(sega315_5313_device::render_scanline)); m_space68k = &m_cpu68k->space(); diff --git a/src/devices/video/catseye.cpp b/src/devices/video/catseye.cpp index dba0c6ac43f..afb4b917927 100644 --- a/src/devices/video/catseye.cpp +++ b/src/devices/video/catseye.cpp @@ -70,7 +70,7 @@ void catseye_device::device_start() { m_int_write_func.resolve_safe(); - m_blink_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(catseye_device::blink_callback), this)); + m_blink_timer = timer_alloc(*this, FUNC(catseye_device::blink_callback)); m_blink_timer->adjust(attotime::from_hz(3)); save_item(NAME(m_changed)); diff --git a/src/devices/video/clgd542x.cpp b/src/devices/video/clgd542x.cpp index eff9f5473c8..b748628d9bd 100644 --- a/src/devices/video/clgd542x.cpp +++ b/src/devices/video/clgd542x.cpp @@ -91,7 +91,7 @@ void cirrus_gd5428_device::device_start() save_pointer(vga.attribute.data,"Attribute Registers", 0x15); save_item(NAME(m_chip_id)); - m_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vga_device::vblank_timer_cb),this)); + m_vblank_timer = timer_alloc(*this, FUNC(vga_device::vblank_timer_cb)); m_chip_id = 0x98; // GD5428 - Rev 0 } diff --git a/src/devices/video/dp8350.cpp b/src/devices/video/dp8350.cpp index 22e918b3374..69ae1f526ec 100644 --- a/src/devices/video/dp8350.cpp +++ b/src/devices/video/dp8350.cpp @@ -218,10 +218,10 @@ void dp835x_device::device_resolve_objects() void dp835x_device::device_start() { // create timers - m_hblank_start_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dp835x_device::hblank_start), this)); - m_hblank_near_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dp835x_device::hblank_near_end), this)); - m_hsync_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dp835x_device::hsync_update), this)); - m_hsync_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dp835x_device::hsync_update), this)); + m_hblank_start_timer = timer_alloc(*this, FUNC(dp835x_device::hblank_start)); + m_hblank_near_end_timer = timer_alloc(*this, FUNC(dp835x_device::hblank_near_end)); + m_hsync_on_timer = timer_alloc(*this, FUNC(dp835x_device::hsync_update)); + m_hsync_off_timer = timer_alloc(*this, FUNC(dp835x_device::hsync_update)); // save state save_item(NAME(m_60hz_refresh)); diff --git a/src/devices/video/epic12.cpp b/src/devices/video/epic12.cpp index e8368f8bac9..d0244c8e2d4 100644 --- a/src/devices/video/epic12.cpp +++ b/src/devices/video/epic12.cpp @@ -58,7 +58,7 @@ void epic12_device::device_start() m_ram16_copy = std::make_unique<u16[]>(m_main_ramsize / 2); - m_blitter_delay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(epic12_device::blitter_delay_callback),this)); + m_blitter_delay_timer = timer_alloc(*this, FUNC(epic12_device::blitter_delay_callback)); m_blitter_delay_timer->adjust(attotime::never); save_item(NAME(m_gfx_addr)); diff --git a/src/devices/video/gba_lcd.cpp b/src/devices/video/gba_lcd.cpp index f5df7fa01e6..b5db3868437 100644 --- a/src/devices/video/gba_lcd.cpp +++ b/src/devices/video/gba_lcd.cpp @@ -1765,8 +1765,8 @@ void gba_lcd_device::device_start() screen().register_screen_bitmap(m_bitmap); /* create a timer to fire scanline functions */ - m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_lcd_device::perform_scan),this)); - m_hbl_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_lcd_device::perform_hbl),this)); + m_scan_timer = timer_alloc(*this, FUNC(gba_lcd_device::perform_scan)); + m_hbl_timer = timer_alloc(*this, FUNC(gba_lcd_device::perform_hbl)); m_scan_timer->adjust(screen().time_until_pos(0, 0)); save_item(NAME(m_regs)); diff --git a/src/devices/video/i82730.cpp b/src/devices/video/i82730.cpp index af9209ad04e..4db6ceacdfa 100644 --- a/src/devices/video/i82730.cpp +++ b/src/devices/video/i82730.cpp @@ -81,7 +81,7 @@ void i82730_device::device_start() m_update_row_cb.resolve(); // allocate row timer - m_row_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(i82730_device::row_update), this)); + m_row_timer = timer_alloc(*this, FUNC(i82730_device::row_update)); } //------------------------------------------------- @@ -506,7 +506,7 @@ bool i82730_device::dscmd_sl_scroll_end(uint8_t param) { LOGMASKED(LOG_DATASTREAM, "Executing datastream command SL SCROLL END %d - not implemented\n", param); - return false; + return false; } bool i82730_device::dscmd_tab_to(uint8_t param) @@ -556,7 +556,7 @@ bool i82730_device::dscmd_repeat(uint8_t param) while (param--) { if (--m_dma_count && m_row_count < 200) - m_row[m_row_count++] = data; + m_row[m_row_count++] = data; else return true; } diff --git a/src/devices/video/pc_vga.cpp b/src/devices/video/pc_vga.cpp index d72899d2de2..3baaffc2bc1 100644 --- a/src/devices/video/pc_vga.cpp +++ b/src/devices/video/pc_vga.cpp @@ -351,7 +351,7 @@ void vga_device::device_start() save_item(NAME(vga.dac.color)); save_item(NAME(vga.dac.dirty)); - m_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vga_device::vblank_timer_cb),this)); + m_vblank_timer = timer_alloc(*this, FUNC(vga_device::vblank_timer_cb)); } void svga_device::device_start() diff --git a/src/devices/video/pwm.cpp b/src/devices/video/pwm.cpp index b5a4827e5f0..dc6fc87595f 100644 --- a/src/devices/video/pwm.cpp +++ b/src/devices/video/pwm.cpp @@ -89,7 +89,7 @@ void pwm_display_device::device_start() for (auto &bri : m_bri) std::fill(std::begin(bri), std::end(bri), 0.0); - m_frame_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pwm_display_device::frame_tick),this)); + m_frame_timer = timer_alloc(*this, FUNC(pwm_display_device::frame_tick)); m_update_time = machine().time(); m_rowsel = 0; diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp index 96e1e7d3ca5..e7405196be2 100644 --- a/src/devices/video/scn2674.cpp +++ b/src/devices/video/scn2674.cpp @@ -112,9 +112,9 @@ void scn2674_device::device_start() m_mbc_cb.resolve_safe(); m_mbc_char_cb.resolve(); m_mbc_attr_cb.resolve(); - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scn2674_device::scanline_timer), this)); - m_breq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scn2674_device::breq_timer), this)); - m_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scn2674_device::vblank_timer), this)); + m_scanline_timer = timer_alloc(*this, FUNC(scn2674_device::scanline_timer)); + m_breq_timer = timer_alloc(*this, FUNC(scn2674_device::breq_timer)); + m_vblank_timer = timer_alloc(*this, FUNC(scn2674_device::vblank_timer)); screen().register_screen_bitmap(m_bitmap); m_char_space = &space(0); diff --git a/src/devices/video/tms34061.cpp b/src/devices/video/tms34061.cpp index d324fe91200..65df7228fe0 100644 --- a/src/devices/video/tms34061.cpp +++ b/src/devices/video/tms34061.cpp @@ -97,7 +97,7 @@ void tms34061_device::device_start() m_regs[TMS34061_VERCOUNTER] = 0x0000; /* start vertical interrupt timer */ - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tms34061_device::interrupt), this)); + m_timer = timer_alloc(*this, FUNC(tms34061_device::interrupt)); save_item(NAME(m_regs)); save_item(NAME(m_xmask)); diff --git a/src/devices/video/topcat.cpp b/src/devices/video/topcat.cpp index 79b679b8e77..5d1b404219e 100644 --- a/src/devices/video/topcat.cpp +++ b/src/devices/video/topcat.cpp @@ -25,7 +25,7 @@ topcat_device::topcat_device(const machine_config &mconfig, const char *tag, dev void topcat_device::device_start() { m_int_write_func.resolve_safe(); - m_cursor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(topcat_device::cursor_callback), this)); + m_cursor_timer = timer_alloc(*this, FUNC(topcat_device::cursor_callback)); m_cursor_timer->adjust(attotime::from_hz(3)); save_item(NAME(m_vblank)); diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index de10bb9a471..3fdc849e2c1 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -1029,8 +1029,8 @@ void voodoo_device::init_fbi(voodoo_device* vd,fbi_state *f, void *memory, int f } /* allocate a VBLANK timer */ - f->vsync_stop_timer = vd->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(voodoo_device::vblank_off_callback), vd), vd); - f->vsync_start_timer = vd->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(voodoo_device::vblank_callback),vd), vd); + f->vsync_stop_timer = timer_alloc(*this, FUNC(voodoo_device::vblank_off_callback)); + f->vsync_start_timer = timer_alloc(*this, FUNC(voodoo_device::vblank_on_callback)); f->vblank = false; /* initialize the memory FIFO */ @@ -1509,7 +1509,7 @@ TIMER_CALLBACK_MEMBER( voodoo_device::vblank_off_callback ) } -TIMER_CALLBACK_MEMBER( voodoo_device::vblank_callback ) +TIMER_CALLBACK_MEMBER( voodoo_device::vblank_on_callback ) { if (LOG_VBLANK_SWAP) logerror("--- vblank start\n"); @@ -5749,7 +5749,7 @@ void voodoo_device::device_start() pci.fifo.size = 64*2; pci.fifo.in = pci.fifo.out = 0; pci.stall_state = NOT_STALLED; - pci.continue_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(voodoo_device::stall_cpu_callback), this), nullptr); + pci.continue_timer = timer_alloc(*this, FUNC(voodoo_device::stall_cpu_callback)); /* allocate memory */ void *fbmem, *tmumem[2]; diff --git a/src/devices/video/voodoo.h b/src/devices/video/voodoo.h index 1be7f0a1a85..8d45437db34 100644 --- a/src/devices/video/voodoo.h +++ b/src/devices/video/voodoo.h @@ -917,7 +917,7 @@ public: TIMER_CALLBACK_MEMBER( vblank_off_callback ); TIMER_CALLBACK_MEMBER( stall_cpu_callback ); - TIMER_CALLBACK_MEMBER( vblank_callback ); + TIMER_CALLBACK_MEMBER( vblank_on_callback ); void voodoo_postload(); @@ -1252,7 +1252,7 @@ protected: void check_stalled_cpu(attotime current_time); static void flush_fifos( voodoo_device* vd, attotime current_time); - static void init_fbi(voodoo_device *vd, fbi_state *f, void *memory, int fbmem); + void init_fbi(voodoo_device *vd, fbi_state *f, void *memory, int fbmem); static int32_t register_w(voodoo_device *vd, offs_t offset, uint32_t data); static int32_t swapbuffer(voodoo_device *vd, uint32_t data); static int32_t lfb_w(voodoo_device *vd, offs_t offset, uint32_t data, uint32_t mem_mask); diff --git a/src/emu/device.h b/src/emu/device.h index 620f992e953..46fd496968f 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -607,9 +607,9 @@ public: // timer interfaces emu_timer *timer_alloc(device_timer_id id = 0, void *ptr = nullptr); template<typename DeviceType, typename FuncType> - emu_timer *timer_alloc(DeviceType &device, FuncType callback, char const *name) + emu_timer *timer_alloc(DeviceType &device, FuncType callback, char const *name, void *ptr = nullptr) { - return m_scheduler->timer_alloc(timer_expired_delegate(callback, name, &device)); + return m_scheduler->timer_alloc(timer_expired_delegate(callback, name, &device), ptr); } void timer_set(const attotime &duration, device_timer_id id = 0, int param = 0); void synchronize(device_timer_id id = 0, int param = 0) { timer_set(attotime::zero, id, param); } diff --git a/src/emu/dinetwork.cpp b/src/emu/dinetwork.cpp index 6e10e28ecbd..fd1b272c834 100644 --- a/src/emu/dinetwork.cpp +++ b/src/emu/dinetwork.cpp @@ -19,8 +19,8 @@ device_network_interface::~device_network_interface() void device_network_interface::interface_pre_start() { - m_send_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_network_interface::send_complete), this)); - m_recv_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_network_interface::recv_complete), this)); + m_send_timer = interface_timer_alloc(*this, FUNC(device_network_interface::send_complete)); + m_recv_timer = interface_timer_alloc(*this, FUNC(device_network_interface::recv_complete)); } void device_network_interface::interface_post_start() diff --git a/src/emu/diserial.cpp b/src/emu/diserial.cpp index 21da108c045..0656a69dd22 100644 --- a/src/emu/diserial.cpp +++ b/src/emu/diserial.cpp @@ -68,9 +68,9 @@ device_serial_interface::~device_serial_interface() void device_serial_interface::interface_pre_start() { if (!m_rcv_clock) - m_rcv_clock = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_serial_interface::rcv_clock), this)); + m_rcv_clock = interface_timer_alloc(*this, FUNC(device_serial_interface::rcv_clock)); if (!m_tra_clock) - m_tra_clock = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_serial_interface::tra_clock), this)); + m_tra_clock = interface_timer_alloc(*this, FUNC(device_serial_interface::tra_clock)); m_rcv_clock_state = false; m_tra_clock_state = false; } diff --git a/src/emu/profiler.cpp b/src/emu/profiler.cpp index 765373e34e7..bc1a253c61a 100644 --- a/src/emu/profiler.cpp +++ b/src/emu/profiler.cpp @@ -120,7 +120,7 @@ const char *real_profiler_state::text(running_machine &machine) start(PROFILER_PROFILER); // get the current time - attotime current_time = machine.scheduler().time(); + attotime current_time = machine.time(); // we only want to update the text periodically if ((m_text_time == attotime::never) || ((current_time - m_text_time).as_double() >= TEXT_UPDATE_TIME)) diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp index 37786ac5c5c..c17363594ad 100644 --- a/src/emu/sound.cpp +++ b/src/emu/sound.cpp @@ -602,7 +602,7 @@ sound_stream::sound_stream(device_t &device, u32 inputs, u32 outputs, u32 output // create an update timer for synchronous streams if (synchronous()) - m_sync_timer = m_device.machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sound_stream::sync_update), this)); + m_sync_timer = m_device.timer_alloc(*this, FUNC(sound_stream::sync_update)); // force an update to the sample rates sample_rate_changed(); diff --git a/src/mame/audio/ad_sound.cpp b/src/mame/audio/ad_sound.cpp index 3a85470006f..72ff090f38b 100644 --- a/src/mame/audio/ad_sound.cpp +++ b/src/mame/audio/ad_sound.cpp @@ -407,7 +407,7 @@ void ad_59mc07_device::device_start() save_item(NAME(m_cymvol)); save_item(NAME(m_hihatvol)); - m_adjuster_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ad_59mc07_device::frq_adjuster_callback), this)); + m_adjuster_timer = timer_alloc(*this, FUNC(ad_59mc07_device::frq_adjuster_callback)); m_adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); } diff --git a/src/mame/audio/mw8080bw.cpp b/src/mame/audio/mw8080bw.cpp index ca5f90b22c9..86bc1dd32e5 100644 --- a/src/mame/audio/mw8080bw.cpp +++ b/src/mame/audio/mw8080bw.cpp @@ -3109,7 +3109,7 @@ void spcenctr_audio_device::device_start() m_lamp.resolve(); m_strobe.resolve(); - m_strobe_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(spcenctr_audio_device::strobe_callback), this)); + m_strobe_timer = timer_alloc(*this, FUNC(spcenctr_audio_device::strobe_callback)); m_strobe_enable = 0U; diff --git a/src/mame/audio/n8080.cpp b/src/mame/audio/n8080.cpp index c91ab9527c1..fc7b662233c 100644 --- a/src/mame/audio/n8080.cpp +++ b/src/mame/audio/n8080.cpp @@ -382,9 +382,9 @@ void spacefev_state::sound_start() { n8080_state::sound_start(); - m_sound_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(spacefev_state::stop_mono_flop_callback), this)); - m_sound_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(spacefev_state::stop_mono_flop_callback), this)); - m_sound_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(spacefev_state::stop_mono_flop_callback), this)); + m_sound_timer[0] = timer_alloc(*this, FUNC(spacefev_state::stop_mono_flop_callback)); + m_sound_timer[1] = timer_alloc(*this, FUNC(spacefev_state::stop_mono_flop_callback)); + m_sound_timer[2] = timer_alloc(*this, FUNC(spacefev_state::stop_mono_flop_callback)); save_item(NAME(m_prev_snd_data)); save_item(NAME(m_prev_sound_pins)); @@ -410,8 +410,8 @@ void sheriff_state::sound_start() { n8080_state::sound_start(); - m_sound_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sheriff_state::stop_mono_flop_callback), this)); - m_sound_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sheriff_state::stop_mono_flop_callback), this)); + m_sound_timer[0] = timer_alloc(*this, FUNC(sheriff_state::stop_mono_flop_callback)); + m_sound_timer[1] = timer_alloc(*this, FUNC(sheriff_state::stop_mono_flop_callback)); save_item(NAME(m_prev_snd_data)); save_item(NAME(m_prev_sound_pins)); diff --git a/src/mame/audio/namco52.cpp b/src/mame/audio/namco52.cpp index 15d5d08ff5d..4dc50788e6e 100644 --- a/src/mame/audio/namco52.cpp +++ b/src/mame/audio/namco52.cpp @@ -168,7 +168,7 @@ void namco_52xx_device::device_start() /* start the external clock */ if (m_extclock != 0) { - m_extclock_pulse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namco_52xx_device::external_clock_pulse), this)); + m_extclock_pulse_timer = timer_alloc(*this, FUNC(namco_52xx_device::external_clock_pulse)); m_extclock_pulse_timer->adjust(attotime(0, m_extclock), 0, attotime(0, m_extclock)); } diff --git a/src/mame/audio/redalert.cpp b/src/mame/audio/redalert.cpp index a104dc3e6e7..b83990fcf63 100644 --- a/src/mame/audio/redalert.cpp +++ b/src/mame/audio/redalert.cpp @@ -159,8 +159,8 @@ void redalert_state::panther_audio_map(address_map &map) void redalert_state::sound_start() { - m_audio_irq_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(redalert_state::audio_irq_on), this)); - m_audio_irq_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(redalert_state::audio_irq_off), this)); + m_audio_irq_on_timer = timer_alloc(*this, FUNC(redalert_state::audio_irq_on)); + m_audio_irq_off_timer = timer_alloc(*this, FUNC(redalert_state::audio_irq_off)); m_audio_irq_on_timer->adjust(REDALERT_AUDIO_CPU_IRQ_FREQ, 0, REDALERT_AUDIO_CPU_IRQ_FREQ); diff --git a/src/mame/audio/segag80r.cpp b/src/mame/audio/segag80r.cpp index 32088ede5a4..83c9aef0074 100644 --- a/src/mame/audio/segag80r.cpp +++ b/src/mame/audio/segag80r.cpp @@ -48,7 +48,7 @@ void sega005_sound_device::device_start() m_sega005_stream = stream_alloc(0, 1, SEGA005_COUNTER_FREQ); /* create a timer for the 555 */ - m_sega005_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega005_sound_device::sega005_auto_timer), this)); + m_sega005_sound_timer = timer_alloc(*this, FUNC(sega005_sound_device::sega005_auto_timer)); /* set the initial sound data */ state->m_sound_data = 0x00; diff --git a/src/mame/audio/segaspeech.cpp b/src/mame/audio/segaspeech.cpp index a7013b7a3d0..926805653b3 100644 --- a/src/mame/audio/segaspeech.cpp +++ b/src/mame/audio/segaspeech.cpp @@ -76,7 +76,7 @@ READ_LINE_MEMBER( sega_speech_device::t0_r ) READ_LINE_MEMBER( sega_speech_device::t1_r ) { -//printf("%s: t1_r=%d\n", machine().scheduler().time().as_string(), m_drq); +//printf("%s: t1_r=%d\n", machine().time().as_string(), m_drq); return m_drq; } @@ -111,7 +111,7 @@ void sega_speech_device::p2_w(uint8_t data) WRITE_LINE_MEMBER(sega_speech_device::drq_w) { -//printf("%s: DRQ=%d\n", machine().scheduler().time().as_string(), state); +//printf("%s: DRQ=%d\n", machine().time().as_string(), state); m_drq = (state == ASSERT_LINE); } diff --git a/src/mame/audio/segausb.cpp b/src/mame/audio/segausb.cpp index ada0358fde2..787a23db4ea 100644 --- a/src/mame/audio/segausb.cpp +++ b/src/mame/audio/segausb.cpp @@ -628,7 +628,7 @@ void usb_sound_device::workram_w(offs_t offset, u8 data) case 0x02: // 8253 U41 case 0x03: // 8253 U41 if ((offset & 3) != 3) - printf("%s: 2.%d count=%d\n", machine().scheduler().time().as_string(), offset & 3, data); + printf("%s: 2.%d count=%d\n", machine().time().as_string(), offset & 3, data); m_pit[0]->write(offset & 3, data); break; @@ -647,7 +647,7 @@ void usb_sound_device::workram_w(offs_t offset, u8 data) case 0x0a: // 8253 U42 case 0x0b: // 8253 U42 if ((offset & 3) != 3) - printf("%s: 2.%d count=%d\n", machine().scheduler().time().as_string(), offset & 3, data); + printf("%s: 2.%d count=%d\n", machine().time().as_string(), offset & 3, data); m_pit[1]->write(offset & 3, data); break; @@ -666,7 +666,7 @@ void usb_sound_device::workram_w(offs_t offset, u8 data) case 0x12: // 8253 U43 case 0x13: // 8253 U43 if ((offset & 3) != 3) - printf("%s: 2.%d count=%d\n", machine().scheduler().time().as_string(), offset & 3, data); + printf("%s: 2.%d count=%d\n", machine().time().as_string(), offset & 3, data); m_pit[2]->write(offset & 3, data); break; diff --git a/src/mame/drivers/aces1.cpp b/src/mame/drivers/aces1.cpp index 618e0a62971..89ecef4ed67 100644 --- a/src/mame/drivers/aces1.cpp +++ b/src/mame/drivers/aces1.cpp @@ -263,8 +263,8 @@ void aces1_state::machine_start() m_reel_clock[reel] =0; m_reel_phase[reel] =0; } - m_aces1_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aces1_state::m_aces1_irq_timer_callback),this), nullptr); - m_aces1_nmi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aces1_state::m_aces1_nmi_timer_callback),this), nullptr); + m_aces1_irq_timer = timer_alloc(*this, FUNC(aces1_state::m_aces1_irq_timer_callback)); + m_aces1_nmi_timer = timer_alloc(*this, FUNC(aces1_state::m_aces1_nmi_timer_callback)); m_digits.resolve(); m_lamps.resolve(); diff --git a/src/mame/drivers/alpha68k_n.cpp b/src/mame/drivers/alpha68k_n.cpp index 4d000571333..499faccc164 100644 --- a/src/mame/drivers/alpha68k_n.cpp +++ b/src/mame/drivers/alpha68k_n.cpp @@ -1023,7 +1023,7 @@ void sstingray_state::init_sstingry() m_coin_id = 0x22 | (0x22 << 8); m_game_id = 0; - m_alpha8511_sync_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sstingray_state::alpha8511_sync), this)); + m_alpha8511_sync_timer = timer_alloc(*this, FUNC(sstingray_state::alpha8511_sync)); save_item(NAME(m_alpha8511_address)); save_item(NAME(m_alpha8511_control)); save_item(NAME(m_alpha8511_read_mode)); diff --git a/src/mame/drivers/amico2k.cpp b/src/mame/drivers/amico2k.cpp index d6518c21966..c4174225205 100644 --- a/src/mame/drivers/amico2k.cpp +++ b/src/mame/drivers/amico2k.cpp @@ -208,7 +208,7 @@ void amico2k_state::ppi_pb_w(uint8_t data) void amico2k_state::machine_start() { m_digits.resolve(); - m_led_refresh_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(amico2k_state::led_refresh),this)); + m_led_refresh_timer = timer_alloc(*this, FUNC(amico2k_state::led_refresh)); // state saving save_item(NAME(m_ls145_p)); diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index 4a28f17e2bb..a13e5343392 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -144,8 +144,8 @@ protected: virtual void device_start() override { // allocate resources - m_c813_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a1000_kbreset_device::c813_charged), this)); - m_c814_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a1000_kbreset_device::c814_charged), this)); + m_c813_timer = timer_alloc(*this, FUNC(a1000_kbreset_device::c813_charged)); + m_c814_timer = timer_alloc(*this, FUNC(a1000_kbreset_device::c814_charged)); // start in idle state m_kbclk = 1U; diff --git a/src/mame/drivers/apple1.cpp b/src/mame/drivers/apple1.cpp index cdc46753200..525e2cffcc4 100644 --- a/src/mame/drivers/apple1.cpp +++ b/src/mame/drivers/apple1.cpp @@ -389,9 +389,9 @@ void apple1_state::machine_start() m_reset_down = m_clear_down = false; - m_ready_start_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(apple1_state::ready_start_cb), this)); - m_ready_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(apple1_state::ready_end_cb), this)); - m_kbd_strobe_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(apple1_state::keyboard_strobe_cb), this)); + m_ready_start_timer = timer_alloc(*this, FUNC(apple1_state::ready_start_cb)); + m_ready_end_timer = timer_alloc(*this, FUNC(apple1_state::ready_end_cb)); + m_kbd_strobe_timer = timer_alloc(*this, FUNC(apple1_state::keyboard_strobe_cb)); // setup save states save_item(NAME(m_vram)); diff --git a/src/mame/drivers/aristmk5.cpp b/src/mame/drivers/aristmk5.cpp index e18864ab221..41a151f809d 100644 --- a/src/mame/drivers/aristmk5.cpp +++ b/src/mame/drivers/aristmk5.cpp @@ -2237,9 +2237,9 @@ void aristmk5_state::machine_start() archimedes_init(); m_coin_start_cycles = 0ULL; - m_mk5_2KHz_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aristmk5_state::mk5_2KHz_callback),this)); - m_mk5_VSYNC_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aristmk5_state::mk5_VSYNC_callback),this)); - m_spi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aristmk5_state::spi_timer), this)); + m_mk5_2KHz_timer = timer_alloc(*this, FUNC(aristmk5_state::mk5_2KHz_callback)); + m_mk5_VSYNC_timer = timer_alloc(*this, FUNC(aristmk5_state::mk5_VSYNC_callback)); + m_spi_timer = timer_alloc(*this, FUNC(aristmk5_state::spi_timer)); m_lamps.resolve(); } diff --git a/src/mame/drivers/atetris.cpp b/src/mame/drivers/atetris.cpp index 45389415fc1..71c330b1f61 100644 --- a/src/mame/drivers/atetris.cpp +++ b/src/mame/drivers/atetris.cpp @@ -105,7 +105,7 @@ void atetris_state::machine_start() m_slapstic_bank->configure_entries(2, 2, m_slapstic_region, 0x4000); /* Allocate interrupt timer */ - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(atetris_state::interrupt_gen),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(atetris_state::interrupt_gen)); } diff --git a/src/mame/drivers/aviion88k.cpp b/src/mame/drivers/aviion88k.cpp index 38315cea858..27ca6d32888 100644 --- a/src/mame/drivers/aviion88k.cpp +++ b/src/mame/drivers/aviion88k.cpp @@ -134,7 +134,7 @@ void aviion88k_state::machine_start() m_leds.resolve(); for (emu_timer *&pit : m_pit) - pit = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aviion88k_state::pit_timer), this)); + pit = timer_alloc(*this, FUNC(aviion88k_state::pit_timer)); } void aviion88k_state::machine_reset() diff --git a/src/mame/drivers/beaminv.cpp b/src/mame/drivers/beaminv.cpp index 91b9e7b664d..a873f00e031 100644 --- a/src/mame/drivers/beaminv.cpp +++ b/src/mame/drivers/beaminv.cpp @@ -134,7 +134,7 @@ TIMER_CALLBACK_MEMBER(beaminv_state::interrupt_callback) void beaminv_state::create_interrupt_timer() { - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(beaminv_state::interrupt_callback),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(beaminv_state::interrupt_callback)); } diff --git a/src/mame/drivers/berzerk.cpp b/src/mame/drivers/berzerk.cpp index 6d45d41f3aa..db7167a76c8 100644 --- a/src/mame/drivers/berzerk.cpp +++ b/src/mame/drivers/berzerk.cpp @@ -249,7 +249,7 @@ TIMER_CALLBACK_MEMBER(berzerk_state::irq_callback) void berzerk_state::create_irq_timer() { - m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(berzerk_state::irq_callback),this)); + m_irq_timer = timer_alloc(*this, FUNC(berzerk_state::irq_callback)); } @@ -326,7 +326,7 @@ TIMER_CALLBACK_MEMBER(berzerk_state::nmi_callback) void berzerk_state::create_nmi_timer() { - m_nmi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(berzerk_state::nmi_callback),this)); + m_nmi_timer = timer_alloc(*this, FUNC(berzerk_state::nmi_callback)); } diff --git a/src/mame/drivers/beta.cpp b/src/mame/drivers/beta.cpp index 4639ec0fcde..9d83c526136 100644 --- a/src/mame/drivers/beta.cpp +++ b/src/mame/drivers/beta.cpp @@ -320,7 +320,7 @@ void beta_state::machine_start() m_digits.resolve(); m_leds.resolve(); - m_led_refresh_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(beta_state::led_refresh),this)); + m_led_refresh_timer = timer_alloc(*this, FUNC(beta_state::led_refresh)); m_eprom_rom.resize(0x800); diff --git a/src/mame/drivers/bfcobra.cpp b/src/mame/drivers/bfcobra.cpp index 23cf5758cd5..673645108e7 100644 --- a/src/mame/drivers/bfcobra.cpp +++ b/src/mame/drivers/bfcobra.cpp @@ -1841,7 +1841,7 @@ void bfcobjam_state::init_bfcobjam() membank("bank2")->set_base(memregion("user1")->base()+0x08000); membank("bank3")->set_base(memregion("user1")->base()+0x0c000); - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bfcobjam_state::scanline_callback),this)); + m_scanline_timer = timer_alloc(*this, FUNC(bfcobjam_state::scanline_callback)); /* Finish this */ save_item(NAME(m_data_r)); diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp index 15049995141..42fbef5b262 100644 --- a/src/mame/drivers/cave.cpp +++ b/src/mame/drivers/cave.cpp @@ -2017,7 +2017,7 @@ GFXDECODE_END void cave_state::machine_start() { m_led_outputs.resolve(); - m_vblank_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cave_state::vblank_end), this)); + m_vblank_end_timer = timer_alloc(*this, FUNC(cave_state::vblank_end)); save_item(NAME(m_soundbuf_wptr)); save_item(NAME(m_soundbuf_rptr)); diff --git a/src/mame/drivers/ccastles.cpp b/src/mame/drivers/ccastles.cpp index b6c2b02f545..7300b4b3010 100644 --- a/src/mame/drivers/ccastles.cpp +++ b/src/mame/drivers/ccastles.cpp @@ -215,7 +215,7 @@ void ccastles_state::machine_start() membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0xa000, 0x6000); /* create a timer for IRQs and set up the first callback */ - m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ccastles_state::clock_irq),this)); + m_irq_timer = timer_alloc(*this, FUNC(ccastles_state::clock_irq)); m_irq_state = 0; schedule_next_irq(0); diff --git a/src/mame/drivers/cgang.cpp b/src/mame/drivers/cgang.cpp index 851f021bf4e..4a40bded2f2 100644 --- a/src/mame/drivers/cgang.cpp +++ b/src/mame/drivers/cgang.cpp @@ -203,7 +203,7 @@ private: void cgang_state::machine_start() { for (int i = 0; i < 5; i++) - m_sol_filter[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cgang_state::output_sol),this)); + m_sol_filter[i] = timer_alloc(*this, FUNC(cgang_state::output_sol)); // resolve outputs m_gun_lamps.resolve(); diff --git a/src/mame/drivers/clayshoo.cpp b/src/mame/drivers/clayshoo.cpp index 3af7ad14ed8..7ed8ebdde78 100644 --- a/src/mame/drivers/clayshoo.cpp +++ b/src/mame/drivers/clayshoo.cpp @@ -153,8 +153,8 @@ uint8_t clayshoo_state::analog_r() void clayshoo_state::create_analog_timers( ) { - m_analog_timer_1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(clayshoo_state::reset_analog_bit),this)); - m_analog_timer_2 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(clayshoo_state::reset_analog_bit),this)); + m_analog_timer_1 = timer_alloc(*this, FUNC(clayshoo_state::reset_analog_bit)); + m_analog_timer_2 = timer_alloc(*this, FUNC(clayshoo_state::reset_analog_bit)); } diff --git a/src/mame/drivers/cliffhgr.cpp b/src/mame/drivers/cliffhgr.cpp index 339866ab13c..d52a57ff9a3 100644 --- a/src/mame/drivers/cliffhgr.cpp +++ b/src/mame/drivers/cliffhgr.cpp @@ -235,7 +235,7 @@ TIMER_CALLBACK_MEMBER(cliffhgr_state::irq_callback) void cliffhgr_state::machine_start() { m_led.resolve(); - m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cliffhgr_state::irq_callback),this)); + m_irq_timer = timer_alloc(*this, FUNC(cliffhgr_state::irq_callback)); save_item(NAME(m_port_bank)); save_item(NAME(m_philips_code)); diff --git a/src/mame/drivers/cloud9.cpp b/src/mame/drivers/cloud9.cpp index fb28a5eca59..4e73a45443e 100644 --- a/src/mame/drivers/cloud9.cpp +++ b/src/mame/drivers/cloud9.cpp @@ -183,7 +183,7 @@ void cloud9_state::machine_start() m_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL); /* create a timer for IRQs and set up the first callback */ - m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cloud9_state::clock_irq),this)); + m_irq_timer = timer_alloc(*this, FUNC(cloud9_state::clock_irq)); m_irq_state = 0; schedule_next_irq(0-64); diff --git a/src/mame/drivers/coleco.cpp b/src/mame/drivers/coleco.cpp index 325a27836e9..cbb2043b177 100644 --- a/src/mame/drivers/coleco.cpp +++ b/src/mame/drivers/coleco.cpp @@ -505,9 +505,9 @@ void coleco_state::machine_start() // init paddles for (int port = 0; port < 2; port++) { - m_joy_pulse_timer[port] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(coleco_state::paddle_pulse_callback),this)); - m_joy_d7_timer[port] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(coleco_state::paddle_d7reset_callback),this)); - m_joy_irq_timer[port] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(coleco_state::paddle_irqreset_callback),this)); + m_joy_pulse_timer[port] = timer_alloc(*this, FUNC(coleco_state::paddle_pulse_callback)); + m_joy_d7_timer[port] = timer_alloc(*this, FUNC(coleco_state::paddle_d7reset_callback)); + m_joy_irq_timer[port] = timer_alloc(*this, FUNC(coleco_state::paddle_irqreset_callback)); m_joy_irq_state[port] = 0; m_joy_d7_state[port] = 0; diff --git a/src/mame/drivers/combatsc.cpp b/src/mame/drivers/combatsc.cpp index 8e9c21df0fa..9956962bc92 100644 --- a/src/mame/drivers/combatsc.cpp +++ b/src/mame/drivers/combatsc.cpp @@ -651,7 +651,7 @@ MACHINE_START_MEMBER(combatsc_state,combatsc) m_page[0] = MEM + 0x4000; m_page[1] = MEM + 0x6000; - m_interleave_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); + m_interleave_timer = timer_alloc(); membank("bank1")->configure_entries(0, 10, memregion("maincpu")->base() + 0x10000, 0x4000); diff --git a/src/mame/drivers/cops.cpp b/src/mame/drivers/cops.cpp index 52d4d37d927..aaff00e225d 100644 --- a/src/mame/drivers/cops.cpp +++ b/src/mame/drivers/cops.cpp @@ -876,7 +876,7 @@ INPUT_PORTS_END void cops_state::machine_start() { - m_ld_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cops_state::ld_timer_callback),this)); + m_ld_timer = timer_alloc(*this, FUNC(cops_state::ld_timer_callback)); m_ld_timer->adjust(attotime::from_hz(167*5), 0, attotime::from_hz(167*5)); diff --git a/src/mame/drivers/cps2.cpp b/src/mame/drivers/cps2.cpp index 200f5736051..16afccf0386 100644 --- a/src/mame/drivers/cps2.cpp +++ b/src/mame/drivers/cps2.cpp @@ -10107,7 +10107,7 @@ void cps2_state::init_digital_volume() m_cps2disabledigitalvolume = 0; // create a timer to update our volume state from the fake switches - read it every 6 frames or so to enable some granularity - m_digital_volume_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cps2_state::cps2_update_digital_volume), this)); + m_digital_volume_timer = timer_alloc(*this, FUNC(cps2_state::cps2_update_digital_volume)); m_digital_volume_timer->adjust(attotime::from_msec(100), 0, attotime::from_msec(100)); } diff --git a/src/mame/drivers/cvs.cpp b/src/mame/drivers/cvs.cpp index b792caffdb4..c1d16416846 100644 --- a/src/mame/drivers/cvs.cpp +++ b/src/mame/drivers/cvs.cpp @@ -296,7 +296,7 @@ TIMER_CALLBACK_MEMBER(cvs_state::cvs_393hz_timer_cb) void cvs_state::start_393hz_timer() { - m_cvs_393hz_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cvs_state::cvs_393hz_timer_cb),this)); + m_cvs_393hz_timer = timer_alloc(*this, FUNC(cvs_state::cvs_393hz_timer_cb)); m_cvs_393hz_timer->adjust(attotime::from_hz(30*393), 0, attotime::from_hz(30*393)); } diff --git a/src/mame/drivers/cxhumax.cpp b/src/mame/drivers/cxhumax.cpp index a7d9f7c9054..9b0805a66e6 100644 --- a/src/mame/drivers/cxhumax.cpp +++ b/src/mame/drivers/cxhumax.cpp @@ -986,7 +986,7 @@ void cxhumax_state::machine_start() int index = 0; for(index = 0; index < MAX_CX_TIMERS; index++) { - m_timer_regs.timer[index].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cxhumax_state::timer_tick),this)); + m_timer_regs.timer[index].timer = timer_alloc(*this, FUNC(cxhumax_state::timer_tick)); m_timer_regs.timer[index].timer->adjust(attotime::never, index); } } diff --git a/src/mame/drivers/eispc.cpp b/src/mame/drivers/eispc.cpp index 4ec53e01520..29e5b130688 100644 --- a/src/mame/drivers/eispc.cpp +++ b/src/mame/drivers/eispc.cpp @@ -527,7 +527,7 @@ void epc_state::machine_reset() void epc_state::init_epc() { /* Keyboard UART Rxc/Txc is 19.2 kHz from x960 divider */ - m_kbdclk_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(epc_state::rxtxclk_w), this)); + m_kbdclk_timer = timer_alloc(*this, FUNC(epc_state::rxtxclk_w)); m_kbdclk_timer->adjust(attotime::from_hz(XTAL(18'432'000) / 960) / 2); } diff --git a/src/mame/drivers/enigma2.cpp b/src/mame/drivers/enigma2.cpp index 53350bda7d3..b828b25c53d 100644 --- a/src/mame/drivers/enigma2.cpp +++ b/src/mame/drivers/enigma2.cpp @@ -274,8 +274,8 @@ TIMER_CALLBACK_MEMBER(enigma2_state::interrupt_assert_callback) void enigma2_state::create_interrupt_timers( ) { - m_interrupt_clear_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(enigma2_state::interrupt_clear_callback),this)); - m_interrupt_assert_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(enigma2_state::interrupt_assert_callback),this)); + m_interrupt_clear_timer = timer_alloc(*this, FUNC(enigma2_state::interrupt_clear_callback)); + m_interrupt_assert_timer = timer_alloc(*this, FUNC(enigma2_state::interrupt_assert_callback)); } diff --git a/src/mame/drivers/famibox.cpp b/src/mame/drivers/famibox.cpp index daafda79f57..1c104c2a33e 100644 --- a/src/mame/drivers/famibox.cpp +++ b/src/mame/drivers/famibox.cpp @@ -519,8 +519,8 @@ void famibox_state::machine_start() famicombox_bankswitch(0); - m_attract_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(famibox_state::famicombox_attract_timer_callback),this)); - m_gameplay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(famibox_state::famicombox_gameplay_timer_callback),this)); + m_attract_timer = timer_alloc(*this, FUNC(famibox_state::famicombox_attract_timer_callback)); + m_gameplay_timer = timer_alloc(*this, FUNC(famibox_state::famicombox_gameplay_timer_callback)); m_exception_cause = 0xff; m_exception_mask = 0; m_attract_timer_period = 0; diff --git a/src/mame/drivers/firebeat.cpp b/src/mame/drivers/firebeat.cpp index 13d5b465a71..01412e12a1f 100644 --- a/src/mame/drivers/firebeat.cpp +++ b/src/mame/drivers/firebeat.cpp @@ -1215,7 +1215,7 @@ WRITE_LINE_MEMBER(firebeat_state::sound_irq_callback) void firebeat_spu_state::machine_start() { firebeat_state::machine_start(); - m_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(firebeat_spu_state::spu_dma_callback), this)); + m_dma_timer = timer_alloc(*this, FUNC(firebeat_spu_state::spu_dma_callback)); } void firebeat_spu_state::machine_reset() @@ -1813,7 +1813,7 @@ void firebeat_kbm_state::init_kbm_overseas() void firebeat_kbm_state::init_keyboard() { // set keyboard timer -// m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(firebeat_state::keyboard_timer_callback),this)); +// m_keyboard_timer = timer_alloc(*this, FUNC(firebeat_state::keyboard_timer_callback)); // m_keyboard_timer->adjust(attotime::from_msec(10), 0, attotime::from_msec(10)); } diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp index ad71655bb60..766ad8f3bdb 100644 --- a/src/mame/drivers/fm7.cpp +++ b/src/mame/drivers/fm7.cpp @@ -1723,10 +1723,10 @@ void fm7_state::init_fm7() { // m_shared_ram = std::make_unique<uint8_t[]>(0x80); m_video_ram = make_unique_clear<uint8_t[]>(0x18000); // 2 pages on some systems - m_beeper_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::beeper_off), this)); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::timer_irq), this)); - m_subtimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::subtimer_irq), this)); - m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::keyboard_poll), this)); + m_beeper_off_timer = timer_alloc(*this, FUNC(fm7_state::beeper_off)); + m_timer = timer_alloc(*this, FUNC(fm7_state::timer_irq)); + m_subtimer = timer_alloc(*this, FUNC(fm7_state::subtimer_irq)); + m_keyboard_timer = timer_alloc(*this, FUNC(fm7_state::keyboard_poll)); m_init_rom_en = false; } @@ -1746,9 +1746,9 @@ MACHINE_START_MEMBER(fm7_state,fm7) MACHINE_START_MEMBER(fm77_state,fm77av) { - m_encoder_ack_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm77_state::av_encoder_ack), this)); - m_alu_task_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm77_state::av_alu_task_end), this)); - m_vsync_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm77_state::av_vsync), this)); + m_encoder_ack_timer = timer_alloc(*this, FUNC(fm77_state::av_encoder_ack)); + m_alu_task_end_timer = timer_alloc(*this, FUNC(fm77_state::av_alu_task_end)); + m_vsync_timer = timer_alloc(*this, FUNC(fm77_state::av_vsync)); memset(m_shared_ram,0xff,0x80); @@ -1765,9 +1765,9 @@ MACHINE_START_MEMBER(fm77_state,fm77av) MACHINE_START_MEMBER(fm11_state,fm11) { - m_encoder_ack_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm11_state::av_encoder_ack), this)); - m_alu_task_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm11_state::av_alu_task_end), this)); - m_vsync_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm11_state::av_vsync), this)); + m_encoder_ack_timer = timer_alloc(*this, FUNC(fm11_state::av_encoder_ack)); + m_alu_task_end_timer = timer_alloc(*this, FUNC(fm11_state::av_alu_task_end)); + m_vsync_timer = timer_alloc(*this, FUNC(fm11_state::av_vsync)); memset(m_shared_ram,0xff,0x80); m_type = SYS_FM11; diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp index 7281ac33ef1..c09209a9ac3 100644 --- a/src/mame/drivers/fmtowns.cpp +++ b/src/mame/drivers/fmtowns.cpp @@ -2740,7 +2740,7 @@ void towns_state::driver_start() memset(&m_towns_cd,0,sizeof(struct towns_cdrom_controller)); m_towns_cd.status = 0x01; // CDROM controller ready m_towns_cd.buffer_ptr = -1; - m_towns_cd.read_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(towns_state::towns_cdrom_read_byte),this), (void*)m_dma_1.target()); + m_towns_cd.read_timer = timer_alloc(*this, FUNC(towns_state::towns_cdrom_read_byte), (void*)m_dma_1.target()); save_pointer(m_video.towns_crtc_reg,"CRTC registers",32); save_pointer(m_video.towns_video_reg,"Video registers",2); diff --git a/src/mame/drivers/fp6000.cpp b/src/mame/drivers/fp6000.cpp index 51bec4e9682..4856efe3f61 100644 --- a/src/mame/drivers/fp6000.cpp +++ b/src/mame/drivers/fp6000.cpp @@ -439,7 +439,7 @@ void fp6000_state::pit_timer2_w(int state) void fp6000_state::machine_start() { - m_pit_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fp6000_state::pit_timer0_clear), this)); + m_pit_timer = timer_alloc(*this, FUNC(fp6000_state::pit_timer0_clear)); } void fp6000_state::machine_reset() diff --git a/src/mame/drivers/fs3216.cpp b/src/mame/drivers/fs3216.cpp index 905037f069d..caac49a4dc7 100644 --- a/src/mame/drivers/fs3216.cpp +++ b/src/mame/drivers/fs3216.cpp @@ -119,7 +119,7 @@ void fs3216_state::machine_start() m_fdc_select = 0; m_fdc_dma_count = 0; - m_fdc_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fs3216_state::fdc_dma), this)); + m_fdc_dma_timer = timer_alloc(*this, FUNC(fs3216_state::fdc_dma)); save_item(NAME(m_mmu_reg)); save_item(NAME(m_from_reset)); diff --git a/src/mame/drivers/galaga.cpp b/src/mame/drivers/galaga.cpp index 5f90d0a126c..51850a866a1 100644 --- a/src/mame/drivers/galaga.cpp +++ b/src/mame/drivers/galaga.cpp @@ -827,7 +827,7 @@ void galaga_state::machine_start() { m_leds.resolve(); /* create the interrupt timer */ - m_cpu3_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(galaga_state::cpu3_interrupt_callback),this)); + m_cpu3_interrupt_timer = timer_alloc(*this, FUNC(galaga_state::cpu3_interrupt_callback)); save_item(NAME(m_main_irq_mask)); save_item(NAME(m_sub_irq_mask)); save_item(NAME(m_sub2_nmi_mask)); diff --git a/src/mame/drivers/gamate.cpp b/src/mame/drivers/gamate.cpp index 607e3f6704b..769e2e3a542 100644 --- a/src/mame/drivers/gamate.cpp +++ b/src/mame/drivers/gamate.cpp @@ -147,8 +147,8 @@ INPUT_PORTS_END void gamate_state::init_gamate() { - timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamate_state::gamate_timer),this)); - timer2 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamate_state::gamate_timer2),this)); + timer1 = timer_alloc(*this, FUNC(gamate_state::gamate_timer)); + timer2 = timer_alloc(*this, FUNC(gamate_state::gamate_timer2)); } void gamate_state::machine_start() diff --git a/src/mame/drivers/gameking.cpp b/src/mame/drivers/gameking.cpp index 8d398756c38..06edc65b7dc 100644 --- a/src/mame/drivers/gameking.cpp +++ b/src/mame/drivers/gameking.cpp @@ -234,8 +234,8 @@ uint32_t gameking_state::screen_update_gameking3(screen_device& screen, bitmap_r void gameking_state::init_gameking() { - timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gameking_state::gameking_timer), this)); - timer2 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gameking_state::gameking_timer2), this)); + timer1 = timer_alloc(*this, FUNC(gameking_state::gameking_timer)); + timer2 = timer_alloc(*this, FUNC(gameking_state::gameking_timer2)); } TIMER_CALLBACK_MEMBER(gameking_state::gameking_timer) diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp index e2fc3927e64..500dcba3ca1 100644 --- a/src/mame/drivers/gba.cpp +++ b/src/mame/drivers/gba.cpp @@ -1305,27 +1305,27 @@ void gba_state::machine_reset() void gba_state::machine_start() { /* and one for each DMA channel */ - m_dma_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::dma_complete),this)); - m_dma_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::dma_complete),this)); - m_dma_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::dma_complete),this)); - m_dma_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::dma_complete),this)); + m_dma_timer[0] = timer_alloc(*this, FUNC(gba_state::dma_complete)); + m_dma_timer[1] = timer_alloc(*this, FUNC(gba_state::dma_complete)); + m_dma_timer[2] = timer_alloc(*this, FUNC(gba_state::dma_complete)); + m_dma_timer[3] = timer_alloc(*this, FUNC(gba_state::dma_complete)); m_dma_timer[0]->adjust(attotime::never); m_dma_timer[1]->adjust(attotime::never, 1); m_dma_timer[2]->adjust(attotime::never, 2); m_dma_timer[3]->adjust(attotime::never, 3); /* also one for each timer (heh) */ - m_tmr_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::timer_expire),this)); - m_tmr_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::timer_expire),this)); - m_tmr_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::timer_expire),this)); - m_tmr_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::timer_expire),this)); + m_tmr_timer[0] = timer_alloc(*this, FUNC(gba_state::timer_expire)); + m_tmr_timer[1] = timer_alloc(*this, FUNC(gba_state::timer_expire)); + m_tmr_timer[2] = timer_alloc(*this, FUNC(gba_state::timer_expire)); + m_tmr_timer[3] = timer_alloc(*this, FUNC(gba_state::timer_expire)); m_tmr_timer[0]->adjust(attotime::never); m_tmr_timer[1]->adjust(attotime::never, 1); m_tmr_timer[2]->adjust(attotime::never, 2); m_tmr_timer[3]->adjust(attotime::never, 3); /* and an IRQ handling timer */ - m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::handle_irq),this)); + m_irq_timer = timer_alloc(*this, FUNC(gba_state::handle_irq)); m_irq_timer->adjust(attotime::never); // install the cart ROM & SRAM into the address map, if present diff --git a/src/mame/drivers/gijoe.cpp b/src/mame/drivers/gijoe.cpp index 9097877a9f6..71ecb9a46a4 100644 --- a/src/mame/drivers/gijoe.cpp +++ b/src/mame/drivers/gijoe.cpp @@ -281,7 +281,7 @@ INPUT_PORTS_END void gijoe_state::machine_start() { - m_dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gijoe_state::dmaend_callback),this)); + m_dmadelay_timer = timer_alloc(*this, FUNC(gijoe_state::dmaend_callback)); save_item(NAME(m_cur_control2)); } diff --git a/src/mame/drivers/gp32.cpp b/src/mame/drivers/gp32.cpp index 120093ef053..895a5157512 100644 --- a/src/mame/drivers/gp32.cpp +++ b/src/mame/drivers/gp32.cpp @@ -1606,18 +1606,18 @@ void gp32_state::s3c240x_mmc_w(offs_t offset, uint32_t data, uint32_t mem_mask) void gp32_state::s3c240x_machine_start() { - m_s3c240x_pwm_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)0); - m_s3c240x_pwm_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)1); - m_s3c240x_pwm_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)2); - m_s3c240x_pwm_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)3); - m_s3c240x_pwm_timer[4] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)4); - m_s3c240x_dma_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(uintptr_t)0); - m_s3c240x_dma_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(uintptr_t)1); - m_s3c240x_dma_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(uintptr_t)2); - m_s3c240x_dma_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(uintptr_t)3); - m_s3c240x_iic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iic_timer_exp),this), (void *)(uintptr_t)0); - m_s3c240x_iis_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iis_timer_exp),this), (void *)(uintptr_t)0); - m_s3c240x_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_lcd_timer_exp),this), (void *)(uintptr_t)0); + m_s3c240x_pwm_timer[0] = timer_alloc(*this, FUNC(gp32_state::s3c240x_pwm_timer_exp), (void *)(uintptr_t)0); + m_s3c240x_pwm_timer[1] = timer_alloc(*this, FUNC(gp32_state::s3c240x_pwm_timer_exp), (void *)(uintptr_t)1); + m_s3c240x_pwm_timer[2] = timer_alloc(*this, FUNC(gp32_state::s3c240x_pwm_timer_exp), (void *)(uintptr_t)2); + m_s3c240x_pwm_timer[3] = timer_alloc(*this, FUNC(gp32_state::s3c240x_pwm_timer_exp), (void *)(uintptr_t)3); + m_s3c240x_pwm_timer[4] = timer_alloc(*this, FUNC(gp32_state::s3c240x_pwm_timer_exp), (void *)(uintptr_t)4); + m_s3c240x_dma_timer[0] = timer_alloc(*this, FUNC(gp32_state::s3c240x_dma_timer_exp), (void *)(uintptr_t)0); + m_s3c240x_dma_timer[1] = timer_alloc(*this, FUNC(gp32_state::s3c240x_dma_timer_exp), (void *)(uintptr_t)1); + m_s3c240x_dma_timer[2] = timer_alloc(*this, FUNC(gp32_state::s3c240x_dma_timer_exp), (void *)(uintptr_t)2); + m_s3c240x_dma_timer[3] = timer_alloc(*this, FUNC(gp32_state::s3c240x_dma_timer_exp), (void *)(uintptr_t)3); + m_s3c240x_iic_timer = timer_alloc(*this, FUNC(gp32_state::s3c240x_iic_timer_exp), (void *)(uintptr_t)0); + m_s3c240x_iis_timer = timer_alloc(*this, FUNC(gp32_state::s3c240x_iis_timer_exp), (void *)(uintptr_t)0); + m_s3c240x_lcd_timer = timer_alloc(*this, FUNC(gp32_state::s3c240x_lcd_timer_exp), (void *)(uintptr_t)0); m_eeprom_data = std::make_unique<uint8_t[]>(0x2000); // a dump of the EEPROM (S524AB0X91) resulted to be 0x1000 m_nvram->set_base(m_eeprom_data.get(), 0x2000); smc_init(); diff --git a/src/mame/drivers/gridlee.cpp b/src/mame/drivers/gridlee.cpp index e2c7413dbff..f1fb08a9662 100644 --- a/src/mame/drivers/gridlee.cpp +++ b/src/mame/drivers/gridlee.cpp @@ -146,10 +146,10 @@ void gridlee_state::machine_start() save_item(NAME(m_last_analog_input)); save_item(NAME(m_last_analog_output)); - m_irq_off = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gridlee_state::irq_off_tick),this)); - m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gridlee_state::irq_timer_tick),this)); - m_firq_off = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gridlee_state::firq_off_tick),this)); - m_firq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gridlee_state::firq_timer_tick),this)); + m_irq_off = timer_alloc(*this, FUNC(gridlee_state::irq_off_tick)); + m_irq_timer = timer_alloc(*this, FUNC(gridlee_state::irq_timer_tick)); + m_firq_off = timer_alloc(*this, FUNC(gridlee_state::firq_off_tick)); + m_firq_timer = timer_alloc(*this, FUNC(gridlee_state::firq_timer_tick)); } diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp index ddeeaf2f38e..bf8a16aeb49 100644 --- a/src/mame/drivers/gticlub.cpp +++ b/src/mame/drivers/gticlub.cpp @@ -530,7 +530,7 @@ void gticlub_state::machine_start() /* configure fast RAM regions for DRC */ m_maincpu->ppcdrc_add_fastram(0x00000000, 0x000fffff, false, m_work_ram); - m_sound_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gticlub_state::sound_irq), this)); + m_sound_irq_timer = timer_alloc(*this, FUNC(gticlub_state::sound_irq)); } void gticlub_state::gticlub_map(address_map &map) diff --git a/src/mame/drivers/gunpey.cpp b/src/mame/drivers/gunpey.cpp index e3fa57afd90..4ad2939be14 100644 --- a/src/mame/drivers/gunpey.cpp +++ b/src/mame/drivers/gunpey.cpp @@ -324,7 +324,7 @@ void gunpey_state::video_start() m_blit_buffer = std::make_unique<uint16_t[]>(512*512); m_vram = std::make_unique<uint8_t[]>(0x400000); std::fill_n(&m_vram[0], 0x400000, 0xff); - m_blitter_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gunpey_state::blitter_end), this)); + m_blitter_end_timer = timer_alloc(*this, FUNC(gunpey_state::blitter_end)); save_pointer(NAME(m_vram), 0x400000); } diff --git a/src/mame/drivers/h01x.cpp b/src/mame/drivers/h01x.cpp index 6680a803a77..95379d001d5 100644 --- a/src/mame/drivers/h01x.cpp +++ b/src/mame/drivers/h01x.cpp @@ -376,7 +376,7 @@ INPUT_PORTS_END void h01x_state::machine_start() { - m_cassette_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(h01x_state::cassette_data_callback), this)); + m_cassette_data_timer = timer_alloc(*this, FUNC(h01x_state::cassette_data_callback)); m_cassette_data_timer->adjust(attotime::zero, 0, attotime::from_hz(11025)); } diff --git a/src/mame/drivers/halleys.cpp b/src/mame/drivers/halleys.cpp index 3eaa92e4af7..5a4a02dd5d9 100644 --- a/src/mame/drivers/halleys.cpp +++ b/src/mame/drivers/halleys.cpp @@ -2248,7 +2248,7 @@ void halleys_state::init_benberob() init_common(); - m_blitter_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(halleys_state::blitter_reset),this)); + m_blitter_reset_timer = timer_alloc(*this, FUNC(halleys_state::blitter_reset)); } diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index 8af7d653f19..9dcec1c8549 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -153,7 +153,7 @@ void hh_sm510_state::machine_start() } // 1kHz display decay ticks - m_display_decay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hh_sm510_state::display_decay_tick),this)); + m_display_decay_timer = timer_alloc(*this, FUNC(hh_sm510_state::display_decay_tick)); m_display_decay_timer->adjust(attotime::from_hz(1024), 0, attotime::from_hz(1024)); // zerofill diff --git a/src/mame/drivers/hng64.cpp b/src/mame/drivers/hng64.cpp index 2598f38de5c..aeb33bf35d8 100644 --- a/src/mame/drivers/hng64.cpp +++ b/src/mame/drivers/hng64.cpp @@ -2047,8 +2047,8 @@ void hng64_state::machine_start() m_irq_pending = 0; - m_3dfifo_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hng64_state::hng64_3dfifo_processed), this)); - m_comhack_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hng64_state::comhack_callback), this)); + m_3dfifo_timer = timer_alloc(*this, FUNC(hng64_state::hng64_3dfifo_processed)); + m_comhack_timer = timer_alloc(*this, FUNC(hng64_state::comhack_callback)); init_io(); } @@ -2365,8 +2365,8 @@ TIMER_CALLBACK_MEMBER(hng64_state::tempio_irqoff_callback) void hng64_state::init_io() { - m_tempio_irqon_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hng64_state::tempio_irqon_callback), this)); - m_tempio_irqoff_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hng64_state::tempio_irqoff_callback), this)); + m_tempio_irqon_timer = timer_alloc(*this, FUNC(hng64_state::tempio_irqon_callback)); + m_tempio_irqoff_timer = timer_alloc(*this, FUNC(hng64_state::tempio_irqoff_callback)); m_port7 = 0x00; m_port1 = 0x00; diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp index 127f4c0322a..3cdddc77721 100644 --- a/src/mame/drivers/hornet.cpp +++ b/src/mame/drivers/hornet.cpp @@ -1101,7 +1101,7 @@ void hornet_state::machine_start() save_pointer(NAME(m_jvs_sdata), 1024); save_item(NAME(m_jvs_sdata_ptr)); - m_sound_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hornet_state::sound_irq), this)); + m_sound_irq_timer = timer_alloc(*this, FUNC(hornet_state::sound_irq)); } void hornet_state::machine_reset() diff --git a/src/mame/drivers/hp9k_3xx.cpp b/src/mame/drivers/hp9k_3xx.cpp index 16185c7338f..2d69eea409b 100644 --- a/src/mame/drivers/hp9k_3xx.cpp +++ b/src/mame/drivers/hp9k_3xx.cpp @@ -233,7 +233,7 @@ void hp9k3xx_state::machine_reset() void hp9k3xx_state::machine_start() { - m_bus_error_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp9k3xx_state::bus_error_timeout), this)); + m_bus_error_timer = timer_alloc(*this, FUNC(hp9k3xx_state::bus_error_timeout)); m_bus_error = false; save_item(NAME(m_bus_error)); } diff --git a/src/mame/drivers/hyprduel.cpp b/src/mame/drivers/hyprduel.cpp index 64707e3469d..9192465f60d 100644 --- a/src/mame/drivers/hyprduel.cpp +++ b/src/mame/drivers/hyprduel.cpp @@ -399,7 +399,7 @@ void hyprduel_state::machine_start() save_item(NAME(m_subcpu_resetline)); save_item(NAME(m_cpu_trigger)); - m_vblank_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hyprduel_state::vblank_end_callback), this)); + m_vblank_end_timer = timer_alloc(*this, FUNC(hyprduel_state::vblank_end_callback)); } void hyprduel_state::i4220_config(machine_config &config) diff --git a/src/mame/drivers/intellec4.cpp b/src/mame/drivers/intellec4.cpp index 2362381aa41..c70e8e2f978 100644 --- a/src/mame/drivers/intellec4.cpp +++ b/src/mame/drivers/intellec4.cpp @@ -639,7 +639,7 @@ INPUT_CHANGED_MEMBER(intellec4_state::sw_do_enable) void intellec4_state::driver_start() { - m_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(intellec4_state::reset_expired), this)); + m_reset_timer = timer_alloc(*this, FUNC(intellec4_state::reset_expired)); m_led_address.resolve(); m_led_instruction.resolve(); @@ -1170,7 +1170,7 @@ void mod4_state::driver_start() m_led_status_cpu.resolve(); - m_one_shot_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mod4_state::one_shot_expired), this)); + m_one_shot_timer = timer_alloc(*this, FUNC(mod4_state::one_shot_expired)); save_item(NAME(m_one_shot)); @@ -1400,7 +1400,7 @@ void mod40_state::driver_start() m_led_status_run.resolve(); - m_single_step_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mod40_state::single_step_expired), this)); + m_single_step_timer = timer_alloc(*this, FUNC(mod40_state::single_step_expired)); save_item(NAME(m_stp_ack)); save_item(NAME(m_single_step)); diff --git a/src/mame/drivers/irisha.cpp b/src/mame/drivers/irisha.cpp index 0a51a6b624e..34d56e747ac 100644 --- a/src/mame/drivers/irisha.cpp +++ b/src/mame/drivers/irisha.cpp @@ -355,7 +355,7 @@ uint8_t irisha_state::keyboard_r() void irisha_state::machine_start() { - m_key_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(irisha_state::irisha_key),this)); + m_key_timer = timer_alloc(*this, FUNC(irisha_state::irisha_key)); m_key_timer->adjust(attotime::from_msec(30), 0, attotime::from_msec(30)); save_item(NAME(m_sg1_line)); save_item(NAME(m_keypressed)); diff --git a/src/mame/drivers/jangou.cpp b/src/mame/drivers/jangou.cpp index 3cb350b349d..e81fc17f07c 100644 --- a/src/mame/drivers/jangou.cpp +++ b/src/mame/drivers/jangou.cpp @@ -914,7 +914,7 @@ void jangou_state::machine_start() save_item(NAME(m_cvsd_shift_cnt)); /* Create a timer to feed the CVSD DAC with sample bits */ - m_cvsd_bit_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jangou_state::cvsd_bit_timer_callback), this)); + m_cvsd_bit_timer = timer_alloc(*this, FUNC(jangou_state::cvsd_bit_timer_callback)); m_cvsd_bit_timer->adjust(attotime::from_hz(MASTER_CLOCK / 1024), 0, attotime::from_hz(MASTER_CLOCK / 1024)); } diff --git a/src/mame/drivers/jedi.cpp b/src/mame/drivers/jedi.cpp index a6c35a061d5..e5677680929 100644 --- a/src/mame/drivers/jedi.cpp +++ b/src/mame/drivers/jedi.cpp @@ -158,7 +158,7 @@ void jedi_state::main_irq_ack_w(u8 data) void jedi_state::machine_start() { /* set a timer to run the interrupts */ - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jedi_state::generate_interrupt),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(jedi_state::generate_interrupt)); m_interrupt_timer->adjust(m_screen->time_until_pos(32), 32); /* configure the banks */ diff --git a/src/mame/drivers/jpmsys5.cpp b/src/mame/drivers/jpmsys5.cpp index a37e0ebe4d9..3876b3e7b75 100644 --- a/src/mame/drivers/jpmsys5.cpp +++ b/src/mame/drivers/jpmsys5.cpp @@ -734,7 +734,7 @@ void jpmsys5v_state::machine_start() m_rombank->configure_entries(0, 32, memregion("maincpu")->base() + 0x20000, 0x20000); m_rombank->set_entry(0); - m_touch_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jpmsys5v_state::touch_cb),this)); + m_touch_timer = timer_alloc(*this, FUNC(jpmsys5v_state::touch_cb)); } void jpmsys5v_state::machine_reset() diff --git a/src/mame/drivers/jr100.cpp b/src/mame/drivers/jr100.cpp index 0f1342e4fdf..60fca57d9f5 100644 --- a/src/mame/drivers/jr100.cpp +++ b/src/mame/drivers/jr100.cpp @@ -206,7 +206,7 @@ INPUT_PORTS_END void jr100_state::machine_start() { if (!m_sound_timer) - m_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jr100_state::sound_tick), this)); + m_sound_timer = timer_alloc(*this, FUNC(jr100_state::sound_tick)); save_item(NAME(m_keyboard_line)); save_item(NAME(m_use_pcg)); diff --git a/src/mame/drivers/jr200.cpp b/src/mame/drivers/jr200.cpp index eabbbd154b4..73e5da184ea 100644 --- a/src/mame/drivers/jr200.cpp +++ b/src/mame/drivers/jr200.cpp @@ -520,7 +520,7 @@ GFXDECODE_END void jr200_state::machine_start() { - m_timer_d = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jr200_state::timer_d_callback),this)); + m_timer_d = timer_alloc(*this, FUNC(jr200_state::timer_d_callback)); } void jr200_state::machine_reset() diff --git a/src/mame/drivers/konamigx.cpp b/src/mame/drivers/konamigx.cpp index f13259a6a93..f6e9ce37a55 100644 --- a/src/mame/drivers/konamigx.cpp +++ b/src/mame/drivers/konamigx.cpp @@ -3890,8 +3890,8 @@ void konamigx_state::init_konamigx() m_esc_cb = nullptr; m_resume_trigger = 0; - m_dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(konamigx_state::dmaend_callback),this)); - m_boothack_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(konamigx_state::boothack_callback),this)); + m_dmadelay_timer = timer_alloc(*this, FUNC(konamigx_state::dmaend_callback)); + m_boothack_timer = timer_alloc(*this, FUNC(konamigx_state::boothack_callback)); int i = 0, match = 0, readback = 0; while ((gameDefs[i].cfgport != 0xff) && (!match)) diff --git a/src/mame/drivers/m10.cpp b/src/mame/drivers/m10.cpp index 05b90831b70..8b256aced02 100644 --- a/src/mame/drivers/m10.cpp +++ b/src/mame/drivers/m10.cpp @@ -162,7 +162,7 @@ void m1x_state::palette(palette_device &palette) const void m1x_state::machine_start() { - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m1x_state::interrupt_callback), this)); + m_interrupt_timer = timer_alloc(*this, FUNC(m1x_state::interrupt_callback)); save_item(NAME(m_flip)); save_item(NAME(m_last)); diff --git a/src/mame/drivers/m79152pc.cpp b/src/mame/drivers/m79152pc.cpp index 2f05839a30c..d27b6631423 100644 --- a/src/mame/drivers/m79152pc.cpp +++ b/src/mame/drivers/m79152pc.cpp @@ -246,8 +246,8 @@ void m79152pc_state::machine_start() m_line_count = 0; m_hsync = false; - m_hsync_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m79152pc_state::hsync_on), this)); - m_hsync_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m79152pc_state::hsync_off), this)); + m_hsync_on_timer = timer_alloc(*this, FUNC(m79152pc_state::hsync_on)); + m_hsync_off_timer = timer_alloc(*this, FUNC(m79152pc_state::hsync_off)); m_hsync_off_timer->adjust(m_screen->time_until_pos(9, 0), 0, m_screen->scan_period()); save_item(NAME(m_latch_full)); diff --git a/src/mame/drivers/mac128.cpp b/src/mame/drivers/mac128.cpp index 6a981cb3ae0..b71a14681dc 100644 --- a/src/mame/drivers/mac128.cpp +++ b/src/mame/drivers/mac128.cpp @@ -271,8 +271,8 @@ void mac128_state::machine_start() m_ram_mask = m_ram_size - 1; m_rom_ptr = (u16*)memregion("bootrom")->base(); - m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac128_state::mac_scanline), this)); - m_hblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac128_state::mac_hblank), this)); + m_scan_timer = timer_alloc(*this, FUNC(mac128_state::mac_scanline)); + m_hblank_timer = timer_alloc(*this, FUNC(mac128_state::mac_hblank)); save_item(NAME(m_overlay)); save_item(NAME(m_irq_count)); diff --git a/src/mame/drivers/macprtb.cpp b/src/mame/drivers/macprtb.cpp index ed539694429..c88aa88f06b 100644 --- a/src/mame/drivers/macprtb.cpp +++ b/src/mame/drivers/macprtb.cpp @@ -285,7 +285,7 @@ void macportable_state::machine_start() m_pmu_ack = m_pmu_req = 0; m_adb_line = 1; - m_6015_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(macportable_state::mac_6015_tick),this)); + m_6015_timer = timer_alloc(*this, FUNC(macportable_state::mac_6015_tick)); m_6015_timer->adjust(attotime::never); } diff --git a/src/mame/drivers/macpwrbk030.cpp b/src/mame/drivers/macpwrbk030.cpp index f18ad6d5ce3..e23a247deb4 100644 --- a/src/mame/drivers/macpwrbk030.cpp +++ b/src/mame/drivers/macpwrbk030.cpp @@ -330,7 +330,7 @@ void macpb030_state::machine_start() m_last_taken_interrupt = -1; m_irq_count = m_ca1_data = m_ca2_data = 0; - m_6015_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(macpb030_state::mac_6015_tick),this)); + m_6015_timer = timer_alloc(*this, FUNC(macpb030_state::mac_6015_tick)); m_6015_timer->adjust(attotime::never); } diff --git a/src/mame/drivers/macquadra700.cpp b/src/mame/drivers/macquadra700.cpp index 2c373fbbaf6..5d1a90a05e4 100644 --- a/src/mame/drivers/macquadra700.cpp +++ b/src/mame/drivers/macquadra700.cpp @@ -248,7 +248,7 @@ void macquadra_state::machine_start() m_last_taken_interrupt = -1; m_irq_count = m_ca2_data = 0; - m_6015_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(macquadra_state::mac_6015_tick),this)); + m_6015_timer = timer_alloc(*this, FUNC(macquadra_state::mac_6015_tick)); m_6015_timer->adjust(attotime::never); } @@ -352,8 +352,8 @@ TIMER_CALLBACK_MEMBER(macquadra_state::dafb_cursor_tick) void macquadra_state::video_start() // DAFB { - m_vbl_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(macquadra_state::dafb_vbl_tick),this)); - m_cursor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(macquadra_state::dafb_cursor_tick),this)); + m_vbl_timer = timer_alloc(*this, FUNC(macquadra_state::dafb_vbl_tick)); + m_cursor_timer = timer_alloc(*this, FUNC(macquadra_state::dafb_cursor_tick)); m_vbl_timer->adjust(attotime::never); m_cursor_timer->adjust(attotime::never); diff --git a/src/mame/drivers/magmax.cpp b/src/mame/drivers/magmax.cpp index 2d9c8051ec8..cd262eb36b0 100644 --- a/src/mame/drivers/magmax.cpp +++ b/src/mame/drivers/magmax.cpp @@ -69,7 +69,7 @@ TIMER_CALLBACK_MEMBER(magmax_state::scanline_callback) void magmax_state::machine_start() { /* Create interrupt timer */ - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(magmax_state::scanline_callback),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(magmax_state::scanline_callback)); /* Set up save state */ save_item(NAME(m_sound_latch)); diff --git a/src/mame/drivers/mappy.cpp b/src/mame/drivers/mappy.cpp index bd4a0b76f8c..e1735de7cd0 100644 --- a/src/mame/drivers/mappy.cpp +++ b/src/mame/drivers/mappy.cpp @@ -1306,8 +1306,8 @@ void mappy_state::machine_start() { m_leds.resolve(); - m_namcoio_run_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mappy_state::namcoio_run_timer<0>), this)); - m_namcoio_run_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mappy_state::namcoio_run_timer<1>), this)); + m_namcoio_run_timer[0] = timer_alloc(*this, FUNC(mappy_state::namcoio_run_timer<0>)); + m_namcoio_run_timer[1] = timer_alloc(*this, FUNC(mappy_state::namcoio_run_timer<1>)); save_item(NAME(m_main_irq_mask)); save_item(NAME(m_sub_irq_mask)); diff --git a/src/mame/drivers/mc1502.cpp b/src/mame/drivers/mc1502.cpp index 3c91623c04c..200a7b3316e 100644 --- a/src/mame/drivers/mc1502.cpp +++ b/src/mame/drivers/mc1502.cpp @@ -191,7 +191,7 @@ void mc1502_state::machine_start() m_pic8259->ir1_w(1); memset(&m_kbd, 0, sizeof(m_kbd)); m_kbd.keyb_signal_timer = - machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc1502_state::keyb_signal_callback), this)); + timer_alloc(*this, FUNC(mc1502_state::keyb_signal_callback)); m_kbd.keyb_signal_timer->adjust(attotime::from_msec(20), 0, attotime::from_msec(20)); } diff --git a/src/mame/drivers/mdisk.cpp b/src/mame/drivers/mdisk.cpp index cfda2eb1090..109b8db63ce 100644 --- a/src/mame/drivers/mdisk.cpp +++ b/src/mame/drivers/mdisk.cpp @@ -130,7 +130,7 @@ void mdisk_state::fdc_side_w(uint8_t data) void mdisk_state::machine_start() { // timer to switch rom to ram - m_rom_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mdisk_state::rom_timer_callback), this), nullptr); + m_rom_timer = timer_alloc(*this, FUNC(mdisk_state::rom_timer_callback)); // register for save states save_item(NAME(m_uart1_rxrdy)); diff --git a/src/mame/drivers/mdt60.cpp b/src/mame/drivers/mdt60.cpp index 45623589d4f..d7f5d599031 100644 --- a/src/mame/drivers/mdt60.cpp +++ b/src/mame/drivers/mdt60.cpp @@ -75,7 +75,7 @@ private: void mdt60_state::machine_start() { - m_baud_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mdt60_state::baud_timer), this)); + m_baud_timer = timer_alloc(*this, FUNC(mdt60_state::baud_timer)); m_baud_timer->adjust(attotime::zero); save_item(NAME(m_keyin)); diff --git a/src/mame/drivers/megadriv.cpp b/src/mame/drivers/megadriv.cpp index 54134a63f9b..f6db3605840 100644 --- a/src/mame/drivers/megadriv.cpp +++ b/src/mame/drivers/megadriv.cpp @@ -287,7 +287,7 @@ void md_cons_state::machine_start() // setup timers for 6 button pads for (int i = 0; i < 3; i++) - m_io_timeout[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(md_base_state::io_timeout_timer_callback),this), (void*)(uintptr_t)i); + m_io_timeout[i] = timer_alloc(*this, FUNC(md_base_state::io_timeout_timer_callback), (void*)(uintptr_t)i); m_vdp->stop_timers(); diff --git a/src/mame/drivers/megadriv_acbl.cpp b/src/mame/drivers/megadriv_acbl.cpp index f9e07c1f919..0656eb657a1 100644 --- a/src/mame/drivers/megadriv_acbl.cpp +++ b/src/mame/drivers/megadriv_acbl.cpp @@ -955,7 +955,7 @@ void md_boot_6button_state::machine_start() // Setup timers for 6 button pads for (int i = 0; i < 3; i++) - m_io_timeout[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(md_base_state::io_timeout_timer_callback),this), (void*)(uintptr_t)i); + m_io_timeout[i] = timer_alloc(*this, FUNC(md_base_state::io_timeout_timer_callback), (void*)(uintptr_t)i); } void md_boot_6button_state::megadrvb_6b(machine_config &config) diff --git a/src/mame/drivers/megadriv_rad.cpp b/src/mame/drivers/megadriv_rad.cpp index 6d56d1812c1..7ee8829f61e 100644 --- a/src/mame/drivers/megadriv_rad.cpp +++ b/src/mame/drivers/megadriv_rad.cpp @@ -363,7 +363,7 @@ void megadriv_radica_6button_state::machine_start() // setup timers for 6 button pads for (int i = 0; i < 3; i++) - m_io_timeout[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(md_base_state::io_timeout_timer_callback),this), (void*)(uintptr_t)i); + m_io_timeout[i] = timer_alloc(*this, FUNC(md_base_state::io_timeout_timer_callback), (void*)(uintptr_t)i); save_item(NAME(m_bank)); } @@ -395,7 +395,7 @@ void megadriv_ra145_state::machine_start() // setup timers for 6 button pads for (int i = 0; i < 3; i++) - m_io_timeout[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(md_base_state::io_timeout_timer_callback),this), (void*)(uintptr_t)i); + m_io_timeout[i] = timer_alloc(*this, FUNC(md_base_state::io_timeout_timer_callback), (void*)(uintptr_t)i); m_a1630a = 0; save_item(NAME(m_a1630a)); diff --git a/src/mame/drivers/meritum.cpp b/src/mame/drivers/meritum.cpp index c16a2514999..fcb277ff136 100644 --- a/src/mame/drivers/meritum.cpp +++ b/src/mame/drivers/meritum.cpp @@ -370,7 +370,7 @@ u8 meritum_state::keyboard_r(offs_t offset) void meritum_state::machine_start() { - m_cassette_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(meritum_state::cassette_data_callback),this)); + m_cassette_data_timer = timer_alloc(*this, FUNC(meritum_state::cassette_data_callback)); m_cassette_data_timer->adjust( attotime::zero, 0, attotime::from_hz(11025) ); save_item(NAME(m_mode)); save_item(NAME(m_size_store)); diff --git a/src/mame/drivers/microterm_f8.cpp b/src/mame/drivers/microterm_f8.cpp index da4d83cd617..718ebd26291 100644 --- a/src/mame/drivers/microterm_f8.cpp +++ b/src/mame/drivers/microterm_f8.cpp @@ -93,7 +93,7 @@ void microterm_f8_state::machine_start() m_attrlatch = 0; m_vram = make_unique_clear<u16[]>(0x800); // 6x MM2114 with weird addressing - m_baud_clock = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(microterm_f8_state::baud_clock), this)); + m_baud_clock = timer_alloc(*this, FUNC(microterm_f8_state::baud_clock)); m_baud_clock->adjust(attotime::zero, 0); save_item(NAME(m_port00)); diff --git a/src/mame/drivers/midzeus.cpp b/src/mame/drivers/midzeus.cpp index 65425549b96..1750eeba373 100644 --- a/src/mame/drivers/midzeus.cpp +++ b/src/mame/drivers/midzeus.cpp @@ -137,13 +137,13 @@ void midzeus_state::machine_start() { m_digits.resolve(); - m_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate()); - m_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate()); + m_timer[0] = timer_alloc(); + m_timer[1] = timer_alloc(); - m_gun_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midzeus_state::invasn_gun_callback), this)); - m_gun_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midzeus_state::invasn_gun_callback), this)); + m_gun_timer[0] = timer_alloc(*this, FUNC(midzeus_state::invasn_gun_callback)); + m_gun_timer[1] = timer_alloc(*this, FUNC(midzeus_state::invasn_gun_callback)); - m_display_irq_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midzeus_state::display_irq_off), this)); + m_display_irq_off_timer = timer_alloc(*this, FUNC(midzeus_state::display_irq_off)); save_item(NAME(m_crusnexo_leds_select)); save_item(NAME(m_disk_asic_jr)); diff --git a/src/mame/drivers/missile.cpp b/src/mame/drivers/missile.cpp index 857f69f810e..1e8e62fc780 100644 --- a/src/mame/drivers/missile.cpp +++ b/src/mame/drivers/missile.cpp @@ -551,11 +551,11 @@ void missile_state::machine_start() m_ctrld = 0; /* create a timer to speed/slow the CPU */ - m_cpu_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(missile_state::adjust_cpu_speed),this)); + m_cpu_timer = timer_alloc(*this, FUNC(missile_state::adjust_cpu_speed)); m_cpu_timer->adjust(m_screen->time_until_pos(v_to_scanline(0), 0)); /* create a timer for IRQs and set up the first callback */ - m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(missile_state::clock_irq),this)); + m_irq_timer = timer_alloc(*this, FUNC(missile_state::clock_irq)); m_irq_state = 0; schedule_next_irq(-32); diff --git a/src/mame/drivers/model3.cpp b/src/mame/drivers/model3.cpp index f0521a5309e..911f70f85f4 100644 --- a/src/mame/drivers/model3.cpp +++ b/src/mame/drivers/model3.cpp @@ -1325,33 +1325,33 @@ MACHINE_START_MEMBER(model3_state,model3_10) { configure_fast_ram(); - m_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_sound_timer_tick),this)); - m_real3d_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::real3d_dma_timer_callback),this)); - m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_scan_timer_tick),this)); + m_sound_timer = timer_alloc(*this, FUNC(model3_state::model3_sound_timer_tick)); + m_real3d_dma_timer = timer_alloc(*this, FUNC(model3_state::real3d_dma_timer_callback)); + m_scan_timer = timer_alloc(*this, FUNC(model3_state::model3_scan_timer_tick)); } MACHINE_START_MEMBER(model3_state,model3_15) { configure_fast_ram(); - m_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_sound_timer_tick),this)); - m_real3d_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::real3d_dma_timer_callback),this)); - m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_scan_timer_tick),this)); + m_sound_timer = timer_alloc(*this, FUNC(model3_state::model3_sound_timer_tick)); + m_real3d_dma_timer = timer_alloc(*this, FUNC(model3_state::real3d_dma_timer_callback)); + m_scan_timer = timer_alloc(*this, FUNC(model3_state::model3_scan_timer_tick)); } MACHINE_START_MEMBER(model3_state,model3_20) { configure_fast_ram(); - m_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_sound_timer_tick),this)); - m_real3d_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::real3d_dma_timer_callback),this)); - m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_scan_timer_tick),this)); + m_sound_timer = timer_alloc(*this, FUNC(model3_state::model3_sound_timer_tick)); + m_real3d_dma_timer = timer_alloc(*this, FUNC(model3_state::real3d_dma_timer_callback)); + m_scan_timer = timer_alloc(*this, FUNC(model3_state::model3_scan_timer_tick)); } MACHINE_START_MEMBER(model3_state,model3_21) { configure_fast_ram(); - m_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_sound_timer_tick),this)); - m_real3d_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::real3d_dma_timer_callback),this)); - m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_scan_timer_tick),this)); + m_sound_timer = timer_alloc(*this, FUNC(model3_state::model3_sound_timer_tick)); + m_real3d_dma_timer = timer_alloc(*this, FUNC(model3_state::real3d_dma_timer_callback)); + m_scan_timer = timer_alloc(*this, FUNC(model3_state::model3_scan_timer_tick)); } void model3_state::model3_init(int step) diff --git a/src/mame/drivers/moo.cpp b/src/mame/drivers/moo.cpp index 0b2ba53e513..cc97172057a 100644 --- a/src/mame/drivers/moo.cpp +++ b/src/mame/drivers/moo.cpp @@ -473,7 +473,7 @@ MACHINE_START_MEMBER(moo_state,moo) save_item(NAME(m_layerpri)); save_item(NAME(m_protram)); - m_dmaend_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(moo_state::dmaend_callback),this)); + m_dmaend_timer = timer_alloc(*this, FUNC(moo_state::dmaend_callback)); } MACHINE_RESET_MEMBER(moo_state,moo) diff --git a/src/mame/drivers/mpf1.cpp b/src/mame/drivers/mpf1.cpp index ee1192aeff5..1c9a8378ee7 100644 --- a/src/mame/drivers/mpf1.cpp +++ b/src/mame/drivers/mpf1.cpp @@ -338,7 +338,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(mpf1_state::check_halt_callback) void mpf1_state::machine_start() { - m_led_refresh_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mpf1_state::led_refresh),this)); + m_led_refresh_timer = timer_alloc(*this, FUNC(mpf1_state::led_refresh)); m_digits.resolve(); m_leds.resolve(); diff --git a/src/mame/drivers/mpu3.cpp b/src/mame/drivers/mpu3.cpp index 79b301e6b08..eea6108f4a3 100644 --- a/src/mame/drivers/mpu3.cpp +++ b/src/mame/drivers/mpu3.cpp @@ -726,7 +726,7 @@ INPUT_PORTS_END /* Common configurations */ void mpu3_state::machine_start() { - m_ic21_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mpu3_state::ic21_timeout),this)); + m_ic21_timer = timer_alloc(*this, FUNC(mpu3_state::ic21_timeout)); m_triac.resolve(); m_digit.resolve(); diff --git a/src/mame/drivers/mw8080bw.cpp b/src/mame/drivers/mw8080bw.cpp index c1ff1682ae3..7d54095c433 100644 --- a/src/mame/drivers/mw8080bw.cpp +++ b/src/mame/drivers/mw8080bw.cpp @@ -886,7 +886,7 @@ MACHINE_START_MEMBER(mw8080bw_state,maze) mw8080bw_state::machine_start(); /* create astable timer for IC B1 */ - m_maze_tone_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mw8080bw_state::maze_tone_timing_timer_callback), this)); + m_maze_tone_timer = timer_alloc(*this, FUNC(mw8080bw_state::maze_tone_timing_timer_callback)); m_maze_tone_timer->adjust(MAZE_555_B1_PERIOD, 0, MAZE_555_B1_PERIOD); /* initialize state of Tone Timing FF, IC C1 */ diff --git a/src/mame/drivers/namcofl.cpp b/src/mame/drivers/namcofl.cpp index d9a8e8b3a2a..98490ca2514 100644 --- a/src/mame/drivers/namcofl.cpp +++ b/src/mame/drivers/namcofl.cpp @@ -498,9 +498,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(namcofl_state::mcu_irq2_cb) void namcofl_state::machine_start() { - m_raster_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcofl_state::raster_interrupt_callback),this)); - m_network_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcofl_state::network_interrupt_callback),this)); - m_vblank_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcofl_state::vblank_interrupt_callback),this)); + m_raster_interrupt_timer = timer_alloc(*this, FUNC(namcofl_state::raster_interrupt_callback)); + m_network_interrupt_timer = timer_alloc(*this, FUNC(namcofl_state::network_interrupt_callback)); + m_vblank_interrupt_timer = timer_alloc(*this, FUNC(namcofl_state::vblank_interrupt_callback)); } diff --git a/src/mame/drivers/namcos23.cpp b/src/mame/drivers/namcos23.cpp index 12d30f9fe01..afc63036f21 100644 --- a/src/mame/drivers/namcos23.cpp +++ b/src/mame/drivers/namcos23.cpp @@ -3503,7 +3503,7 @@ void namcos23_state::machine_start() { m_lamps.resolve(); - m_c361.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcos23_state::c361_timer_cb),this)); + m_c361.timer = timer_alloc(*this, FUNC(namcos23_state::c361_timer_cb)); m_c361.timer->adjust(attotime::never); m_maincpu->add_fastram(0, m_mainram.bytes()-1, false, reinterpret_cast<uint32_t *>(memshare("mainram")->ptr())); diff --git a/src/mame/drivers/nc.cpp b/src/mame/drivers/nc.cpp index 28b3a06ac85..6b1ccacb0cd 100644 --- a/src/mame/drivers/nc.cpp +++ b/src/mame/drivers/nc.cpp @@ -1124,7 +1124,7 @@ void nc_state::machine_start() m_card_size = 0; /* keyboard timer */ - m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nc_state::nc_keyboard_timer_callback),this)); + m_keyboard_timer = timer_alloc(*this, FUNC(nc_state::nc_keyboard_timer_callback)); m_keyboard_timer->adjust(attotime::from_msec(10)); m_nvram->set_base(m_ram->pointer(), m_ram->size()); diff --git a/src/mame/drivers/nds.cpp b/src/mame/drivers/nds.cpp index da6acaaa177..da347de1fdb 100644 --- a/src/mame/drivers/nds.cpp +++ b/src/mame/drivers/nds.cpp @@ -647,14 +647,14 @@ void nds_state::machine_start() for (i = 0; i < 8; i++) { - m_dma_timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nds_state::dma_complete),this)); + m_dma_timer[i] = timer_alloc(*this, FUNC(nds_state::dma_complete)); m_dma_timer[i]->adjust(attotime::never, i); - m_tmr_timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nds_state::timer_expire),this)); + m_tmr_timer[i] = timer_alloc(*this, FUNC(nds_state::timer_expire)); m_tmr_timer[i]->adjust(attotime::never, i); } - m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nds_state::handle_irq),this)); + m_irq_timer = timer_alloc(*this, FUNC(nds_state::handle_irq)); m_irq_timer->adjust(attotime::never); } diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp index f8aaaa12a66..f4ea90ec8fa 100644 --- a/src/mame/drivers/neogeo.cpp +++ b/src/mame/drivers/neogeo.cpp @@ -860,9 +860,9 @@ TIMER_CALLBACK_MEMBER(neogeo_base_state::vblank_interrupt_callback) void neogeo_base_state::create_interrupt_timers() { - m_display_position_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_base_state::display_position_interrupt_callback),this)); - m_display_position_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_base_state::display_position_vblank_callback),this)); - m_vblank_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_base_state::vblank_interrupt_callback),this)); + m_display_position_interrupt_timer = timer_alloc(*this, FUNC(neogeo_base_state::display_position_interrupt_callback)); + m_display_position_vblank_timer = timer_alloc(*this, FUNC(neogeo_base_state::display_position_vblank_callback)); + m_vblank_interrupt_timer = timer_alloc(*this, FUNC(neogeo_base_state::vblank_interrupt_callback)); } diff --git a/src/mame/drivers/news_38xx.cpp b/src/mame/drivers/news_38xx.cpp index b320b5438fd..94383f886a2 100644 --- a/src/mame/drivers/news_38xx.cpp +++ b/src/mame/drivers/news_38xx.cpp @@ -161,7 +161,7 @@ void news_38xx_state::machine_start() save_item(NAME(m_inten)); save_item(NAME(m_int_state)); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(news_38xx_state::timer), this)); + m_timer = timer_alloc(*this, FUNC(news_38xx_state::timer)); m_intst = 0; m_inten = 0x6d; diff --git a/src/mame/drivers/news_68k.cpp b/src/mame/drivers/news_68k.cpp index 9c90c7e87a2..e32440b38b2 100644 --- a/src/mame/drivers/news_68k.cpp +++ b/src/mame/drivers/news_68k.cpp @@ -158,7 +158,7 @@ void news_68k_state::machine_start() m_net_ram = std::make_unique<u16[]>(8192); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(news_68k_state::timer), this)); + m_timer = timer_alloc(*this, FUNC(news_68k_state::timer)); m_intst = 0; for (bool &int_state : m_int_state) diff --git a/src/mame/drivers/news_r3k.cpp b/src/mame/drivers/news_r3k.cpp index 20bae67c430..c2163f26f78 100644 --- a/src/mame/drivers/news_r3k.cpp +++ b/src/mame/drivers/news_r3k.cpp @@ -173,7 +173,7 @@ void news_r3k_state::machine_start() save_item(NAME(m_lcd_enable)); save_item(NAME(m_lcd_dim)); - m_itimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(news_r3k_state::itimer), this)); + m_itimer = timer_alloc(*this, FUNC(news_r3k_state::itimer)); for (bool &int_state : m_int_state) int_state = false; diff --git a/src/mame/drivers/nexus3d.cpp b/src/mame/drivers/nexus3d.cpp index 81c218bb886..0d49be4a47c 100644 --- a/src/mame/drivers/nexus3d.cpp +++ b/src/mame/drivers/nexus3d.cpp @@ -290,7 +290,7 @@ INPUT_PORTS_END void nexus3d_state::machine_start() { - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nexus3d_state::timercb),this), 0); + m_timer = timer_alloc(*this, FUNC(nexus3d_state::timercb)); } diff --git a/src/mame/drivers/ngp.cpp b/src/mame/drivers/ngp.cpp index c0e8e51e98d..a742b7d862a 100644 --- a/src/mame/drivers/ngp.cpp +++ b/src/mame/drivers/ngp.cpp @@ -706,7 +706,7 @@ void ngp_state::machine_start() m_maincpu->space(AS_PROGRAM).unmap_read(0x800000, 0x9fffff); } - m_seconds_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ngp_state::ngp_seconds_callback),this)); + m_seconds_timer = timer_alloc(*this, FUNC(ngp_state::ngp_seconds_callback)); m_seconds_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); save_item(NAME(m_io_reg)); diff --git a/src/mame/drivers/nightgal.cpp b/src/mame/drivers/nightgal.cpp index efe872d221d..897b415ebeb 100644 --- a/src/mame/drivers/nightgal.cpp +++ b/src/mame/drivers/nightgal.cpp @@ -765,7 +765,7 @@ INPUT_PORTS_END void nightgal_state::machine_start() { - m_z80_wait_ack_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nightgal_state::z80_wait_ack_cb), this)); + m_z80_wait_ack_timer = timer_alloc(*this, FUNC(nightgal_state::z80_wait_ack_cb)); save_item(NAME(m_nsc_latch)); save_item(NAME(m_z80_latch)); diff --git a/src/mame/drivers/nokia_3310.cpp b/src/mame/drivers/nokia_3310.cpp index 0007ecba6ed..0bb670ff6cf 100644 --- a/src/mame/drivers/nokia_3310.cpp +++ b/src/mame/drivers/nokia_3310.cpp @@ -232,10 +232,10 @@ void noki3310_state::machine_start() m_dsp_ram = std::make_unique<uint16_t[]>(0x800); // DSP shared RAM // allocate timers - m_timer0 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(noki3310_state::timer0), this)); - m_timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(noki3310_state::timer1), this)); - m_timer_watchdog = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(noki3310_state::timer_watchdog), this)); - m_timer_fiq8 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(noki3310_state::timer_fiq8), this)); + m_timer0 = timer_alloc(*this, FUNC(noki3310_state::timer0)); + m_timer1 = timer_alloc(*this, FUNC(noki3310_state::timer1)); + m_timer_watchdog = timer_alloc(*this, FUNC(noki3310_state::timer_watchdog)); + m_timer_fiq8 = timer_alloc(*this, FUNC(noki3310_state::timer_fiq8)); } void noki3310_state::machine_reset() diff --git a/src/mame/drivers/notetaker.cpp b/src/mame/drivers/notetaker.cpp index 385084a5e16..250b381bd94 100644 --- a/src/mame/drivers/notetaker.cpp +++ b/src/mame/drivers/notetaker.cpp @@ -758,7 +758,7 @@ void notetaker_state::machine_start() // allocate RAM m_mainram = make_unique_clear<uint16_t[]>(0x100000/2); // allocate the DAC timer, and set it to fire NEVER. We'll set it up properly in IPReset. - m_FIFO_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(notetaker_state::timer_fifoclk),this)); + m_FIFO_timer = timer_alloc(*this, FUNC(notetaker_state::timer_fifoclk)); m_FIFO_timer->adjust(attotime::never); // FDC: /DDEN is tied permanently LOW so MFM mode is ALWAYS ON m_fdc->dden_w(0); diff --git a/src/mame/drivers/novag_sexpert.cpp b/src/mame/drivers/novag_sexpert.cpp index 2e59c4763fe..ece82fd0927 100644 --- a/src/mame/drivers/novag_sexpert.cpp +++ b/src/mame/drivers/novag_sexpert.cpp @@ -193,7 +193,7 @@ private: void sforte_state::machine_start() { sexpert_state::machine_start(); - m_beeptimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sforte_state::beep),this)); + m_beeptimer = timer_alloc(*this, FUNC(sforte_state::beep)); } diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp index 7fb2c07d4ab..6f302c4e2a3 100644 --- a/src/mame/drivers/nwk-tr.cpp +++ b/src/mame/drivers/nwk-tr.cpp @@ -711,7 +711,7 @@ void nwktr_state::machine_start() // configure fast RAM regions for DRC m_maincpu->ppcdrc_add_fastram(0x00000000, 0x003fffff, false, m_work_ram); - m_sound_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nwktr_state::sound_irq), this)); + m_sound_irq_timer = timer_alloc(*this, FUNC(nwktr_state::sound_irq)); } void nwktr_state::nwktr_map(address_map &map) diff --git a/src/mame/drivers/omegrace.cpp b/src/mame/drivers/omegrace.cpp index 12164c1f037..1f2dc78b630 100644 --- a/src/mame/drivers/omegrace.cpp +++ b/src/mame/drivers/omegrace.cpp @@ -280,7 +280,7 @@ void omegrace_state::machine_start() // Interrupt caused by overflow pulses from 74LS161 clocked by 74LS393 dividing .75 MHz output of 74LS161 attotime period = attotime::from_hz(12_MHz_XTAL/16/256/12); // ~250 Hz - m_gbnmi = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(omegrace_state::periodic_int), this)); + m_gbnmi = timer_alloc(*this, FUNC(omegrace_state::periodic_int)); m_gbnmi->adjust(period, 0, period); // first NMI must not arrive immediately } diff --git a/src/mame/drivers/orbit.cpp b/src/mame/drivers/orbit.cpp index 1cd1a45117e..9a30af2a201 100644 --- a/src/mame/drivers/orbit.cpp +++ b/src/mame/drivers/orbit.cpp @@ -248,7 +248,7 @@ GFXDECODE_END void orbit_state::machine_start() { - m_irq_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(orbit_state::irq_off), this)); + m_irq_off_timer = timer_alloc(*this, FUNC(orbit_state::irq_off)); save_item(NAME(m_flip_screen)); } diff --git a/src/mame/drivers/oric.cpp b/src/mame/drivers/oric.cpp index 3781bc85a44..66c01e76656 100644 --- a/src/mame/drivers/oric.cpp +++ b/src/mame/drivers/oric.cpp @@ -401,7 +401,7 @@ void oric_state::machine_start_common() m_ext_irq = false; if (!m_tape_timer) - m_tape_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(oric_state::update_tape), this)); + m_tape_timer = timer_alloc(*this, FUNC(oric_state::update_tape)); save_item(NAME(m_blink_counter)); save_item(NAME(m_pattr)); diff --git a/src/mame/drivers/osbexec.cpp b/src/mame/drivers/osbexec.cpp index 7e35a8fd47f..22798110089 100644 --- a/src/mame/drivers/osbexec.cpp +++ b/src/mame/drivers/osbexec.cpp @@ -504,7 +504,7 @@ void osbexec_state::init_osbexec() m_vram = make_unique_clear<uint8_t[]>(0x2000); m_fontram = make_unique_clear<uint8_t[]>(0x1000); - m_video_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(osbexec_state::osbexec_video_callback),this)); + m_video_timer = timer_alloc(*this, FUNC(osbexec_state::osbexec_video_callback)); } diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp index d8c9e881486..d3ddc9b5307 100644 --- a/src/mame/drivers/overdriv.cpp +++ b/src/mame/drivers/overdriv.cpp @@ -300,7 +300,7 @@ INPUT_PORTS_END void overdriv_state::machine_start() { m_led.resolve(); - m_objdma_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(overdriv_state::objdma_end_cb), this)); + m_objdma_end_timer = timer_alloc(*this, FUNC(overdriv_state::objdma_end_cb)); save_item(NAME(m_cpuB_ctrl)); save_item(NAME(m_sprite_colorbase)); diff --git a/src/mame/drivers/pasopia.cpp b/src/mame/drivers/pasopia.cpp index 4c80db70115..fe925b07333 100644 --- a/src/mame/drivers/pasopia.cpp +++ b/src/mame/drivers/pasopia.cpp @@ -218,7 +218,7 @@ void pasopia_state::machine_start() { m_p_vram = make_unique_clear<u16[]>(0x4000); - m_pio_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pasopia_state::pio_timer), this)); + m_pio_timer = timer_alloc(*this, FUNC(pasopia_state::pio_timer)); m_pio_timer->adjust(attotime::from_hz(50), 0, attotime::from_hz(50)); m_hblank = 0; diff --git a/src/mame/drivers/pasopia7.cpp b/src/mame/drivers/pasopia7.cpp index 45424660a47..68eb5c8ba2f 100644 --- a/src/mame/drivers/pasopia7.cpp +++ b/src/mame/drivers/pasopia7.cpp @@ -918,14 +918,14 @@ ROM_END void pasopia7_state::init_p7_raster() { m_screen_type = 1; - m_pio_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pasopia7_state::pio_timer), this)); + m_pio_timer = timer_alloc(*this, FUNC(pasopia7_state::pio_timer)); m_pio_timer->adjust(attotime::from_hz(5000), 0, attotime::from_hz(5000)); } void pasopia7_state::init_p7_lcd() { m_screen_type = 0; - m_pio_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pasopia7_state::pio_timer), this)); + m_pio_timer = timer_alloc(*this, FUNC(pasopia7_state::pio_timer)); m_pio_timer->adjust(attotime::from_hz(5000), 0, attotime::from_hz(5000)); } diff --git a/src/mame/drivers/patinho_feio.cpp b/src/mame/drivers/patinho_feio.cpp index f9f7154caca..1ce5423c129 100644 --- a/src/mame/drivers/patinho_feio.cpp +++ b/src/mame/drivers/patinho_feio.cpp @@ -186,8 +186,8 @@ DEVICE_IMAGE_LOAD_MEMBER( patinho_feio_state::tape_load ) } void patinho_feio_state::machine_start(){ - m_teletype_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(patinho_feio_state::teletype_callback),this)); - m_decwriter_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(patinho_feio_state::decwriter_callback),this)); + m_teletype_timer = timer_alloc(*this, FUNC(patinho_feio_state::teletype_callback)); + m_decwriter_timer = timer_alloc(*this, FUNC(patinho_feio_state::decwriter_callback)); // Copy some programs directly into RAM. // This is a hack for setting up the computer diff --git a/src/mame/drivers/pb1000.cpp b/src/mame/drivers/pb1000.cpp index f0f075490f0..1af4e9b512a 100644 --- a/src/mame/drivers/pb1000.cpp +++ b/src/mame/drivers/pb1000.cpp @@ -455,7 +455,7 @@ void pb1000_state::machine_start() membank("bank1")->set_base(m_rom_reg->base()); - m_kb_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pb1000_state::keyboard_timer),this)); + m_kb_timer = timer_alloc(*this, FUNC(pb1000_state::keyboard_timer)); m_kb_timer->adjust(attotime::from_hz(192), 0, attotime::from_hz(192)); } diff --git a/src/mame/drivers/pbaction.cpp b/src/mame/drivers/pbaction.cpp index 033cdd32271..a04a405e15b 100644 --- a/src/mame/drivers/pbaction.cpp +++ b/src/mame/drivers/pbaction.cpp @@ -418,7 +418,7 @@ GFXDECODE_END void pbaction_state::machine_start() { - m_soundcommand_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pbaction_state::sound_trigger), this)); + m_soundcommand_timer = timer_alloc(*this, FUNC(pbaction_state::sound_trigger)); save_item(NAME(m_nmi_mask)); save_item(NAME(m_scroll)); } @@ -508,7 +508,7 @@ void pbaction_tecfri_state::machine_start() { pbaction_state::machine_start(); - m_subcommand_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pbaction_tecfri_state::sub_trigger), this)); + m_subcommand_timer = timer_alloc(*this, FUNC(pbaction_tecfri_state::sub_trigger)); m_digits.resolve(); } diff --git a/src/mame/drivers/pc6001.cpp b/src/mame/drivers/pc6001.cpp index 901cf30ecf9..93fa19eb7bc 100644 --- a/src/mame/drivers/pc6001.cpp +++ b/src/mame/drivers/pc6001.cpp @@ -1336,7 +1336,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(pc6001_state::keyboard_callback) void pc6001_state::machine_start() { - m_timer_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pc6001_state::audio_callback),this)); + m_timer_irq_timer = timer_alloc(*this, FUNC(pc6001_state::audio_callback)); } inline void pc6001_state::set_videoram_bank(uint32_t offs) diff --git a/src/mame/drivers/pcw.cpp b/src/mame/drivers/pcw.cpp index 3826a6b226a..2ca6c42131c 100644 --- a/src/mame/drivers/pcw.cpp +++ b/src/mame/drivers/pcw.cpp @@ -1030,12 +1030,12 @@ void pcw_state::init_pcw() m_roller_ram_offset = 0; /* timer interrupt */ - m_beep_setup_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::setup_beep), this)); + m_beep_setup_timer = timer_alloc(*this, FUNC(pcw_state::setup_beep)); m_beep_setup_timer->adjust(attotime::zero); - m_prn_stepper = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::pcw_stepper_callback), this)); - m_prn_pins = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::pcw_pins_callback), this)); - m_pulse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pcw_state::pcw_timer_pulse), this)); + m_prn_stepper = timer_alloc(*this, FUNC(pcw_state::pcw_stepper_callback)); + m_prn_pins = timer_alloc(*this, FUNC(pcw_state::pcw_pins_callback)); + m_pulse_timer = timer_alloc(*this, FUNC(pcw_state::pcw_timer_pulse)); } diff --git a/src/mame/drivers/pdp1.cpp b/src/mame/drivers/pdp1.cpp index 504bbbc7d62..9d7f3f1665a 100644 --- a/src/mame/drivers/pdp1.cpp +++ b/src/mame/drivers/pdp1.cpp @@ -599,7 +599,7 @@ void pdp1_state::machine_start() machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&pdp1_state::pdp1_machine_stop,this)); - m_dpy_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pdp1_state::dpy_callback),this)); + m_dpy_timer = timer_alloc(*this, FUNC(pdp1_state::dpy_callback)); } @@ -625,7 +625,7 @@ void pdp1_readtape_image_device::device_resolve_objects() void pdp1_readtape_image_device::device_start() { - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pdp1_readtape_image_device::reader_callback),this)); + m_timer = timer_alloc(*this, FUNC(pdp1_readtape_image_device::reader_callback)); m_timer->adjust(attotime::zero, 0, attotime::from_hz(2500)); m_timer->enable(0); } @@ -649,7 +649,7 @@ void pdp1_punchtape_image_device::device_resolve_objects() void pdp1_punchtape_image_device::device_start() { - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pdp1_punchtape_image_device::puncher_callback),this)); + m_timer = timer_alloc(*this, FUNC(pdp1_punchtape_image_device::puncher_callback)); } @@ -675,7 +675,7 @@ void pdp1_typewriter_device::device_resolve_objects() void pdp1_typewriter_device::device_start() { - m_tyo_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pdp1_typewriter_device::tyo_callback),this)); + m_tyo_timer = timer_alloc(*this, FUNC(pdp1_typewriter_device::tyo_callback)); m_color = m_pos = m_case_shift = 0; } @@ -1317,7 +1317,7 @@ void pdp1_cylinder_image_device::parallel_drum_init(pdp1_state *state) m_rotation_timer = machine().scheduler().timer_alloc(); m_rotation_timer->adjust(PARALLEL_DRUM_ROTATION_TIME, 0, PARALLEL_DRUM_ROTATION_TIME); - m_il_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pdp1_cylinder_image_device::il_timer_callback),this)); + m_il_timer = timer_alloc(*this, FUNC(pdp1_cylinder_image_device::il_timer_callback)); set_il(0); } #endif diff --git a/src/mame/drivers/peplus.cpp b/src/mame/drivers/peplus.cpp index ee66998159b..1b21d7afbd1 100644 --- a/src/mame/drivers/peplus.cpp +++ b/src/mame/drivers/peplus.cpp @@ -1348,7 +1348,7 @@ void peplus_state::machine_start() m_bnkb.resolve(); m_bnkc.resolve(); - m_assert_lp_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(peplus_state::assert_lp), this)); + m_assert_lp_timer = timer_alloc(*this, FUNC(peplus_state::assert_lp)); save_item(NAME(m_last_cycles)); save_item(NAME(m_coin_state)); diff --git a/src/mame/drivers/pet.cpp b/src/mame/drivers/pet.cpp index c6520fffa3e..c117eaeea49 100644 --- a/src/mame/drivers/pet.cpp +++ b/src/mame/drivers/pet.cpp @@ -1536,7 +1536,7 @@ MACHINE_START_MEMBER( pet_state, pet ) } if (!m_sync_timer) - m_sync_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pet_state::sync_tick), this)); + m_sync_timer = timer_alloc(*this, FUNC(pet_state::sync_tick)); // state saving save_item(NAME(m_key)); diff --git a/src/mame/drivers/pockstat.cpp b/src/mame/drivers/pockstat.cpp index 16e4d0833e1..c851fa23e4f 100644 --- a/src/mame/drivers/pockstat.cpp +++ b/src/mame/drivers/pockstat.cpp @@ -882,7 +882,7 @@ void pockstat_state::machine_start() { for (uint32_t index = 0; index < TIMER_COUNT; index++) { - m_timers[index].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pockstat_state::timer_tick), this)); + m_timers[index].timer = timer_alloc(*this, FUNC(pockstat_state::timer_tick)); m_timers[index].timer->adjust(attotime::never, index); m_timers[index].count = 0; } @@ -890,7 +890,7 @@ void pockstat_state::machine_start() m_rtc_regs.time = 0x01000000; m_rtc_regs.date = 0x19990101; - m_rtc_regs.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pockstat_state::rtc_tick),this)); + m_rtc_regs.timer = timer_alloc(*this, FUNC(pockstat_state::rtc_tick)); m_rtc_regs.timer->adjust(attotime::from_hz(1), TIMER_COUNT); std::string region_tag; diff --git a/src/mame/drivers/ps2sony.cpp b/src/mame/drivers/ps2sony.cpp index 0d54917ae9e..5ab80a45b05 100644 --- a/src/mame/drivers/ps2sony.cpp +++ b/src/mame/drivers/ps2sony.cpp @@ -537,7 +537,7 @@ void ps2sony_state::machine_start() save_item(NAME(m_ipu_out_fifo_index)); if (!m_vblank_timer) - m_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ps2sony_state::vblank), this)); + m_vblank_timer = timer_alloc(*this, FUNC(ps2sony_state::vblank)); } void ps2sony_state::machine_reset() diff --git a/src/mame/drivers/pv1000.cpp b/src/mame/drivers/pv1000.cpp index 63b19c16975..2a5d3d2a29b 100644 --- a/src/mame/drivers/pv1000.cpp +++ b/src/mame/drivers/pv1000.cpp @@ -386,8 +386,8 @@ void pv1000_state::pv1000_postload() void pv1000_state::machine_start() { - m_irq_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pv1000_state::d65010_irq_on_cb),this)); - m_irq_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pv1000_state::d65010_irq_off_cb),this)); + m_irq_on_timer = timer_alloc(*this, FUNC(pv1000_state::d65010_irq_on_cb)); + m_irq_off_timer = timer_alloc(*this, FUNC(pv1000_state::d65010_irq_off_cb)); m_gfxram = memregion("gfxram")->base(); save_pointer(NAME(m_gfxram), 0x400); diff --git a/src/mame/drivers/qdrmfgp.cpp b/src/mame/drivers/qdrmfgp.cpp index 72c2b47804f..0f524ff11a3 100644 --- a/src/mame/drivers/qdrmfgp.cpp +++ b/src/mame/drivers/qdrmfgp.cpp @@ -504,7 +504,7 @@ MACHINE_START_MEMBER(qdrmfgp_state,qdrmfgp) MACHINE_START_MEMBER(qdrmfgp_state,qdrmfgp2) { /* sound irq (CCU? 240Hz) */ - m_gp2_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(qdrmfgp_state::gp2_timer_callback), this)); + m_gp2_timer = timer_alloc(*this, FUNC(qdrmfgp_state::gp2_timer_callback)); m_gp2_timer->adjust(attotime::from_hz(XTAL(18'432'000)/76800), 0, attotime::from_hz(XTAL(18'432'000)/76800)); MACHINE_START_CALL_MEMBER( qdrmfgp ); diff --git a/src/mame/drivers/rastersp.cpp b/src/mame/drivers/rastersp.cpp index 80d47a9a0cb..a515c9a711f 100644 --- a/src/mame/drivers/rastersp.cpp +++ b/src/mame/drivers/rastersp.cpp @@ -179,10 +179,10 @@ void rastersp_state::machine_start() membank("bank3")->set_base(&m_dram[0x300000/4]); if (!m_tms_timer1) - m_tms_timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rastersp_state::tms_timer1), this)); + m_tms_timer1 = timer_alloc(*this, FUNC(rastersp_state::tms_timer1)); if (!m_tms_tx_timer) - m_tms_tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rastersp_state::tms_tx_timer), this)); + m_tms_tx_timer = timer_alloc(*this, FUNC(rastersp_state::tms_tx_timer)); #if USE_SPEEDUP_HACK m_dsp->space(AS_PROGRAM).install_read_handler(0x809923, 0x809923, read32smo_delegate(*this, FUNC(rastersp_state::dsp_speedup_r))); diff --git a/src/mame/drivers/rltennis.cpp b/src/mame/drivers/rltennis.cpp index f082dc18b26..9845f0b2d6c 100644 --- a/src/mame/drivers/rltennis.cpp +++ b/src/mame/drivers/rltennis.cpp @@ -160,7 +160,7 @@ INTERRUPT_GEN_MEMBER(rltennis_state::interrupt) void rltennis_state::machine_start() { - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rltennis_state::sample_player),this)); + m_timer = timer_alloc(*this, FUNC(rltennis_state::sample_player)); save_item(NAME(m_data760000)); save_item(NAME(m_data740000)); diff --git a/src/mame/drivers/runaway.cpp b/src/mame/drivers/runaway.cpp index 388f1371ee1..3529cde0da2 100644 --- a/src/mame/drivers/runaway.cpp +++ b/src/mame/drivers/runaway.cpp @@ -38,7 +38,7 @@ TIMER_CALLBACK_MEMBER(runaway_state::interrupt_callback) void runaway_state::machine_start() { - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(runaway_state::interrupt_callback),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(runaway_state::interrupt_callback)); } void runaway_state::machine_reset() diff --git a/src/mame/drivers/saitek_mark5.cpp b/src/mame/drivers/saitek_mark5.cpp index 83a92784c4f..47d7725e916 100644 --- a/src/mame/drivers/saitek_mark5.cpp +++ b/src/mame/drivers/saitek_mark5.cpp @@ -134,7 +134,7 @@ private: void mark5_state::machine_start() { m_out_x.resolve(); - m_irqtimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mark5_state::interrupt),this)); + m_irqtimer = timer_alloc(*this, FUNC(mark5_state::interrupt)); // register for savestates save_item(NAME(m_dac_data)); diff --git a/src/mame/drivers/saitek_risc2500.cpp b/src/mame/drivers/saitek_risc2500.cpp index 9de8adc73ed..e17a59e0b62 100644 --- a/src/mame/drivers/saitek_risc2500.cpp +++ b/src/mame/drivers/saitek_risc2500.cpp @@ -255,7 +255,7 @@ void risc2500_state::machine_start() m_nvram->set_base(m_ram->pointer(), m_ram->size()); - m_boot_rom_disable_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(risc2500_state::disable_boot_rom), this)); + m_boot_rom_disable_timer = timer_alloc(*this, FUNC(risc2500_state::disable_boot_rom)); save_item(NAME(m_p1000)); diff --git a/src/mame/drivers/sbrkout.cpp b/src/mame/drivers/sbrkout.cpp index 466b0cf2e17..7ffd022013f 100644 --- a/src/mame/drivers/sbrkout.cpp +++ b/src/mame/drivers/sbrkout.cpp @@ -134,8 +134,8 @@ static constexpr XTAL MAIN_CLOCK = 12.096_MHz_XTAL; void sbrkout_state::machine_start() { membank("bank1")->set_base(&m_videoram[0x380]); - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sbrkout_state::scanline_callback),this)); - m_pot_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sbrkout_state::pot_trigger_callback),this)); + m_scanline_timer = timer_alloc(*this, FUNC(sbrkout_state::scanline_callback)); + m_pot_timer = timer_alloc(*this, FUNC(sbrkout_state::pot_trigger_callback)); save_item(NAME(m_sync2_value)); save_item(NAME(m_pot_mask)); diff --git a/src/mame/drivers/sega_sawatte.cpp b/src/mame/drivers/sega_sawatte.cpp index 8e96f53a811..6887278365a 100644 --- a/src/mame/drivers/sega_sawatte.cpp +++ b/src/mame/drivers/sega_sawatte.cpp @@ -85,8 +85,8 @@ private: void sawatte_state::machine_start() { - m_irq3_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sawatte_state::irq3_timer), this)); - m_irq4_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sawatte_state::irq4_timer), this)); + m_irq3_timer = timer_alloc(*this, FUNC(sawatte_state::irq3_timer)); + m_irq4_timer = timer_alloc(*this, FUNC(sawatte_state::irq4_timer)); save_item(NAME(m_data_bank)); save_item(NAME(m_prog_bank)); diff --git a/src/mame/drivers/segas24.cpp b/src/mame/drivers/segas24.cpp index ee1399a310c..484ca823117 100644 --- a/src/mame/drivers/segas24.cpp +++ b/src/mame/drivers/segas24.cpp @@ -2532,7 +2532,7 @@ void segas24_state::init_gground() m_mlatch_table = nullptr; m_track_size = 0x2d00; - m_gground_hack_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(segas24_state::gground_hack_timer_callback), this)); + m_gground_hack_timer = timer_alloc(*this, FUNC(segas24_state::gground_hack_timer_callback)); } void segas24_state::init_crkdown() diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp index cef8dc12c97..e8b56503eca 100644 --- a/src/mame/drivers/seta.cpp +++ b/src/mame/drivers/seta.cpp @@ -1491,7 +1491,7 @@ void seta_state::uPD71054_timer_init() uPD71054->max[no] = 0xffff; for (int no = 0; no < USED_TIMER_NUM; no++) - uPD71054->timer[no] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(seta_state::uPD71054_timer_callback),this)); + uPD71054->timer[no] = timer_alloc(*this, FUNC(seta_state::uPD71054_timer_callback)); } @@ -2258,7 +2258,7 @@ void seta_state::keroppi_map(address_map &map) MACHINE_START_MEMBER(seta_state,keroppi) { - m_keroppi_prize_hop_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(seta_state::keroppi_prize_hop_callback), this)); + m_keroppi_prize_hop_timer = timer_alloc(*this, FUNC(seta_state::keroppi_prize_hop_callback)); m_keroppi_prize_hop = 0; m_keroppi_protection_count = 0; diff --git a/src/mame/drivers/skullxbo.cpp b/src/mame/drivers/skullxbo.cpp index c7334cff9c9..dc3a4a86dac 100644 --- a/src/mame/drivers/skullxbo.cpp +++ b/src/mame/drivers/skullxbo.cpp @@ -82,7 +82,7 @@ void skullxbo_state::machine_start() { atarigen_state::machine_start(); - m_scanline_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(skullxbo_state::scanline_interrupt), this)); + m_scanline_int_timer = timer_alloc(*this, FUNC(skullxbo_state::scanline_interrupt)); save_item(NAME(m_scanline_int_state)); } diff --git a/src/mame/drivers/spc1000.cpp b/src/mame/drivers/spc1000.cpp index fb1df6a2d27..41408d01939 100644 --- a/src/mame/drivers/spc1000.cpp +++ b/src/mame/drivers/spc1000.cpp @@ -221,7 +221,7 @@ uint8_t spc1000_state::iplk_r() void spc1000_state::cass_w(uint8_t data) { - attotime time = machine().scheduler().time(); + attotime time = machine().time(); m_cass->output(BIT(data, 0) ? -1.0 : 1.0); if (BIT(data, 1) || (((time - m_time).as_attoseconds()/ATTOSECONDS_PER_MILLISECOND) < 1000)) { @@ -408,7 +408,7 @@ void spc1000_state::machine_start() membank("bank2")->set_base(ram); membank("bank4")->set_base(ram + 0x8000); - m_time = machine().scheduler().time(); + m_time = machine().time(); save_item(NAME(m_IPLK)); save_item(NAME(m_GMODE)); diff --git a/src/mame/drivers/spc1500.cpp b/src/mame/drivers/spc1500.cpp index 85b25f91993..b491f809346 100644 --- a/src/mame/drivers/spc1500.cpp +++ b/src/mame/drivers/spc1500.cpp @@ -836,7 +836,7 @@ void spc1500_state::machine_start() void spc1500_state::machine_reset() { m_motor = false; - m_time = machine().scheduler().time(); + m_time = machine().time(); m_double_mode = false; memset(&m_paltbl[0], 1, 8); m_char_count = 0; diff --git a/src/mame/drivers/ssfindo.cpp b/src/mame/drivers/ssfindo.cpp index 756fccd6863..58a6c3169ba 100644 --- a/src/mame/drivers/ssfindo.cpp +++ b/src/mame/drivers/ssfindo.cpp @@ -669,8 +669,8 @@ ROM_END void ssfindo_state::init_common() { m_speedup = nullptr; - //m_PS7500timer0 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ssfindo_state::PS7500_Timer0_callback),this)); - //m_PS7500timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ssfindo_state::PS7500_Timer1_callback),this)); + //m_PS7500timer0 = timer_alloc(*this, FUNC(ssfindo_state::PS7500_Timer0_callback)); + //m_PS7500timer1 = timer_alloc(*this, FUNC(ssfindo_state::PS7500_Timer1_callback)); //save_item(NAME(m_PS7500_IO)); //save_item(NAME(m_PS7500_FIFO)); diff --git a/src/mame/drivers/sslam.cpp b/src/mame/drivers/sslam.cpp index 3b067bf0f97..bb83bb7894e 100644 --- a/src/mame/drivers/sslam.cpp +++ b/src/mame/drivers/sslam.cpp @@ -699,7 +699,7 @@ void sslam_state::machine_start() save_item(NAME(m_bar)); save_item(NAME(m_snd_bank)); - m_music_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sslam_state::music_playback),this)); + m_music_timer = timer_alloc(*this, FUNC(sslam_state::music_playback)); } void powerbls_state::machine_start() diff --git a/src/mame/drivers/supracan.cpp b/src/mame/drivers/supracan.cpp index 608ef93fabc..a88a2139625 100644 --- a/src/mame/drivers/supracan.cpp +++ b/src/mame/drivers/supracan.cpp @@ -1948,10 +1948,10 @@ void supracan_state::machine_start() save_item(NAME(m_video_regs)); - m_video_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(supracan_state::video_callback), this)); - m_hbl_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(supracan_state::hbl_callback), this)); - m_line_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(supracan_state::line_on_callback), this)); - m_line_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(supracan_state::line_off_callback), this)); + m_video_timer = timer_alloc(*this, FUNC(supracan_state::video_callback)); + m_hbl_timer = timer_alloc(*this, FUNC(supracan_state::hbl_callback)); + m_line_on_timer = timer_alloc(*this, FUNC(supracan_state::line_on_callback)); + m_line_off_timer = timer_alloc(*this, FUNC(supracan_state::line_off_callback)); if (m_cart->exists()) m_maincpu->space(AS_PROGRAM).install_read_handler(0x000000, 0x3fffff, read16s_delegate(*m_cart, FUNC(generic_slot_device::read16_rom))); diff --git a/src/mame/drivers/svision.cpp b/src/mame/drivers/svision.cpp index ce3e08c94b1..7bd5d3732e7 100644 --- a/src/mame/drivers/svision.cpp +++ b/src/mame/drivers/svision.cpp @@ -430,17 +430,17 @@ WRITE_LINE_MEMBER(svision_state::frame_int_w) void svision_state::init_svision() { - m_svision.timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(svision_state::svision_timer),this)); + m_svision.timer1 = timer_alloc(*this, FUNC(svision_state::svision_timer)); m_dma_finished = false; m_pet.on = false; } void svision_state::init_svisions() { - m_svision.timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(svision_state::svision_timer),this)); + m_svision.timer1 = timer_alloc(*this, FUNC(svision_state::svision_timer)); m_dma_finished = false; m_pet.on = true; - m_pet.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(svision_state::svision_pet_timer),this)); + m_pet.timer = timer_alloc(*this, FUNC(svision_state::svision_pet_timer)); } DEVICE_IMAGE_LOAD_MEMBER( svision_state::cart_load ) diff --git a/src/mame/drivers/sym1.cpp b/src/mame/drivers/sym1.cpp index ce434444478..25960345f43 100644 --- a/src/mame/drivers/sym1.cpp +++ b/src/mame/drivers/sym1.cpp @@ -315,7 +315,7 @@ void sym1_state::init_sym1() bank->set_entry(1); // allocate a timer to refresh the led display - m_led_update = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sym1_state::led_refresh), this)); + m_led_update = timer_alloc(*this, FUNC(sym1_state::led_refresh)); } void sym1_state::machine_reset() diff --git a/src/mame/drivers/targeth.cpp b/src/mame/drivers/targeth.cpp index 072079fc2c1..33bf6115d09 100644 --- a/src/mame/drivers/targeth.cpp +++ b/src/mame/drivers/targeth.cpp @@ -176,8 +176,8 @@ void targeth_state::machine_start() { m_okibank->configure_entries(0, 16, memregion("oki")->base(), 0x10000); - m_gun_irq_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(targeth_state::gun1_irq), this)); - m_gun_irq_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(targeth_state::gun2_irq), this)); + m_gun_irq_timer[0] = timer_alloc(*this, FUNC(targeth_state::gun1_irq)); + m_gun_irq_timer[1] = timer_alloc(*this, FUNC(targeth_state::gun2_irq)); m_gun_irq_timer[0]->adjust(m_screen->time_until_pos(128, 0)); m_gun_irq_timer[1]->adjust(m_screen->time_until_pos(160, 0)); diff --git a/src/mame/drivers/teleray10.cpp b/src/mame/drivers/teleray10.cpp index 2aa362e4dec..bb3700ee243 100644 --- a/src/mame/drivers/teleray10.cpp +++ b/src/mame/drivers/teleray10.cpp @@ -88,7 +88,7 @@ private: void teleray10_state::machine_start() { - m_bell_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(teleray10_state::bell_toggle), this)); + m_bell_timer = timer_alloc(*this, FUNC(teleray10_state::bell_toggle)); m_topr = 0; m_timer_expired = false; diff --git a/src/mame/drivers/thunderx.cpp b/src/mame/drivers/thunderx.cpp index 1f387232efc..9b649746f09 100644 --- a/src/mame/drivers/thunderx.cpp +++ b/src/mame/drivers/thunderx.cpp @@ -1057,7 +1057,7 @@ ROM_END void thunderx_state::init_thunderx() { - m_thunderx_firq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thunderx_state::thunderx_firq_cb), this)); + m_thunderx_firq_timer = timer_alloc(*this, FUNC(thunderx_state::thunderx_firq_cb)); } /***************************************************************************/ diff --git a/src/mame/drivers/tm990189.cpp b/src/mame/drivers/tm990189.cpp index 86ba15043e1..2c733267cc3 100644 --- a/src/mame/drivers/tm990189.cpp +++ b/src/mame/drivers/tm990189.cpp @@ -206,7 +206,7 @@ MACHINE_START_MEMBER(tm990189_state,tm990_189) { m_digits.resolve(); m_leds.resolve(); - m_displayena_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); + m_displayena_timer = timer_alloc(); m_digitsel = 0; m_LED_state = 0; @@ -216,12 +216,12 @@ MACHINE_START_MEMBER(tm990189_state,tm990_189_v) { m_digits.resolve(); m_leds.resolve(); - m_displayena_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); + m_displayena_timer = timer_alloc(); - m_joy1x_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); - m_joy1y_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); - m_joy2x_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); - m_joy2y_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); + m_joy1x_timer = timer_alloc(); + m_joy1y_timer = timer_alloc(); + m_joy2x_timer = timer_alloc(); + m_joy2y_timer = timer_alloc(); m_digitsel = 0; m_LED_state = 0; diff --git a/src/mame/drivers/tmmjprd.cpp b/src/mame/drivers/tmmjprd.cpp index 2730a5c1bab..4b372c8e3b4 100644 --- a/src/mame/drivers/tmmjprd.cpp +++ b/src/mame/drivers/tmmjprd.cpp @@ -506,7 +506,7 @@ void tmmjprd_state::blitter_w(offs_t offset, uint32_t data, uint32_t mem_mask) void tmmjprd_state::machine_start() { #if EMULATE_BLITTER - m_blit_done_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tmmjprd_state::blit_done), this)); + m_blit_done_timer = timer_alloc(*this, FUNC(tmmjprd_state::blit_done)); #endif save_item(NAME(m_mux_data)); diff --git a/src/mame/drivers/toobin.cpp b/src/mame/drivers/toobin.cpp index 811b038cc11..2e9958bef6d 100644 --- a/src/mame/drivers/toobin.cpp +++ b/src/mame/drivers/toobin.cpp @@ -48,7 +48,7 @@ TIMER_CALLBACK_MEMBER(toobin_state::scanline_interrupt) void toobin_state::machine_start() { - m_scanline_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(toobin_state::scanline_interrupt), this)); + m_scanline_interrupt_timer = timer_alloc(*this, FUNC(toobin_state::scanline_interrupt)); } diff --git a/src/mame/drivers/turrett.cpp b/src/mame/drivers/turrett.cpp index 865da9b99f2..f3a65cb75aa 100644 --- a/src/mame/drivers/turrett.cpp +++ b/src/mame/drivers/turrett.cpp @@ -61,7 +61,7 @@ void turrett_state::machine_start() save_item(NAME(m_frame)); save_item(NAME(m_adc)); - m_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(turrett_state::dma_complete), this)); + m_dma_timer = timer_alloc(*this, FUNC(turrett_state::dma_complete)); } diff --git a/src/mame/drivers/tutor.cpp b/src/mame/drivers/tutor.cpp index 8b2799d6700..1fceecbdc65 100644 --- a/src/mame/drivers/tutor.cpp +++ b/src/mame/drivers/tutor.cpp @@ -249,7 +249,7 @@ void tutor_state::machine_start() std::string region_tag; m_cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG)); - m_tape_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tutor_state::tape_interrupt_handler),this)); + m_tape_interrupt_timer = timer_alloc(*this, FUNC(tutor_state::tape_interrupt_handler)); m_bank1->configure_entry(0, memregion("maincpu")->base() + 0x4000); m_bank1->set_entry(0); diff --git a/src/mame/drivers/tx0.cpp b/src/mame/drivers/tx0.cpp index 8a8d5a21973..e472029dbd2 100644 --- a/src/mame/drivers/tx0.cpp +++ b/src/mame/drivers/tx0.cpp @@ -340,10 +340,10 @@ void tx0_state::tx0_machine_stop() void tx0_state::machine_start() { - m_tape_reader.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx0_state::reader_callback),this)); - m_tape_puncher.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx0_state::puncher_callback),this)); - m_typewriter.prt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx0_state::prt_callback),this)); - m_dis_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx0_state::dis_callback),this)); + m_tape_reader.timer = timer_alloc(*this, FUNC(tx0_state::reader_callback)); + m_tape_puncher.timer = timer_alloc(*this, FUNC(tx0_state::puncher_callback)); + m_typewriter.prt_timer = timer_alloc(*this, FUNC(tx0_state::prt_callback)); + m_dis_timer = timer_alloc(*this, FUNC(tx0_state::dis_callback)); machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&tx0_state::tx0_machine_stop,this)); } diff --git a/src/mame/drivers/vgmplay.cpp b/src/mame/drivers/vgmplay.cpp index dafabd67bf5..f087edbcecd 100644 --- a/src/mame/drivers/vgmplay.cpp +++ b/src/mame/drivers/vgmplay.cpp @@ -558,10 +558,10 @@ void vgmplay_device::device_start() for (vgm_chip led = vgm_chip(0); led != CT_COUNT; led = vgm_chip(led + 1)) m_act_led_index[led] = m_act_led_expiries.emplace(m_act_led_expiries.end(), led, attotime::never); m_act_led_off = m_act_led_expiries.begin(); - m_act_led_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vgmplay_device::act_led_expired), this)); + m_act_led_timer = timer_alloc(*this, FUNC(vgmplay_device::act_led_expired)); for (int i = 0; i < 0xff; i++) - m_streams[i].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vgmplay_device::stream_timer_expired), this)); + m_streams[i].timer = timer_alloc(*this, FUNC(vgmplay_device::stream_timer_expired)); save_item(NAME(m_pc)); //save_item(NAME(m_streams)); diff --git a/src/mame/drivers/video21.cpp b/src/mame/drivers/video21.cpp index 6af36ce0652..73e5be74a23 100644 --- a/src/mame/drivers/video21.cpp +++ b/src/mame/drivers/video21.cpp @@ -244,7 +244,7 @@ GFXDECODE_END void video21_state::machine_start() { - m_hopper_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(video21_state::hopper_coinout),this)); + m_hopper_timer = timer_alloc(*this, FUNC(video21_state::hopper_coinout)); m_lamps.resolve(); diff --git a/src/mame/drivers/viper.cpp b/src/mame/drivers/viper.cpp index 346b2d2eea0..3751c73dcbe 100644 --- a/src/mame/drivers/viper.cpp +++ b/src/mame/drivers/viper.cpp @@ -1374,10 +1374,10 @@ void viper_state::mpc8240_interrupt(int irq) void viper_state::mpc8240_epic_init() { memset(&m_epic, 0, sizeof(m_epic)); - m_epic.global_timer[0].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(viper_state::epic_global_timer_callback),this)); - m_epic.global_timer[1].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(viper_state::epic_global_timer_callback),this)); - m_epic.global_timer[2].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(viper_state::epic_global_timer_callback),this)); - m_epic.global_timer[3].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(viper_state::epic_global_timer_callback),this)); + m_epic.global_timer[0].timer = timer_alloc(*this, FUNC(viper_state::epic_global_timer_callback)); + m_epic.global_timer[1].timer = timer_alloc(*this, FUNC(viper_state::epic_global_timer_callback)); + m_epic.global_timer[2].timer = timer_alloc(*this, FUNC(viper_state::epic_global_timer_callback)); + m_epic.global_timer[3].timer = timer_alloc(*this, FUNC(viper_state::epic_global_timer_callback)); } void viper_state::mpc8240_epic_reset(void) @@ -2371,7 +2371,7 @@ WRITE_LINE_MEMBER(viper_state::voodoo_pciint) void viper_state::machine_start() { - m_ds2430_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(viper_state::ds2430_timer_callback),this)); + m_ds2430_timer = timer_alloc(*this, FUNC(viper_state::ds2430_timer_callback)); mpc8240_epic_init(); /* set conservative DRC options */ diff --git a/src/mame/drivers/vp415.cpp b/src/mame/drivers/vp415.cpp index b32267ce952..6276867e42c 100644 --- a/src/mame/drivers/vp415.cpp +++ b/src/mame/drivers/vp415.cpp @@ -122,7 +122,7 @@ WRITE_LINE_MEMBER(vp415_state::refv_w) { m_refv = state; m_drivecpu->set_input_line(MCS51_INT0_LINE, m_refv ? CLEAR_LINE : ASSERT_LINE); - //printf("Current time in ms: %f\n", machine().scheduler().time().as_double() * 1000.0D); + //printf("Current time in ms: %f\n", machine().time().as_double() * 1000.0D); } // CPU Datagrabber Module (W) diff --git a/src/mame/drivers/x07.cpp b/src/mame/drivers/x07.cpp index f103a68e766..b8d72513cdd 100644 --- a/src/mame/drivers/x07.cpp +++ b/src/mame/drivers/x07.cpp @@ -1378,11 +1378,11 @@ GFXDECODE_END void x07_state::machine_start() { uint32_t ram_size = m_ram->size(); - m_rsta_clear = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x07_state::rsta_clear),this)); - m_rstb_clear = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x07_state::rstb_clear),this)); - m_beep_stop = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x07_state::beep_stop),this)); - m_cass_poll = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x07_state::cassette_poll),this)); - m_cass_tick = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x07_state::cassette_tick),this)); + m_rsta_clear = timer_alloc(*this, FUNC(x07_state::rsta_clear)); + m_rstb_clear = timer_alloc(*this, FUNC(x07_state::rstb_clear)); + m_beep_stop = timer_alloc(*this, FUNC(x07_state::beep_stop)); + m_cass_poll = timer_alloc(*this, FUNC(x07_state::cassette_poll)); + m_cass_tick = timer_alloc(*this, FUNC(x07_state::cassette_tick)); m_nvram1->set_base(&m_t6834_ram, 0x800); m_nvram2->set_base(m_ram->pointer(), ram_size); diff --git a/src/mame/drivers/x1.cpp b/src/mame/drivers/x1.cpp index fba91bf66b0..c379dd49cb3 100644 --- a/src/mame/drivers/x1.cpp +++ b/src/mame/drivers/x1.cpp @@ -2133,7 +2133,7 @@ void x1_state::machine_start() m_rtc.min = ((systime.local_time.minute / 10)<<4) | ((systime.local_time.minute % 10) & 0xf); m_rtc.sec = ((systime.local_time.second / 10)<<4) | ((systime.local_time.second % 10) & 0xf); - m_rtc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x1_state::x1_rtc_increment),this)); + m_rtc_timer = timer_alloc(*this, FUNC(x1_state::x1_rtc_increment)); } m_work_ram = make_unique_clear<uint8_t[]>(0x10000*0x10); diff --git a/src/mame/drivers/xavix2.cpp b/src/mame/drivers/xavix2.cpp index bb0f3d638df..3b38ffcdaf0 100644 --- a/src/mame/drivers/xavix2.cpp +++ b/src/mame/drivers/xavix2.cpp @@ -610,7 +610,7 @@ uint32_t xavix2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap void xavix2_state::machine_start() { - m_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(xavix2_state::dma_end), this)); + m_dma_timer = timer_alloc(*this, FUNC(xavix2_state::dma_end)); } void xavix2_state::machine_reset() diff --git a/src/mame/drivers/xexex.cpp b/src/mame/drivers/xexex.cpp index 2f9013f0c05..8ca05707a65 100644 --- a/src/mame/drivers/xexex.cpp +++ b/src/mame/drivers/xexex.cpp @@ -450,7 +450,7 @@ void xexex_state::machine_start() save_item(NAME(m_cur_control2)); machine().save().register_postload(save_prepost_delegate(FUNC(xexex_state::xexex_postload), this)); - m_dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(xexex_state::dmaend_callback),this)); + m_dmadelay_timer = timer_alloc(*this, FUNC(xexex_state::dmaend_callback)); } void xexex_state::machine_reset() diff --git a/src/mame/machine/aim65.cpp b/src/mame/machine/aim65.cpp index cf7b14ba9e1..452c40260dc 100644 --- a/src/mame/machine/aim65.cpp +++ b/src/mame/machine/aim65.cpp @@ -142,7 +142,7 @@ void aim65_state::machine_start() save_item(NAME(m_printer_y)); save_item(NAME(m_printer_flag)); save_item(NAME(m_printer_level)); - m_print_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(aim65_state::printer_timer),this)); + m_print_timer = timer_alloc(*this, FUNC(aim65_state::printer_timer)); m_printerRAM = make_unique_clear<uint16_t[]>(64*100); save_pointer(NAME(m_printerRAM), 64*100); } diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp index cae8af99f1e..8ee9a2e2564 100644 --- a/src/mame/machine/apollo.cpp +++ b/src/mame/machine/apollo.cpp @@ -1276,8 +1276,7 @@ void apollo_stdio_device::device_start() m_tx_w.resolve_safe(); - m_poll_timer = machine().scheduler().timer_alloc(timer_expired_delegate( - FUNC(apollo_stdio_device::poll_timer), this)); + m_poll_timer = timer_alloc(*this, FUNC(apollo_stdio_device::poll_timer)); } //------------------------------------------------- diff --git a/src/mame/machine/apollo_kbd.cpp b/src/mame/machine/apollo_kbd.cpp index 54302827fea..635bfb187d0 100644 --- a/src/mame/machine/apollo_kbd.cpp +++ b/src/mame/machine/apollo_kbd.cpp @@ -240,7 +240,7 @@ void apollo_kbd_device::device_start() m_beeper.start(this); m_mouse.start(this); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(apollo_kbd_device::kbd_scan_timer), this)); + m_timer = timer_alloc(*this, FUNC(apollo_kbd_device::kbd_scan_timer)); } //------------------------------------------------- @@ -315,7 +315,7 @@ void apollo_kbd_device::beeper::start(apollo_kbd_device *device) m_device = device; LOG2(("start apollo_kbd::beeper")); m_beeper = m_device->m_beep.target(); - m_timer = m_device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(apollo_kbd_device::beeper::beeper_callback), this)); + m_timer = m_device->timer_alloc(*this, FUNC(apollo_kbd_device::beeper::beeper_callback)); } void apollo_kbd_device::beeper::reset() diff --git a/src/mame/machine/apple3.cpp b/src/mame/machine/apple3.cpp index a875d6dfc9e..544eaca2f86 100644 --- a/src/mame/machine/apple3.cpp +++ b/src/mame/machine/apple3.cpp @@ -729,8 +729,8 @@ void apple3_state::init_apple3() m_via[1]->write_pb6(1); m_via[1]->write_pb7(1); - m_scanstart = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(apple3_state::scanstart_cb),this)); - m_scanend = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(apple3_state::scanend_cb),this)); + m_scanstart = timer_alloc(*this, FUNC(apple3_state::scanstart_cb)); + m_scanend = timer_alloc(*this, FUNC(apple3_state::scanend_cb)); apple3_update_memory(); diff --git a/src/mame/machine/bbc.cpp b/src/mame/machine/bbc.cpp index 4281e2b0f1c..313f690c0dc 100644 --- a/src/mame/machine/bbc.cpp +++ b/src/mame/machine/bbc.cpp @@ -1378,8 +1378,8 @@ void bbc_state::init_bbc() m_nr_high_tones = 0; m_serproc_data = 0; m_cass_out_enabled = 0; - m_tape_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bbc_state::tape_timer_cb), this)); - m_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bbc_state::reset_timer_cb), this)); + m_tape_timer = timer_alloc(*this, FUNC(bbc_state::tape_timer_cb)); + m_reset_timer = timer_alloc(*this, FUNC(bbc_state::reset_timer_cb)); /* vertical sync pulse from video circuit */ m_via6522_0->write_ca1(1); diff --git a/src/mame/machine/bk.cpp b/src/mame/machine/bk.cpp index d9c5a7c6907..def436905c4 100644 --- a/src/mame/machine/bk.cpp +++ b/src/mame/machine/bk.cpp @@ -63,7 +63,7 @@ void bk_state::machine_start() m_maincpu->set_input_line(t11_device::VEC_LINE, ASSERT_LINE); - m_kbd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(bk_state::keyboard_callback), this)); + m_kbd_timer = timer_alloc(*this, FUNC(bk_state::keyboard_callback)); m_kbd_timer->adjust(attotime::from_hz(2400), 0, attotime::from_hz(2400)); } diff --git a/src/mame/machine/cdicdic.cpp b/src/mame/machine/cdicdic.cpp index 4eb6cd44dac..43575734aee 100644 --- a/src/mame/machine/cdicdic.cpp +++ b/src/mame/machine/cdicdic.cpp @@ -1286,18 +1286,18 @@ void cdicdic_device::device_start() save_item(NAME(m_audio_sample_freq)); save_item(NAME(m_audio_sample_size)); - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdicdic_device::trigger_readback_int), this)); + m_interrupt_timer = timer_alloc(*this, FUNC(cdicdic_device::trigger_readback_int)); m_interrupt_timer->adjust(attotime::never); - m_audio_sample_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdicdic_device::audio_sample_trigger), this)); + m_audio_sample_timer = timer_alloc(*this, FUNC(cdicdic_device::audio_sample_trigger)); m_audio_sample_timer->adjust(attotime::never); - m_audio_playback_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdicdic_device::initial_sample_trigger), this)); + m_audio_playback_timer = timer_alloc(*this, FUNC(cdicdic_device::initial_sample_trigger)); m_audio_playback_timer->adjust(attotime::never); - m_periodic_sample_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdicdic_device::periodic_sample_trigger), this)); + m_periodic_sample_timer[0] = timer_alloc(*this, FUNC(cdicdic_device::periodic_sample_trigger)); m_periodic_sample_timer[0]->adjust(attotime::never); - m_periodic_sample_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdicdic_device::periodic_sample_trigger), this)); + m_periodic_sample_timer[1] = timer_alloc(*this, FUNC(cdicdic_device::periodic_sample_trigger)); m_periodic_sample_timer[1]->adjust(attotime::never); m_ram = std::make_unique<uint16_t[]>(0x3c00/2); diff --git a/src/mame/machine/cdislavehle.cpp b/src/mame/machine/cdislavehle.cpp index c8e01d67a10..d1ae57a7ea1 100644 --- a/src/mame/machine/cdislavehle.cpp +++ b/src/mame/machine/cdislavehle.cpp @@ -482,7 +482,7 @@ void cdislave_hle_device::device_start() save_item(NAME(m_fake_mouse_x)); save_item(NAME(m_fake_mouse_y)); - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cdislave_hle_device::trigger_readback_int), this)); + m_interrupt_timer = timer_alloc(*this, FUNC(cdislave_hle_device::trigger_readback_int)); m_interrupt_timer->adjust(attotime::never); } diff --git a/src/mame/machine/cedar_magnet_board.cpp b/src/mame/machine/cedar_magnet_board.cpp index 2cffb11abb3..f39a6b70feb 100644 --- a/src/mame/machine/cedar_magnet_board.cpp +++ b/src/mame/machine/cedar_magnet_board.cpp @@ -82,8 +82,8 @@ void cedar_magnet_board_interface::interface_pre_reset() void cedar_magnet_board_interface::interface_pre_start() { - m_halt_assert_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cedar_magnet_board_interface::halt_assert_callback), this)); - m_halt_clear_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cedar_magnet_board_interface::halt_clear_callback), this)); - m_reset_assert_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cedar_magnet_board_interface::reset_assert_callback), this)); - m_reset_clear_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cedar_magnet_board_interface::reset_clear_callback), this)); + m_halt_assert_timer = device().timer_alloc(*this, FUNC(cedar_magnet_board_interface::halt_assert_callback)); + m_halt_clear_timer = device().timer_alloc(*this, FUNC(cedar_magnet_board_interface::halt_clear_callback)); + m_reset_assert_timer = device().timer_alloc(*this, FUNC(cedar_magnet_board_interface::reset_assert_callback)); + m_reset_clear_timer = device().timer_alloc(*this, FUNC(cedar_magnet_board_interface::reset_clear_callback)); } diff --git a/src/mame/machine/dccons.cpp b/src/mame/machine/dccons.cpp index 08634ce1bd2..1acc3567138 100644 --- a/src/mame/machine/dccons.cpp +++ b/src/mame/machine/dccons.cpp @@ -88,7 +88,7 @@ TIMER_CALLBACK_MEMBER(dc_cons_state::atapi_xfer_end ) void dc_cons_state::dreamcast_atapi_init() { - atapi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_cons_state::atapi_xfer_end),this)); + atapi_timer = timer_alloc(*this, FUNC(dc_cons_state::atapi_xfer_end)); atapi_timer->adjust(attotime::never); save_item(NAME(atapi_xferlen)); save_item(NAME(atapi_xferbase)); diff --git a/src/mame/machine/deco_irq.cpp b/src/mame/machine/deco_irq.cpp index ce4bac5c0a2..6eef062d17f 100644 --- a/src/mame/machine/deco_irq.cpp +++ b/src/mame/machine/deco_irq.cpp @@ -74,7 +74,7 @@ void deco_irq_device::device_start() m_vblank_irq_cb.resolve_safe(); // allocate scanline timer and start it - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(deco_irq_device::scanline_callback), this)); + m_scanline_timer = timer_alloc(*this, FUNC(deco_irq_device::scanline_callback)); m_scanline_timer->adjust(m_screen->time_until_pos(0)); // register for save states diff --git a/src/mame/machine/decocass_tape.cpp b/src/mame/machine/decocass_tape.cpp index 199a11c1e47..fc821eb0f0e 100644 --- a/src/mame/machine/decocass_tape.cpp +++ b/src/mame/machine/decocass_tape.cpp @@ -82,7 +82,7 @@ void decocass_tape_device::device_start() int curblock, offs, numblocks; /* fetch the data pointer */ - m_tape_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(decocass_tape_device::tape_clock_callback), this)); + m_tape_timer = timer_alloc(*this, FUNC(decocass_tape_device::tape_clock_callback)); if (!m_tape_data.found()) return; diff --git a/src/mame/machine/dmac_0266.cpp b/src/mame/machine/dmac_0266.cpp index e3343baa8e0..b861d2ff250 100644 --- a/src/mame/machine/dmac_0266.cpp +++ b/src/mame/machine/dmac_0266.cpp @@ -58,7 +58,7 @@ void dmac_0266_device::device_start() save_item(NAME(m_req_state)); - m_dma_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dmac_0266_device::dma_check), this)); + m_dma_check = timer_alloc(*this, FUNC(dmac_0266_device::dma_check)); m_req_state = false; } diff --git a/src/mame/machine/dmac_0448.cpp b/src/mame/machine/dmac_0448.cpp index 578c09fafd8..93e0e13a907 100644 --- a/src/mame/machine/dmac_0448.cpp +++ b/src/mame/machine/dmac_0448.cpp @@ -54,8 +54,8 @@ void dmac_0448_device::device_start() m_dma_r.resolve_all_safe(0); m_dma_w.resolve_all_safe(); - m_irq_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dmac_0448_device::irq_check), this)); - m_dma_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dmac_0448_device::dma_check), this)); + m_irq_check = timer_alloc(*this, FUNC(dmac_0448_device::irq_check)); + m_dma_check = timer_alloc(*this, FUNC(dmac_0448_device::dma_check)); m_out_int_state = false; m_gsel = 0; diff --git a/src/mame/machine/fidel_clockdiv.cpp b/src/mame/machine/fidel_clockdiv.cpp index 13ec96c2ee1..26a86a43917 100644 --- a/src/mame/machine/fidel_clockdiv.cpp +++ b/src/mame/machine/fidel_clockdiv.cpp @@ -23,7 +23,7 @@ TODO: void fidel_clockdiv_state::machine_start() { // dummy timer for cpu divider - m_div_timer = machine().scheduler().timer_alloc(timer_expired_delegate(), this); + m_div_timer = timer_alloc(); } diff --git a/src/mame/machine/gaelco3d.cpp b/src/mame/machine/gaelco3d.cpp index b5d6c8234bf..2309899a19f 100644 --- a/src/mame/machine/gaelco3d.cpp +++ b/src/mame/machine/gaelco3d.cpp @@ -206,7 +206,7 @@ void gaelco_serial_device::device_start() assert(strlen(tag()) < 20); m_irq_handler.resolve_safe(); - m_sync_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gaelco_serial_device::link_cb), this)); + m_sync_timer = timer_alloc(*this, FUNC(gaelco_serial_device::link_cb)); /* register for save states */ //save_item(NAME(earom->offset)); diff --git a/src/mame/machine/gamecom.cpp b/src/mame/machine/gamecom.cpp index 94ce240f443..8fe3fa6c953 100644 --- a/src/mame/machine/gamecom.cpp +++ b/src/mame/machine/gamecom.cpp @@ -611,9 +611,9 @@ void gamecom_state::gamecom_update_timers(uint8_t data) void gamecom_state::init_gamecom() { - m_clock_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamecom_state::gamecom_clock_timer_callback),this)); - m_sound0_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamecom_state::gamecom_sound0_timer_callback),this)); - m_sound1_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamecom_state::gamecom_sound1_timer_callback),this)); + m_clock_timer = timer_alloc(*this, FUNC(gamecom_state::gamecom_clock_timer_callback)); + m_sound0_timer = timer_alloc(*this, FUNC(gamecom_state::gamecom_sound0_timer_callback)); + m_sound1_timer = timer_alloc(*this, FUNC(gamecom_state::gamecom_sound1_timer_callback)); m_sound0_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); m_sound1_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); m_p_ram = m_share_maincpu; // required here because pio_w gets called before machine_reset diff --git a/src/mame/machine/hec2hrp.cpp b/src/mame/machine/hec2hrp.cpp index 3cfd5d26ed3..3ca50e23f17 100644 --- a/src/mame/machine/hec2hrp.cpp +++ b/src/mame/machine/hec2hrp.cpp @@ -813,7 +813,7 @@ void hec2hrp_state::hector_init() m_pot0 = m_pot1 = 0x40; /* for cassette sync */ - m_cassette_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hec2hrp_state::cassette_clock),this)); + m_cassette_timer = timer_alloc(*this, FUNC(hec2hrp_state::cassette_clock)); m_cassette_timer->adjust(attotime::from_msec(100), 0, attotime::from_usec(64));/* => real sync scan speed for 15,624Khz*/ init_sn76477(); /* init R/C values */ diff --git a/src/mame/machine/hp48.cpp b/src/mame/machine/hp48.cpp index d75093aeaf9..586d1f89066 100644 --- a/src/mame/machine/hp48.cpp +++ b/src/mame/machine/hp48.cpp @@ -975,14 +975,14 @@ void hp48_state::base_machine_start(hp48_models model) } /* timers */ - m_1st_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp48_state::timer1_cb), this)); + m_1st_timer = timer_alloc(*this, FUNC(hp48_state::timer1_cb)); m_1st_timer->adjust(attotime::from_hz(16), 0, attotime::from_hz(16)); - m_2nd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp48_state::timer2_cb), this)); + m_2nd_timer = timer_alloc(*this, FUNC(hp48_state::timer2_cb)); m_2nd_timer->adjust(attotime::from_hz(8192), 0, attotime::from_hz(8192)); /* 1ms keyboard polling */ - m_kbd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp48_state::kbd_cb), this)); + m_kbd_timer = timer_alloc(*this, FUNC(hp48_state::kbd_cb)); m_kbd_timer->adjust(attotime::from_msec(1), 0, attotime::from_msec(1)); m_rs232_byte_recv_cb.enregister(*this, FUNC(hp48_state::rs232_byte_recv_cb)); diff --git a/src/mame/machine/hpc3.cpp b/src/mame/machine/hpc3.cpp index c163b5413e3..d7630cc79f5 100644 --- a/src/mame/machine/hpc3.cpp +++ b/src/mame/machine/hpc3.cpp @@ -166,7 +166,7 @@ void hpc3_device::device_start() save_pointer(NAME(m_enet_fifo[ENET_RECV]), 32); save_pointer(NAME(m_enet_fifo[ENET_XMIT]), 40); - m_enet_tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hpc3_device::enet_transmit), this)); + m_enet_tx_timer = timer_alloc(*this, FUNC(hpc3_device::enet_transmit)); } void hpc3_device::device_reset() diff --git a/src/mame/machine/imm6_76.cpp b/src/mame/machine/imm6_76.cpp index db4cdcbd236..1e907c75490 100644 --- a/src/mame/machine/imm6_76.cpp +++ b/src/mame/machine/imm6_76.cpp @@ -29,9 +29,9 @@ intel_imm6_76_device::intel_imm6_76_device( void intel_imm6_76_device::device_start() { - m_cycle_tmr = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(intel_imm6_76_device::cycle_expired), this)); - m_cycle_a_tmr = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(intel_imm6_76_device::cycle_a_expired), this)); - m_prg_tmr = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(intel_imm6_76_device::prg_expired), this)); + m_cycle_tmr = timer_alloc(*this, FUNC(intel_imm6_76_device::cycle_expired)); + m_cycle_a_tmr = timer_alloc(*this, FUNC(intel_imm6_76_device::cycle_a_expired)); + m_prg_tmr = timer_alloc(*this, FUNC(intel_imm6_76_device::prg_expired)); save_item(NAME(m_data)); save_item(NAME(m_di)); diff --git a/src/mame/machine/interpro_ioga.cpp b/src/mame/machine/interpro_ioga.cpp index e2ffcb9156f..a742d2e515c 100644 --- a/src/mame/machine/interpro_ioga.cpp +++ b/src/mame/machine/interpro_ioga.cpp @@ -196,24 +196,24 @@ void interpro_ioga_device::device_start() } // allocate timers - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(interpro_ioga_device::interrupt_check), this)); - m_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(interpro_ioga_device::dma), this)); - m_serial_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(interpro_ioga_device::serial_dma), this)); + m_interrupt_timer = timer_alloc(*this, FUNC(interpro_ioga_device::interrupt_check)); + m_dma_timer = timer_alloc(*this, FUNC(interpro_ioga_device::dma)); + m_serial_dma_timer = timer_alloc(*this, FUNC(interpro_ioga_device::serial_dma)); - m_timer0 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(interpro_ioga_device::timer0), this)); - m_timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(interpro_ioga_device::timer1), this)); + m_timer0 = timer_alloc(*this, FUNC(interpro_ioga_device::timer0)); + m_timer1 = timer_alloc(*this, FUNC(interpro_ioga_device::timer1)); - m_timer_60hz = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(interpro_ioga_device::timer_60hz), this)); + m_timer_60hz = timer_alloc(*this, FUNC(interpro_ioga_device::timer_60hz)); - m_eth_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(interpro_ioga_device::eth_reset), this)); + m_eth_reset_timer = timer_alloc(*this, FUNC(interpro_ioga_device::eth_reset)); } void sapphire_ioga_device::device_start() { interpro_ioga_device::device_start(); - m_timer2 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sapphire_ioga_device::timer2), this)); - m_timer3 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sapphire_ioga_device::timer3), this)); + m_timer2 = timer_alloc(*this, FUNC(sapphire_ioga_device::timer2)); + m_timer3 = timer_alloc(*this, FUNC(sapphire_ioga_device::timer3)); } void interpro_ioga_device::device_reset() diff --git a/src/mame/machine/irobot.cpp b/src/mame/machine/irobot.cpp index 0f041f37e5a..7d9e0507389 100644 --- a/src/mame/machine/irobot.cpp +++ b/src/mame/machine/irobot.cpp @@ -170,7 +170,7 @@ void irobot_state::machine_start() m_statwr = 0; /* set an initial timer to go off on scanline 0 */ - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(irobot_state::scanline_callback), this)); + m_scanline_timer = timer_alloc(*this, FUNC(irobot_state::scanline_callback)); m_scanline_timer->adjust(m_screen->time_until_pos(0)); } diff --git a/src/mame/machine/kc.cpp b/src/mame/machine/kc.cpp index 4d1ebef7004..e0a15547ea8 100644 --- a/src/mame/machine/kc.cpp +++ b/src/mame/machine/kc.cpp @@ -732,8 +732,8 @@ WRITE_LINE_MEMBER( kc_state::keyboard_cb ) void kc_state::machine_start() { - m_cassette_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kc_state::kc_cassette_timer_callback),this)); - m_cassette_oneshot_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(kc_state::kc_cassette_oneshot_timer),this)); + m_cassette_timer = timer_alloc(*this, FUNC(kc_state::kc_cassette_timer_callback)); + m_cassette_oneshot_timer = timer_alloc(*this, FUNC(kc_state::kc_cassette_oneshot_timer)); m_ram_base = m_ram->pointer(); } diff --git a/src/mame/machine/leland.cpp b/src/mame/machine/leland.cpp index 894e9771252..3963c361632 100644 --- a/src/mame/machine/leland.cpp +++ b/src/mame/machine/leland.cpp @@ -306,7 +306,7 @@ void ataxx_state::indyheat_analog_w(offs_t offset, u8 data) void leland_state::machine_start() { /* start scanline interrupts going */ - m_master_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::leland_interrupt_callback),this)); + m_master_int_timer = timer_alloc(*this, FUNC(leland_state::leland_interrupt_callback)); save_item(NAME(m_dac_control)); save_item(NAME(m_wcol_enable)); @@ -365,7 +365,7 @@ void ataxx_state::machine_start() m_extra_tram = std::make_unique<u8[]>(ATAXX_EXTRA_TRAM_SIZE); /* start scanline interrupts going */ - m_master_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::ataxx_interrupt_callback),this)); + m_master_int_timer = timer_alloc(*this, FUNC(leland_state::ataxx_interrupt_callback)); save_item(NAME(m_wcol_enable)); save_item(NAME(m_dial_last_input)); diff --git a/src/mame/machine/lisa.cpp b/src/mame/machine/lisa.cpp index abb6ee2a51f..f41836513c7 100644 --- a/src/mame/machine/lisa.cpp +++ b/src/mame/machine/lisa.cpp @@ -934,10 +934,10 @@ void lisa_state::init_mac_xl() void lisa_state::machine_start() { - m_mouse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(lisa_state::handle_mouse),this)); + m_mouse_timer = timer_alloc(*this, FUNC(lisa_state::handle_mouse)); /* read command every ms (don't know the real value) */ - m_cops_ready_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(lisa_state::set_COPS_ready), this)); + m_cops_ready_timer = timer_alloc(*this, FUNC(lisa_state::set_COPS_ready)); m_cops_ready_timer->adjust(attotime::from_msec(1), 0, attotime::from_msec(1)); m_read_COPS_command.enregister(*this, FUNC(lisa_state::read_COPS_command)); diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp index ee0f8b1eb4d..dc56de8d3f3 100644 --- a/src/mame/machine/mac.cpp +++ b/src/mame/machine/mac.cpp @@ -1093,16 +1093,16 @@ void mac_state::machine_start() { if (m_screen) { - this->m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::mac_scanline_tick),this)); + this->m_scanline_timer = timer_alloc(*this, FUNC(mac_state::mac_scanline_tick)); this->m_scanline_timer->adjust(m_screen->time_until_pos(0, 0)); } else { - m_adbupdate_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::mac_adbrefresh_tick),this)); + m_adbupdate_timer = timer_alloc(*this, FUNC(mac_state::mac_adbrefresh_tick)); m_adbupdate_timer->adjust(attotime::from_hz(70)); } - m_6015_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::mac_6015_tick),this)); + m_6015_timer = timer_alloc(*this, FUNC(mac_state::mac_6015_tick)); m_6015_timer->adjust(attotime::never); } @@ -1303,7 +1303,7 @@ void mac_state::mac_driver_init(model_t model) if ((model == MODEL_MAC_SE) || (model == MODEL_MAC_CLASSIC) || (model == MODEL_MAC_CLASSIC_II) || (model == MODEL_MAC_LC) || (model == MODEL_MAC_COLOR_CLASSIC) || (model >= MODEL_MAC_LC_475 && model <= MODEL_MAC_LC_580) || (model == MODEL_MAC_LC_II) || (model == MODEL_MAC_LC_III) || (model == MODEL_MAC_LC_III_PLUS) || ((m_model >= MODEL_MAC_II) && (m_model <= MODEL_MAC_SE30))) { - m_overlay_timeout = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::overlay_timeout_func),this)); + m_overlay_timeout = timer_alloc(*this, FUNC(mac_state::overlay_timeout_func)); } else { diff --git a/src/mame/machine/macadb.cpp b/src/mame/machine/macadb.cpp index f69c0edefc0..1c70efad1ef 100644 --- a/src/mame/machine/macadb.cpp +++ b/src/mame/machine/macadb.cpp @@ -222,7 +222,7 @@ void macadb_device::device_start() write_adb_data.resolve_safe(); write_adb_irq.resolve_safe(); - this->m_adb_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(macadb_device::mac_adb_tick),this)); + this->m_adb_timer = timer_alloc(*this, FUNC(macadb_device::mac_adb_tick)); this->m_adb_timer->adjust(attotime::never); std::fill(std::begin(m_adb_buffer), std::end(m_adb_buffer), 0); diff --git a/src/mame/machine/macpci.cpp b/src/mame/machine/macpci.cpp index 1f9fe2b4581..5222bc0972a 100644 --- a/src/mame/machine/macpci.cpp +++ b/src/mame/machine/macpci.cpp @@ -113,7 +113,7 @@ WRITE_LINE_MEMBER(macpci_state::mac_adb_via_out_cb2) void macpci_state::machine_start() { - m_6015_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(macpci_state::mac_6015_tick),this)); + m_6015_timer = timer_alloc(*this, FUNC(macpci_state::mac_6015_tick)); m_6015_timer->adjust(attotime::never); } diff --git a/src/mame/machine/mcr.cpp b/src/mame/machine/mcr.cpp index 3b4323d94fe..42cb7022ebb 100644 --- a/src/mame/machine/mcr.cpp +++ b/src/mame/machine/mcr.cpp @@ -86,7 +86,7 @@ void mcr_state::machine_start() void mcr_nflfoot_state::machine_start() { /* allocate a timer for the IPU watchdog */ - m_ipu_watchdog_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mcr_nflfoot_state::ipu_watchdog_reset), this)); + m_ipu_watchdog_timer = timer_alloc(*this, FUNC(mcr_nflfoot_state::ipu_watchdog_reset)); } diff --git a/src/mame/machine/mct_adr.cpp b/src/mame/machine/mct_adr.cpp index 9de43725ea9..f669d8a825a 100644 --- a/src/mame/machine/mct_adr.cpp +++ b/src/mame/machine/mct_adr.cpp @@ -152,9 +152,9 @@ void mct_adr_device::device_start() m_ioc_physical_tag = 0; m_ioc_logical_tag = 0; - m_irq_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mct_adr_device::irq_check), this)); - m_dma_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mct_adr_device::dma_check), this)); - m_interval_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mct_adr_device::interval_timer), this)); + m_irq_check = timer_alloc(*this, FUNC(mct_adr_device::irq_check)); + m_dma_check = timer_alloc(*this, FUNC(mct_adr_device::dma_check)); + m_interval_timer = timer_alloc(*this, FUNC(mct_adr_device::interval_timer)); m_out_int_timer_asserted = false; m_out_int_device_asserted = false; diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp index 75cd4728eb5..19b4789df3f 100644 --- a/src/mame/machine/mega32x.cpp +++ b/src/mame/machine/mega32x.cpp @@ -1734,7 +1734,7 @@ void sega_32x_device::device_start() } m_stream = stream_alloc(2, 2, 48000 * 4); - m_32x_pwm_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega_32x_device::handle_pwm_callback), this)); + m_32x_pwm_timer = timer_alloc(*this, FUNC(sega_32x_device::handle_pwm_callback)); m_32x_dram0 = std::make_unique<uint16_t[]>(0x40000/2); m_32x_dram1 = std::make_unique<uint16_t[]>(0x40000/2); diff --git a/src/mame/machine/microtan.cpp b/src/mame/machine/microtan.cpp index b71982061f5..a93a5bf6314 100644 --- a/src/mame/machine/microtan.cpp +++ b/src/mame/machine/microtan.cpp @@ -365,7 +365,7 @@ void microtan_state::init_microtan() { init_gfx2(); - m_pulse_nmi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(microtan_state::pulse_nmi), this)); + m_pulse_nmi_timer = timer_alloc(*this, FUNC(microtan_state::pulse_nmi)); } void microtan_state::machine_start() diff --git a/src/mame/machine/midwayic.cpp b/src/mame/machine/midwayic.cpp index 8045c6cb69c..0984c1787f6 100644 --- a/src/mame/machine/midwayic.cpp +++ b/src/mame/machine/midwayic.cpp @@ -364,7 +364,7 @@ void midway_serial_pic2_device::device_start() //m_yearoffs = yearoffs; m_time_just_written = 0; - m_time_write_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midway_serial_pic2_device::reset_timer),this)); + m_time_write_timer = timer_alloc(*this, FUNC(midway_serial_pic2_device::reset_timer)); memset(m_default_nvram, 0xff, sizeof(m_default_nvram)); } diff --git a/src/mame/machine/mips_rambo.cpp b/src/mame/machine/mips_rambo.cpp index 017d24fef77..db1eea5a324 100644 --- a/src/mame/machine/mips_rambo.cpp +++ b/src/mame/machine/mips_rambo.cpp @@ -73,9 +73,9 @@ void mips_rambo_device::device_start() ch.write_cb.resolve_safe(); } - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mips_rambo_device::timer), this)); - m_dma = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mips_rambo_device::dma), this)); - m_buzzer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mips_rambo_device::buzzer), this)); + m_timer = timer_alloc(*this, FUNC(mips_rambo_device::timer)); + m_dma = timer_alloc(*this, FUNC(mips_rambo_device::dma)); + m_buzzer = timer_alloc(*this, FUNC(mips_rambo_device::buzzer)); } void mips_rambo_device::device_reset() diff --git a/src/mame/machine/mw8080bw.cpp b/src/mame/machine/mw8080bw.cpp index 9942209eebd..c84289998bf 100644 --- a/src/mame/machine/mw8080bw.cpp +++ b/src/mame/machine/mw8080bw.cpp @@ -89,7 +89,7 @@ IRQ_CALLBACK_MEMBER(mw8080bw_state::interrupt_vector) void mw8080bw_state::mw8080bw_create_interrupt_timer( ) { - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mw8080bw_state::interrupt_trigger),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(mw8080bw_state::interrupt_trigger)); } diff --git a/src/mame/machine/n64.cpp b/src/mame/machine/n64.cpp index 35459505d3b..973333ee16a 100644 --- a/src/mame/machine/n64.cpp +++ b/src/mame/machine/n64.cpp @@ -113,12 +113,12 @@ void n64_periphs::poll_reset_button(bool button) void n64_periphs::device_start() { - ai_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::ai_timer_callback),this)); - pi_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::pi_dma_callback),this)); - si_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::si_dma_callback),this)); - vi_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::vi_scanline_callback),this)); - dp_delay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::dp_delay_callback),this)); - reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::reset_timer_callback),this)); + ai_timer = timer_alloc(*this, FUNC(n64_periphs::ai_timer_callback)); + pi_dma_timer = timer_alloc(*this, FUNC(n64_periphs::pi_dma_callback)); + si_dma_timer = timer_alloc(*this, FUNC(n64_periphs::si_dma_callback)); + vi_scanline_timer = timer_alloc(*this, FUNC(n64_periphs::vi_scanline_callback)); + dp_delay_timer = timer_alloc(*this, FUNC(n64_periphs::dp_delay_callback)); + reset_timer = timer_alloc(*this, FUNC(n64_periphs::reset_timer_callback)); m_n64 = machine().driver_data<n64_state>(); } diff --git a/src/mame/machine/namco06.cpp b/src/mame/machine/namco06.cpp index 37ec9688327..631c18d78c0 100644 --- a/src/mame/machine/namco06.cpp +++ b/src/mame/machine/namco06.cpp @@ -251,7 +251,7 @@ void namco_06xx_device::device_start() m_write.resolve_all_safe(); /* allocate a timer */ - m_nmi_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namco_06xx_device::nmi_generate),this)); + m_nmi_timer = timer_alloc(*this, FUNC(namco_06xx_device::nmi_generate)); save_item(NAME(m_control)); save_item(NAME(m_next_timer_state)); diff --git a/src/mame/machine/namcos21_dsp.cpp b/src/mame/machine/namcos21_dsp.cpp index 14810b43f07..ba1c23d4a2e 100644 --- a/src/mame/machine/namcos21_dsp.cpp +++ b/src/mame/machine/namcos21_dsp.cpp @@ -29,7 +29,7 @@ namcos21_dsp_device::namcos21_dsp_device(const machine_config &mconfig, const ch void namcos21_dsp_device::device_start() { m_winrun_dspcomram = std::make_unique<uint16_t[]>(0x1000*2); - m_suspend_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcos21_dsp_device::suspend_callback),this)); + m_suspend_timer = timer_alloc(*this, FUNC(namcos21_dsp_device::suspend_callback)); m_pointram = std::make_unique<uint8_t[]>(PTRAM_SIZE); m_pointram_idx = 0; diff --git a/src/mame/machine/osborne1.cpp b/src/mame/machine/osborne1.cpp index 0b18cfe1193..340c951cc3e 100644 --- a/src/mame/machine/osborne1.cpp +++ b/src/mame/machine/osborne1.cpp @@ -279,13 +279,13 @@ void osborne1_state::machine_start() m_bank_fxxx->configure_entries(0, 1, m_ram->pointer() + 0xF000, 0); m_bank_fxxx->configure_entries(1, 1, m_ram->pointer() + 0x10000, 0); - m_video_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(osborne1_state::video_callback), this)); + m_video_timer = timer_alloc(*this, FUNC(osborne1_state::video_callback)); m_tilemap = &machine().tilemap().create( *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(osborne1_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 10, 128, 32); - m_acia_rxc_txc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(osborne1_state::acia_rxc_txc_callback), this)); + m_acia_rxc_txc_timer = timer_alloc(*this, FUNC(osborne1_state::acia_rxc_txc_callback)); m_maincpu->space(AS_PROGRAM).cache(m_mem_cache); diff --git a/src/mame/machine/pce_cd.cpp b/src/mame/machine/pce_cd.cpp index 708faaaaff7..a22a1ae4836 100644 --- a/src/mame/machine/pce_cd.cpp +++ b/src/mame/machine/pce_cd.cpp @@ -145,19 +145,19 @@ void pce_cd_device::device_start() m_subcode_buffer = std::make_unique<uint8_t[]>(96); - m_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::data_timer_callback),this)); + m_data_timer = timer_alloc(*this, FUNC(pce_cd_device::data_timer_callback)); m_data_timer->adjust(attotime::never); - m_adpcm_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_dma_timer_callback),this)); + m_adpcm_dma_timer = timer_alloc(*this, FUNC(pce_cd_device::adpcm_dma_timer_callback)); m_adpcm_dma_timer->adjust(attotime::never); - m_cdda_fadeout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::cdda_fadeout_callback),this)); + m_cdda_fadeout_timer = timer_alloc(*this, FUNC(pce_cd_device::cdda_fadeout_callback)); m_cdda_fadeout_timer->adjust(attotime::never); - m_cdda_fadein_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::cdda_fadein_callback),this)); + m_cdda_fadein_timer = timer_alloc(*this, FUNC(pce_cd_device::cdda_fadein_callback)); m_cdda_fadein_timer->adjust(attotime::never); - m_adpcm_fadeout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_fadeout_callback),this)); + m_adpcm_fadeout_timer = timer_alloc(*this, FUNC(pce_cd_device::adpcm_fadeout_callback)); m_adpcm_fadeout_timer->adjust(attotime::never); - m_adpcm_fadein_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_fadein_callback),this)); + m_adpcm_fadein_timer = timer_alloc(*this, FUNC(pce_cd_device::adpcm_fadein_callback)); m_adpcm_fadein_timer->adjust(attotime::never); m_clear_ack.enregister(*this, FUNC(pce_cd_device::clear_ack)); diff --git a/src/mame/machine/rm380z.cpp b/src/mame/machine/rm380z.cpp index 4d8d57a1405..eae9b86cb0f 100644 --- a/src/mame/machine/rm380z.cpp +++ b/src/mame/machine/rm380z.cpp @@ -226,7 +226,7 @@ void rm380z_state::disk_0_control(uint8_t data) void rm380z_state::machine_start() { - m_static_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rm380z_state::static_vblank_timer), this)); + m_static_vblank_timer = timer_alloc(*this, FUNC(rm380z_state::static_vblank_timer)); m_static_vblank_timer->adjust(attotime::from_hz(TIMER_SPEED), 0, attotime::from_hz(TIMER_SPEED)); } diff --git a/src/mame/machine/smartboard.cpp b/src/mame/machine/smartboard.cpp index 376fec96ff6..19e4558b507 100644 --- a/src/mame/machine/smartboard.cpp +++ b/src/mame/machine/smartboard.cpp @@ -78,7 +78,7 @@ tasc_sb30_device::tasc_sb30_device(const machine_config &mconfig, const char *ta void tasc_sb30_device::device_start() { m_out_leds.resolve(); - m_leds_off_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tasc_sb30_device::leds_off_cb), this)); + m_leds_off_timer = timer_alloc(*this, FUNC(tasc_sb30_device::leds_off_cb)); save_item(NAME(m_data)); save_item(NAME(m_position)); diff --git a/src/mame/machine/sms.cpp b/src/mame/machine/sms.cpp index 402d9b8a78b..ad34e021262 100644 --- a/src/mame/machine/sms.cpp +++ b/src/mame/machine/sms.cpp @@ -1048,7 +1048,7 @@ void sms_state::machine_start() } } - m_lphaser_th_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sms_state::lphaser_th_generate),this)); + m_lphaser_th_timer = timer_alloc(*this, FUNC(sms_state::lphaser_th_generate)); save_item(NAME(m_mapper)); save_item(NAME(m_port_dc_reg)); diff --git a/src/mame/machine/starwars.cpp b/src/mame/machine/starwars.cpp index dcaf2205f3a..b9a919fcd32 100644 --- a/src/mame/machine/starwars.cpp +++ b/src/mame/machine/starwars.cpp @@ -115,7 +115,7 @@ void starwars_state::starwars_mproc_init() m_PROM_AM[cnt] = (val >> 7) & 0x0001; } - m_math_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(starwars_state::math_run_clear),this)); + m_math_timer = timer_alloc(*this, FUNC(starwars_state::math_run_clear)); } diff --git a/src/mame/machine/swtpc09.cpp b/src/mame/machine/swtpc09.cpp index c8fba859dc7..d7a2981d210 100644 --- a/src/mame/machine/swtpc09.cpp +++ b/src/mame/machine/swtpc09.cpp @@ -1015,7 +1015,7 @@ void swtpc09_state::machine_start() m_dmaf_high_address[2] = 0; m_dmaf_high_address[3] = 0; - m_floppy_motor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(swtpc09_state::floppy_motor_callback),this)); + m_floppy_motor_timer = timer_alloc(*this, FUNC(swtpc09_state::floppy_motor_callback)); m_floppy_motor_on = 0; // reset the 6844 diff --git a/src/mame/machine/thomflop.cpp b/src/mame/machine/thomflop.cpp index cf52c3a3f6f..d359f555975 100644 --- a/src/mame/machine/thomflop.cpp +++ b/src/mame/machine/thomflop.cpp @@ -1489,7 +1489,7 @@ void thmfc1_device::device_start() { m_data = make_unique_clear<uint8_t[]>(THOM_MAXBUF); - m_floppy_cmd = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thmfc1_device::floppy_cmd_complete_cb), this)); + m_floppy_cmd = timer_alloc(*this, FUNC(thmfc1_device::floppy_cmd_complete_cb)); save_item(NAME(m_op)); save_item(NAME(m_sector)); diff --git a/src/mame/machine/thomson.cpp b/src/mame/machine/thomson.cpp index 01a88fbef5e..be266ca4cb5 100644 --- a/src/mame/machine/thomson.cpp +++ b/src/mame/machine/thomson.cpp @@ -869,7 +869,7 @@ TIMER_CALLBACK_MEMBER(thomson_state::to7_game_update_cb) void thomson_state::to7_game_init() { LOG (( "to7_game_init called\n" )); - m_to7_game_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::to7_game_update_cb),this)); + m_to7_game_timer = timer_alloc(*this, FUNC(thomson_state::to7_game_update_cb)); m_to7_game_timer->adjust(TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD); save_item(NAME(m_to7_game_sound)); save_item(NAME(m_to7_game_mute)); @@ -1592,7 +1592,7 @@ MACHINE_START_MEMBER( thomson_state, mo5 ) to7_floppy_init(); to7_modem_init(); to7_midi_init(); - m_mo5_periodic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::mo5_periodic_cb),this)); + m_mo5_periodic_timer = timer_alloc(*this, FUNC(thomson_state::mo5_periodic_cb)); /* memory */ m_thom_cart_bank = 0; @@ -2415,7 +2415,7 @@ void thomson_state::to9_kbd_reset() void thomson_state::to9_kbd_init() { LOG(( "to9_kbd_init called\n" )); - m_to9_kbd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::to9_kbd_timer_cb),this)); + m_to9_kbd_timer = timer_alloc(*this, FUNC(thomson_state::to9_kbd_timer_cb)); save_item(NAME(m_to9_kbd_parity)); save_item(NAME(m_to9_kbd_intr)); save_item(NAME(m_to9_kbd_in)); @@ -2866,8 +2866,8 @@ void thomson_state::to8_kbd_reset() void thomson_state::to8_kbd_init() { - m_to8_kbd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::to8_kbd_timer_cb),this)); - m_to8_kbd_signal = machine().scheduler().timer_alloc(timer_expired_delegate()); + m_to8_kbd_timer = timer_alloc(*this, FUNC(thomson_state::to8_kbd_timer_cb)); + m_to8_kbd_signal = timer_alloc(); save_item(NAME(m_to8_kbd_ack)); save_item(NAME(m_to8_kbd_data)); save_item(NAME(m_to8_kbd_step)); @@ -4076,7 +4076,7 @@ TIMER_CALLBACK_MEMBER(thomson_state::mo6_game_update_cb) void thomson_state::mo6_game_init() { LOG (( "mo6_game_init called\n" )); - m_to7_game_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::mo6_game_update_cb),this)); + m_to7_game_timer = timer_alloc(*this, FUNC(thomson_state::mo6_game_update_cb)); m_to7_game_timer->adjust(TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD); save_item(NAME(m_to7_game_sound)); save_item(NAME(m_to7_game_mute)); @@ -4380,7 +4380,7 @@ MACHINE_START_MEMBER( thomson_state, mo6 ) to9_palette_init(); to7_modem_init(); to7_midi_init(); - m_mo5_periodic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::mo5_periodic_cb),this)); + m_mo5_periodic_timer = timer_alloc(*this, FUNC(thomson_state::mo5_periodic_cb)); /* memory */ m_thom_cart_bank = 0; @@ -4526,7 +4526,7 @@ void thomson_state::mo5nr_sys_porta_out(uint8_t data) void thomson_state::mo5nr_game_init() { LOG (( "mo5nr_game_init called\n" )); - m_to7_game_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::mo6_game_update_cb),this)); + m_to7_game_timer = timer_alloc(*this, FUNC(thomson_state::mo6_game_update_cb)); m_to7_game_timer->adjust( TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD ); save_item(NAME(m_to7_game_sound)); save_item(NAME(m_to7_game_mute)); @@ -4604,7 +4604,7 @@ MACHINE_START_MEMBER( thomson_state, mo5nr ) to9_palette_init(); to7_modem_init(); to7_midi_init(); - m_mo5_periodic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::mo5_periodic_cb),this)); + m_mo5_periodic_timer = timer_alloc(*this, FUNC(thomson_state::mo5_periodic_cb)); /* memory */ m_thom_cart_bank = 0; diff --git a/src/mame/machine/ti85.cpp b/src/mame/machine/ti85.cpp index 9fd61ab1e68..4e0a350051b 100644 --- a/src/mame/machine/ti85.cpp +++ b/src/mame/machine/ti85.cpp @@ -255,7 +255,7 @@ void ti85_state::machine_start() m_port4_bit0 = 0; m_ti81_port_7_data = 0; - m_ti85_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti85_timer_callback), this)); + m_ti85_timer = timer_alloc(*this, FUNC(ti85_state::ti85_timer_callback)); m_ti85_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256)); space.unmap_write(0x0000, 0x3fff); @@ -360,9 +360,9 @@ MACHINE_START_MEMBER(ti85_state,ti83p) ti85_state::update_ti83p_memory(); - m_ti83_1st_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti83_timer1_callback), this)); + m_ti83_1st_timer = timer_alloc(*this, FUNC(ti85_state::ti83_timer1_callback)); m_ti83_1st_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256)); - m_ti83_2nd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti83_timer2_callback), this)); + m_ti83_2nd_timer = timer_alloc(*this, FUNC(ti85_state::ti83_timer2_callback)); m_ti83_2nd_timer->adjust(attotime::from_hz(512), 0, attotime::from_hz(512)); /* save states and debugging */ @@ -400,9 +400,9 @@ void ti85_state::ti8xpse_init_common() ti85_state::update_ti83pse_memory(); - m_ti83_1st_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti83_timer1_callback), this)); + m_ti83_1st_timer = timer_alloc(*this, FUNC(ti85_state::ti83_timer1_callback)); m_ti83_1st_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256)); - m_ti83_2nd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti83_timer2_callback), this)); + m_ti83_2nd_timer = timer_alloc(*this, FUNC(ti85_state::ti83_timer2_callback)); m_ti83_2nd_timer->adjust(attotime::from_hz(512), 0, attotime::from_hz(512)); m_crystal_timer1 = timer_alloc(CRYSTAL_TIMER1); @@ -472,7 +472,7 @@ MACHINE_START_MEMBER(ti85_state,ti86) membank("bank4")->set_base(m_ti8x_ram.get()); subdevice<nvram_device>("nvram")->set_base(m_ti8x_ram.get(), sizeof(uint8_t)*128*1024); - m_ti85_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ti85_state::ti85_timer_callback), this)); + m_ti85_timer = timer_alloc(*this, FUNC(ti85_state::ti85_timer_callback)); m_ti85_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256)); } diff --git a/src/mame/machine/trs80.cpp b/src/mame/machine/trs80.cpp index 898ff364550..a8cbc9e203e 100644 --- a/src/mame/machine/trs80.cpp +++ b/src/mame/machine/trs80.cpp @@ -356,7 +356,7 @@ void trs80_state::machine_start() m_tape_unit=1; m_reg_load=1; - m_cassette_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(trs80_state::cassette_data_callback),this)); + m_cassette_data_timer = timer_alloc(*this, FUNC(trs80_state::cassette_data_callback)); m_cassette_data_timer->adjust( attotime::zero, 0, attotime::from_hz(11025) ); } diff --git a/src/mame/machine/trs80m3.cpp b/src/mame/machine/trs80m3.cpp index 957dae31c48..4d67fcf250b 100644 --- a/src/mame/machine/trs80m3.cpp +++ b/src/mame/machine/trs80m3.cpp @@ -558,7 +558,7 @@ void trs80m3_state::machine_start() m_start_address = 0; m_old_cassette_val = 0; - m_cassette_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(trs80m3_state::cassette_data_callback),this)); + m_cassette_data_timer = timer_alloc(*this, FUNC(trs80m3_state::cassette_data_callback)); m_cassette_data_timer->adjust( attotime::zero, 0, attotime::from_hz(11025) ); if (!(m_model4 & 6)) // Model 3 leave now return; diff --git a/src/mame/machine/tv955kb.cpp b/src/mame/machine/tv955kb.cpp index 4ad8e08431e..3d5f715e09d 100644 --- a/src/mame/machine/tv955kb.cpp +++ b/src/mame/machine/tv955kb.cpp @@ -40,7 +40,7 @@ void tv955kb_device::device_resolve_objects() void tv955kb_device::device_start() { - m_bell_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tv955kb_device::bell_q8), this)); + m_bell_timer = timer_alloc(*this, FUNC(tv955kb_device::bell_q8)); save_item(NAME(m_bell_on)); diff --git a/src/mame/machine/x68k_hdc.cpp b/src/mame/machine/x68k_hdc.cpp index d3051b8bcb9..c4e5fc3c78c 100644 --- a/src/mame/machine/x68k_hdc.cpp +++ b/src/mame/machine/x68k_hdc.cpp @@ -42,7 +42,7 @@ void x68k_hdc_image_device::device_start() m_status = 0x00; m_status_port = 0x00; m_phase = sasi_phase::BUSFREE; - m_req_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x68k_hdc_image_device::req_timer_callback), this)); + m_req_timer = timer_alloc(*this, FUNC(x68k_hdc_image_device::req_timer_callback)); save_item(NAME(m_phase)); save_item(NAME(m_status_port)); diff --git a/src/mame/machine/xavix.cpp b/src/mame/machine/xavix.cpp index 317e5a3ee9e..b3b5e8f768b 100644 --- a/src/mame/machine/xavix.cpp +++ b/src/mame/machine/xavix.cpp @@ -784,12 +784,12 @@ void xavix_state::machine_start() // don't do this every reset or it breaks the baseball 2 secret mode toggle which flips a bit in RAM std::fill_n(&m_mainram[0], 0x4000 - nvram_size, 0xff); - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(xavix_state::interrupt_gen), this)); - m_freq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(xavix_state::freq_timer_done), this)); + m_interrupt_timer = timer_alloc(*this, FUNC(xavix_state::interrupt_gen)); + m_freq_timer = timer_alloc(*this, FUNC(xavix_state::freq_timer_done)); for (int i = 0; i < 4; i++) { - m_sound_timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(xavix_state::sound_timer_done), this)); + m_sound_timer[i] = timer_alloc(*this, FUNC(xavix_state::sound_timer_done)); } if (m_nvram) diff --git a/src/mame/machine/xavix_adc.cpp b/src/mame/machine/xavix_adc.cpp index 527f6d542e2..42ba3278e33 100644 --- a/src/mame/machine/xavix_adc.cpp +++ b/src/mame/machine/xavix_adc.cpp @@ -33,7 +33,7 @@ void xavix_adc_device::device_start() m_in6_cb.resolve_safe(0xff); m_in7_cb.resolve_safe(0xff); - m_adc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(xavix_adc_device::adc_timer_done), this)); + m_adc_timer = timer_alloc(*this, FUNC(xavix_adc_device::adc_timer_done)); save_item(NAME(m_adc_control)); save_item(NAME(m_adc_inlatch)); diff --git a/src/mame/machine/xavix_madfb_ball.cpp b/src/mame/machine/xavix_madfb_ball.cpp index 48b76ecdc68..c66d193f078 100644 --- a/src/mame/machine/xavix_madfb_ball.cpp +++ b/src/mame/machine/xavix_madfb_ball.cpp @@ -77,7 +77,7 @@ ioport_constructor xavix_madfb_ball_device::device_input_ports() const void xavix_madfb_ball_device::device_start() { m_event_out_cb.resolve_safe(); - m_event_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(xavix_madfb_ball_device::event_timer), this)); + m_event_timer = timer_alloc(*this, FUNC(xavix_madfb_ball_device::event_timer)); } void xavix_madfb_ball_device::device_reset() diff --git a/src/mame/machine/xavix_mtrk_wheel.cpp b/src/mame/machine/xavix_mtrk_wheel.cpp index 7816bf3b06c..110d13f2daf 100644 --- a/src/mame/machine/xavix_mtrk_wheel.cpp +++ b/src/mame/machine/xavix_mtrk_wheel.cpp @@ -75,7 +75,7 @@ ioport_constructor xavix_mtrk_wheel_device::device_input_ports() const void xavix_mtrk_wheel_device::device_start() { m_event_out_cb.resolve_safe(); - m_event_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(xavix_mtrk_wheel_device::event_timer), this)); + m_event_timer = timer_alloc(*this, FUNC(xavix_mtrk_wheel_device::event_timer)); } void xavix_mtrk_wheel_device::device_reset() diff --git a/src/mame/machine/z80ne.cpp b/src/mame/machine/z80ne.cpp index 033a4aeb7e0..c16f13d4ef8 100644 --- a/src/mame/machine/z80ne.cpp +++ b/src/mame/machine/z80ne.cpp @@ -343,8 +343,8 @@ void z80ne_state::machine_start() m_lx383_digits.resolve(); m_lx385_ctrl = 0x1f; - m_cassette_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80ne_state::z80ne_cassette_tc), this)); - m_kbd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z80ne_state::z80ne_kbd_scan), this)); + m_cassette_timer = timer_alloc(*this, FUNC(z80ne_state::z80ne_cassette_tc)); + m_kbd_timer = timer_alloc(*this, FUNC(z80ne_state::z80ne_kbd_scan)); m_kbd_timer->adjust(attotime::from_hz(1000), 0, attotime::from_hz(1000)); } diff --git a/src/mame/video/atarisy2.cpp b/src/mame/video/atarisy2.cpp index 05770e32924..d2445f088cd 100644 --- a/src/mame/video/atarisy2.cpp +++ b/src/mame/video/atarisy2.cpp @@ -78,7 +78,7 @@ const atari_motion_objects_config atarisy2_state::s_mob_config = void atarisy2_state::video_start() { // reset the statics - m_yscroll_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(atarisy2_state::reset_yscroll_callback),this)); + m_yscroll_reset_timer = timer_alloc(*this, FUNC(atarisy2_state::reset_yscroll_callback)); // save states save_item(NAME(m_playfield_tile_bank)); diff --git a/src/mame/video/avgdvg.cpp b/src/mame/video/avgdvg.cpp index 188bf61c4de..bbd229dad15 100644 --- a/src/mame/video/avgdvg.cpp +++ b/src/mame/video/avgdvg.cpp @@ -1285,8 +1285,8 @@ void avgdvg_device_base::device_start() if (!m_vector->started()) throw device_missing_dependencies(); - m_vg_halt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(avgdvg_device_base::vg_set_halt_callback), this)); - m_vg_run_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(avgdvg_device_base::run_state_machine), this)); + m_vg_halt_timer = timer_alloc(*this, FUNC(avgdvg_device_base::vg_set_halt_callback)); + m_vg_run_timer = timer_alloc(*this, FUNC(avgdvg_device_base::run_state_machine)); m_flip_x = m_flip_y = false; diff --git a/src/mame/video/changela.cpp b/src/mame/video/changela.cpp index 5c2f57e3f1f..0d978361f7a 100644 --- a/src/mame/video/changela.cpp +++ b/src/mame/video/changela.cpp @@ -29,7 +29,7 @@ void changela_state::video_start() m_screen->register_screen_bitmap(m_tree0_bitmap); m_screen->register_screen_bitmap(m_tree1_bitmap); - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(changela_state::changela_scanline_callback),this)); + m_scanline_timer = timer_alloc(*this, FUNC(changela_state::changela_scanline_callback)); m_scanline_timer->adjust(m_screen->time_until_pos(30), 30); save_pointer(NAME(m_memory_devices), 4 * 0x800); diff --git a/src/mame/video/dday.cpp b/src/mame/video/dday.cpp index 3643fb5e793..642bb4a4d7e 100644 --- a/src/mame/video/dday.cpp +++ b/src/mame/video/dday.cpp @@ -214,7 +214,7 @@ void dday_state::video_start() m_fg_tilemap->set_transparent_pen(0); m_text_tilemap->set_transparent_pen(0); - m_countdown_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dday_state::countdown_timer_callback), this)); + m_countdown_timer = timer_alloc(*this, FUNC(dday_state::countdown_timer_callback)); start_countdown_timer(); } diff --git a/src/mame/video/dkong.cpp b/src/mame/video/dkong.cpp index 4022a9d1a98..a70ec443e7a 100644 --- a/src/mame/video/dkong.cpp +++ b/src/mame/video/dkong.cpp @@ -937,7 +937,7 @@ VIDEO_START_MEMBER(dkong_state,dkong) { VIDEO_START_CALL_MEMBER(dkong_base); - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dkong_state::scanline_callback),this)); + m_scanline_timer = timer_alloc(*this, FUNC(dkong_state::scanline_callback)); m_scanline_timer->adjust(m_screen->time_until_pos(0)); switch (m_hardware_type) diff --git a/src/mame/video/esripsys.cpp b/src/mame/video/esripsys.cpp index fa83a01c997..b350a41d8d4 100644 --- a/src/mame/video/esripsys.cpp +++ b/src/mame/video/esripsys.cpp @@ -71,8 +71,8 @@ void esripsys_state::video_start() line_buffer[1].priority_buf = std::make_unique<uint8_t[]>(512); /* Create and initialise the HBLANK timers */ - m_hblank_start_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(esripsys_state::hblank_start_callback),this)); - m_hblank_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(esripsys_state::hblank_end_callback),this)); + m_hblank_start_timer = timer_alloc(*this, FUNC(esripsys_state::hblank_start_callback)); + m_hblank_end_timer = timer_alloc(*this, FUNC(esripsys_state::hblank_end_callback)); m_hblank_start_timer->adjust(m_screen->time_until_pos(0, ESRIPSYS_HBLANK_START)); /* Create the sprite scaling table */ diff --git a/src/mame/video/exidy440.cpp b/src/mame/video/exidy440.cpp index 2106e4ac16e..c799daf7f46 100644 --- a/src/mame/video/exidy440.cpp +++ b/src/mame/video/exidy440.cpp @@ -52,8 +52,8 @@ void exidy440_state::video_start() m_local_paletteram = std::make_unique<uint8_t[]>(512 * 2); memset(m_local_paletteram.get(), 0, 512 * 2); - m_beam_firq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(exidy440_state::beam_firq_callback), this)); - m_collide_firq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(exidy440_state::collide_firq_callback), this)); + m_beam_firq_timer = timer_alloc(*this, FUNC(exidy440_state::beam_firq_callback)); + m_collide_firq_timer = timer_alloc(*this, FUNC(exidy440_state::collide_firq_callback)); } diff --git a/src/mame/video/fmtowns.cpp b/src/mame/video/fmtowns.cpp index 8f51245aa95..555a5937767 100644 --- a/src/mame/video/fmtowns.cpp +++ b/src/mame/video/fmtowns.cpp @@ -1499,7 +1499,7 @@ void towns_state::video_start() { m_video.towns_vram_wplane = 0x00; m_video.towns_sprite_page = 0; - m_video.sprite_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(towns_state::towns_sprite_done),this)); + m_video.sprite_timer = timer_alloc(*this, FUNC(towns_state::towns_sprite_done)); m_towns_vblank_end.enregister(*this, FUNC(towns_state::towns_vblank_end)); } diff --git a/src/mame/video/fromance.cpp b/src/mame/video/fromance.cpp index 902f2c4cf1a..abfbfd106f8 100644 --- a/src/mame/video/fromance.cpp +++ b/src/mame/video/fromance.cpp @@ -68,7 +68,7 @@ void fromance_state::init_common( ) m_fg_tilemap->set_transparent_pen(15); /* reset the timer */ - m_crtc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fromance_state::crtc_interrupt_gen),this)); + m_crtc_timer = timer_alloc(*this, FUNC(fromance_state::crtc_interrupt_gen)); /* state save */ save_item(NAME(m_selected_videoram)); diff --git a/src/mame/video/galaxold.cpp b/src/mame/video/galaxold.cpp index 240caa1e34b..d0a55740e8c 100644 --- a/src/mame/video/galaxold.cpp +++ b/src/mame/video/galaxold.cpp @@ -1277,8 +1277,8 @@ void galaxold_state::galaxold_init_stars(int colors_offset) m_stars_on = 0; m_stars_blink_state = 0; - m_stars_blink_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(galaxold_state::stars_blink_callback),this)); - m_stars_scroll_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(galaxold_state::stars_scroll_callback),this)); + m_stars_blink_timer = timer_alloc(*this, FUNC(galaxold_state::stars_blink_callback)); + m_stars_scroll_timer = timer_alloc(*this, FUNC(galaxold_state::stars_scroll_callback)); m_timer_adjusted = 0; m_stars_colors_start = colors_offset; diff --git a/src/mame/video/galaxy.cpp b/src/mame/video/galaxy.cpp index ab6428a993b..d72c474887b 100644 --- a/src/mame/video/galaxy.cpp +++ b/src/mame/video/galaxy.cpp @@ -106,7 +106,7 @@ void galaxy_state::machine_start() { m_gal_cnt = 0; - m_gal_video_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(galaxy_state::gal_video),this)); + m_gal_video_timer = timer_alloc(*this, FUNC(galaxy_state::gal_video)); m_gal_video_timer->adjust(attotime::zero, 0, attotime::never); m_screen->register_screen_bitmap(m_bitmap); diff --git a/src/mame/video/gamecom.cpp b/src/mame/video/gamecom.cpp index 0b1984e019f..9fd86384a47 100644 --- a/src/mame/video/gamecom.cpp +++ b/src/mame/video/gamecom.cpp @@ -68,7 +68,7 @@ TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_scanline) void gamecom_state::video_start() { - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamecom_state::gamecom_scanline),this)); + m_scanline_timer = timer_alloc(*this, FUNC(gamecom_state::gamecom_scanline)); m_scanline_timer->adjust(m_screen->time_until_pos(0), 0, m_screen->scan_period()); m_screen->register_screen_bitmap(m_bitmap); diff --git a/src/mame/video/itech32.cpp b/src/mame/video/itech32.cpp index f6554ee483a..b98a59a4c89 100644 --- a/src/mame/video/itech32.cpp +++ b/src/mame/video/itech32.cpp @@ -194,7 +194,7 @@ void itech32_state::video_start() /* reset statics */ std::fill_n(&m_video[0], m_video.bytes() >> 1, 0); - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(itech32_state::scanline_interrupt),this)); + m_scanline_timer = timer_alloc(*this, FUNC(itech32_state::scanline_interrupt)); m_enable_latch[0] = 1; m_enable_latch[1] = (m_planes > 1) ? 1 : 0; @@ -211,7 +211,7 @@ void itech32_state::video_start() void shoottv_state::video_start() { itech32_state::video_start(); - m_gun_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(shoottv_state::gun_interrupt),this)); + m_gun_timer = timer_alloc(*this, FUNC(shoottv_state::gun_interrupt)); m_gun_timer->adjust(m_screen->time_until_pos(0)); } diff --git a/src/mame/video/k051960.cpp b/src/mame/video/k051960.cpp index 42fa9627bd5..b2bdc898ef9 100644 --- a/src/mame/video/k051960.cpp +++ b/src/mame/video/k051960.cpp @@ -188,7 +188,7 @@ void k051960_device::device_start() m_k051960_cb.resolve(); // allocate scanline timer and start at first scanline - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k051960_device::scanline_callback), this)); + m_scanline_timer = timer_alloc(*this, FUNC(k051960_device::scanline_callback)); m_scanline_timer->adjust(screen().time_until_pos(0)); decode_gfx(); diff --git a/src/mame/video/k1ge.cpp b/src/mame/video/k1ge.cpp index 0dec7b55d8a..8bf53c13721 100644 --- a/src/mame/video/k1ge.cpp +++ b/src/mame/video/k1ge.cpp @@ -795,8 +795,8 @@ void k1ge_device::device_start() m_vblank_pin_w.resolve(); m_hblank_pin_w.resolve(); - m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::timer_callback), this)); - m_hblank_on_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k1ge_device::hblank_on_timer_callback), this)); + m_timer = timer_alloc(*this, FUNC(k1ge_device::timer_callback)); + m_hblank_on_timer = timer_alloc(*this, FUNC(k1ge_device::hblank_on_timer_callback)); m_vram = make_unique_clear<uint8_t[]>(0x4000); m_bitmap = std::make_unique<bitmap_ind16>(screen().width(), screen().height() ); diff --git a/src/mame/video/leland.cpp b/src/mame/video/leland.cpp index e267fff1025..598b5c16648 100644 --- a/src/mame/video/leland.cpp +++ b/src/mame/video/leland.cpp @@ -104,7 +104,7 @@ void leland_state::video_start() m_video_ram = make_unique_clear<u8[]>(VRAM_SIZE); /* scanline timer */ - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::scanline_callback),this)); + m_scanline_timer = timer_alloc(*this, FUNC(leland_state::scanline_callback)); m_scanline_timer->adjust(m_screen->time_until_pos(0)); save_item(NAME(m_gfx_control)); diff --git a/src/mame/video/lockon.cpp b/src/mame/video/lockon.cpp index f3513693800..c063688bf2e 100644 --- a/src/mame/video/lockon.cpp +++ b/src/mame/video/lockon.cpp @@ -873,10 +873,10 @@ void lockon_state::video_start() m_obj_pal_ram = std::make_unique<uint8_t[]>(2048); /* Timer for ground display list callback */ - m_bufend_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(lockon_state::bufend_callback),this)); + m_bufend_timer = timer_alloc(*this, FUNC(lockon_state::bufend_callback)); /* Timer for the CRTC cursor pulse */ - m_cursor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(lockon_state::cursor_callback),this)); + m_cursor_timer = timer_alloc(*this, FUNC(lockon_state::cursor_callback)); m_cursor_timer->adjust(m_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); save_item(NAME(*m_back_buffer)); diff --git a/src/mame/video/mcd212.cpp b/src/mame/video/mcd212.cpp index c6e32759101..8952f457029 100644 --- a/src/mame/video/mcd212.cpp +++ b/src/mame/video/mcd212.cpp @@ -1444,7 +1444,7 @@ void mcd212_device::device_start() screen().register_screen_bitmap(m_bitmap); - m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mcd212_device::perform_scan), this)); + m_scan_timer = timer_alloc(*this, FUNC(mcd212_device::perform_scan)); m_scan_timer->adjust(screen().time_until_pos(0, 0)); save_item(NAME(m_region_flag_0)); diff --git a/src/mame/video/mystston.cpp b/src/mame/video/mystston.cpp index fd2de4361d2..c9ac48dd9a0 100644 --- a/src/mame/video/mystston.cpp +++ b/src/mame/video/mystston.cpp @@ -221,7 +221,7 @@ void mystston_state::video_start() m_fg_tilemap->set_transparent_pen(0); /* create the interrupt timer */ - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mystston_state::interrupt_callback),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(mystston_state::interrupt_callback)); } diff --git a/src/mame/video/n8080.cpp b/src/mame/video/n8080.cpp index 7d7a7147d02..c84feb75c92 100644 --- a/src/mame/video/n8080.cpp +++ b/src/mame/video/n8080.cpp @@ -81,7 +81,7 @@ void helifire_state::next_line() void spacefev_state::video_start() { - m_cannon_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(spacefev_state::stop_red_cannon),this)); + m_cannon_timer = timer_alloc(*this, FUNC(spacefev_state::stop_red_cannon)); flip_screen_set(0); diff --git a/src/mame/video/namcos22.cpp b/src/mame/video/namcos22.cpp index 483acb7ca12..e2438c96fd0 100644 --- a/src/mame/video/namcos22.cpp +++ b/src/mame/video/namcos22.cpp @@ -2572,7 +2572,7 @@ void namcos22_state::video_start() m_is_ss22 = (m_iomcu == nullptr); init_tables(); - m_posirq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcos22_state::posirq_callback),this)); + m_posirq_timer = timer_alloc(*this, FUNC(namcos22_state::posirq_callback)); m_mix_bitmap = std::make_unique<bitmap_ind16>(640, 480); m_bgtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(namcos22_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); diff --git a/src/mame/video/neogeo_spr.cpp b/src/mame/video/neogeo_spr.cpp index f65609a1c93..386497a9058 100644 --- a/src/mame/video/neogeo_spr.cpp +++ b/src/mame/video/neogeo_spr.cpp @@ -151,7 +151,7 @@ TIMER_CALLBACK_MEMBER(neosprite_base_device::auto_animation_timer_callback) void neosprite_base_device::create_auto_animation_timer() { - m_auto_animation_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(neosprite_base_device::auto_animation_timer_callback),this)); + m_auto_animation_timer = timer_alloc(*this, FUNC(neosprite_base_device::auto_animation_timer_callback)); } @@ -536,7 +536,7 @@ TIMER_CALLBACK_MEMBER(neosprite_base_device::sprite_line_timer_callback) void neosprite_base_device::create_sprite_line_timer() { - m_sprite_line_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(neosprite_base_device::sprite_line_timer_callback),this)); + m_sprite_line_timer = timer_alloc(*this, FUNC(neosprite_base_device::sprite_line_timer_callback)); } diff --git a/src/mame/video/nmk16.cpp b/src/mame/video/nmk16.cpp index f48b9207bdf..ca7595c1aeb 100644 --- a/src/mame/video/nmk16.cpp +++ b/src/mame/video/nmk16.cpp @@ -81,7 +81,7 @@ void nmk16_state::video_init() m_bgbank = 0; m_mustang_bg_xscroll = 0; - m_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nmk16_state::dma_callback),this)); + m_dma_timer = timer_alloc(*this, FUNC(nmk16_state::dma_callback)); save_pointer(NAME(m_spriteram_old), 0x1000/2); save_pointer(NAME(m_spriteram_old2), 0x1000/2); save_item(NAME(m_bgbank)); diff --git a/src/mame/video/pastelg.cpp b/src/mame/video/pastelg.cpp index 8753792ff16..4bff0ff5335 100644 --- a/src/mame/video/pastelg.cpp +++ b/src/mame/video/pastelg.cpp @@ -258,7 +258,7 @@ void pastelg_common_state::video_start() m_videoram = make_unique_clear<uint8_t[]>(width * height); - m_blitter_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pastelg_state::blitter_timer_callback), this)); + m_blitter_timer = timer_alloc(*this, FUNC(pastelg_state::blitter_timer_callback)); save_item(NAME(m_blitter_desty)); save_item(NAME(m_blitter_sizex)); diff --git a/src/mame/video/pecom.cpp b/src/mame/video/pecom.cpp index 3c2280c335b..212efb216f4 100644 --- a/src/mame/video/pecom.cpp +++ b/src/mame/video/pecom.cpp @@ -82,6 +82,6 @@ void pecom_state::machine_start() save_item(NAME(m_reset)); save_item(NAME(m_dma)); save_pointer(NAME(m_charram), 0x0800); - m_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pecom_state::reset_tick),this)); + m_reset_timer = timer_alloc(*this, FUNC(pecom_state::reset_tick)); } diff --git a/src/mame/video/powervr2.cpp b/src/mame/video/powervr2.cpp index f96a9bf2702..46ef880a055 100644 --- a/src/mame/video/powervr2.cpp +++ b/src/mame/video/powervr2.cpp @@ -3982,14 +3982,14 @@ void powervr2_device::device_start() computedilated(); -// vbout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(powervr2_device::vbout),this)); -// vbin_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(powervr2_device::vbin),this)); - hbin_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(powervr2_device::hbin),this)); - yuv_timer_end = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(powervr2_device::yuv_convert_end),this)); - - endofrender_timer_isp = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(powervr2_device::endofrender_isp),this)); - endofrender_timer_tsp = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(powervr2_device::endofrender_tsp),this)); - endofrender_timer_video = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(powervr2_device::endofrender_video),this)); +// vbout_timer = timer_alloc(*this, FUNC(powervr2_device::vbout)); +// vbin_timer = timer_alloc(*this, FUNC(powervr2_device::vbin)); + hbin_timer = timer_alloc(*this, FUNC(powervr2_device::hbin)); + yuv_timer_end = timer_alloc(*this, FUNC(powervr2_device::yuv_convert_end)); + + endofrender_timer_isp = timer_alloc(*this, FUNC(powervr2_device::endofrender_isp)); + endofrender_timer_tsp = timer_alloc(*this, FUNC(powervr2_device::endofrender_tsp)); + endofrender_timer_video = timer_alloc(*this, FUNC(powervr2_device::endofrender_video)); m_pvr_dma_irq.enregister(*this, FUNC(powervr2_device::pvr_dma_irq)); m_transfer_opaque_list_irq.enregister(*this, FUNC(powervr2_device::transfer_opaque_list_irq)); diff --git a/src/mame/video/rpunch.cpp b/src/mame/video/rpunch.cpp index 02e7dcfbd28..18b9381ef5e 100644 --- a/src/mame/video/rpunch.cpp +++ b/src/mame/video/rpunch.cpp @@ -77,7 +77,7 @@ VIDEO_START_MEMBER(rpunch_state,rpunch) m_pixmap->fill(0xf, pixmap_rect); /* reset the timer */ - m_crtc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rpunch_state::crtc_interrupt_gen),this)); + m_crtc_timer = timer_alloc(*this, FUNC(rpunch_state::crtc_interrupt_gen)); save_item(NAME(*m_pixmap)); } diff --git a/src/mame/video/segag80v.cpp b/src/mame/video/segag80v.cpp index bc126f72fe4..2bc680c8bc1 100644 --- a/src/mame/video/segag80v.cpp +++ b/src/mame/video/segag80v.cpp @@ -309,7 +309,7 @@ void segag80v_state::sega_generate_vector_list() } // set the drawing end time for this frame - m_draw_end_time = machine().scheduler().time() + attotime(0, IRQ_ATTOS - time_remaining); + m_draw_end_time = machine().time() + attotime(0, IRQ_ATTOS - time_remaining); } diff --git a/src/mame/video/segaic16.cpp b/src/mame/video/segaic16.cpp index 2c060d0c947..ab1e03c206a 100644 --- a/src/mame/video/segaic16.cpp +++ b/src/mame/video/segaic16.cpp @@ -1258,7 +1258,7 @@ void segaic16_video_device::tilemap_init(int which, int type, int colorbase, int info->numpages = 16; info->draw_layer = tilemap_16b_draw_layer; info->reset = tilemap_16b_reset; - info->latch_timer = machine().scheduler().timer_alloc( timer_expired_delegate(FUNC(segaic16_video_device::tilemap_16b_latch_values),this) ); + info->latch_timer = timer_alloc(*this, FUNC(segaic16_video_device::tilemap_16b_latch_values)); break; case TILEMAP_16B_ALT: @@ -1267,7 +1267,7 @@ void segaic16_video_device::tilemap_init(int which, int type, int colorbase, int info->numpages = 16; info->draw_layer = tilemap_16b_draw_layer; info->reset = tilemap_16b_reset; - info->latch_timer = machine().scheduler().timer_alloc( timer_expired_delegate(FUNC(segaic16_video_device::tilemap_16b_latch_values),this) ); + info->latch_timer = timer_alloc(*this, FUNC(segaic16_video_device::tilemap_16b_latch_values)); break; default: diff --git a/src/mame/video/segas32.cpp b/src/mame/video/segas32.cpp index 316b2b05929..0b886dc01bc 100644 --- a/src/mame/video/segas32.cpp +++ b/src/mame/video/segas32.cpp @@ -240,8 +240,8 @@ void segas32_state::device_start() if (!m_gfxdecode->started()) throw device_missing_dependencies(); - m_vblank_end_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(segas32_state::end_of_vblank_int), this)); - m_update_sprites_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(segas32_state::update_sprites), this)); + m_vblank_end_int_timer = timer_alloc(*this, FUNC(segas32_state::end_of_vblank_int)); + m_update_sprites_timer = timer_alloc(*this, FUNC(segas32_state::update_sprites)); /* allocate a copy of spriteram in 32-bit format */ m_spriteram_32bit = std::make_unique<uint32_t[]>(0x20000/4); diff --git a/src/mame/video/seta2.cpp b/src/mame/video/seta2.cpp index 063b5b1b2ce..009632a0084 100644 --- a/src/mame/video/seta2.cpp +++ b/src/mame/video/seta2.cpp @@ -889,7 +889,7 @@ void seta2_state::video_start() m_realtilenumber[i] = i % m_spritegfx->elements(); } - m_raster_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(seta2_state::raster_timer_done), this)); + m_raster_timer = timer_alloc(*this, FUNC(seta2_state::raster_timer_done)); save_pointer(NAME(m_private_spriteram), 0x1000 / 2); } diff --git a/src/mame/video/sgi_re2.cpp b/src/mame/video/sgi_re2.cpp index 76ed188d433..5106de347fb 100644 --- a/src/mame/video/sgi_re2.cpp +++ b/src/mame/video/sgi_re2.cpp @@ -78,7 +78,7 @@ void sgi_re2_device::device_start() set_rdy(true); set_drq(false); - m_step = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sgi_re2_device::step), this)); + m_step = timer_alloc(*this, FUNC(sgi_re2_device::step)); } void sgi_re2_device::device_reset() diff --git a/src/mame/video/sprint8.cpp b/src/mame/video/sprint8.cpp index 724d9f4f1ab..1f09c7b139a 100644 --- a/src/mame/video/sprint8.cpp +++ b/src/mame/video/sprint8.cpp @@ -117,7 +117,7 @@ void sprint8_state::video_start() m_tilemap1->set_scrolly(0, +24); m_tilemap2->set_scrolly(0, +24); - m_collision_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sprint8_state::collision_callback),this)); + m_collision_timer = timer_alloc(*this, FUNC(sprint8_state::collision_callback)); } diff --git a/src/mame/video/starfire.cpp b/src/mame/video/starfire.cpp index b87e215dfd5..57cd247d73f 100644 --- a/src/mame/video/starfire.cpp +++ b/src/mame/video/starfire.cpp @@ -20,7 +20,7 @@ void starfire_base_state::video_start() { m_screen->register_screen_bitmap(m_screen_bitmap); - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(starfire_base_state::scanline_callback),this)); + m_scanline_timer = timer_alloc(*this, FUNC(starfire_base_state::scanline_callback)); m_scanline_timer->adjust(m_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND); /* register for state saving */ diff --git a/src/mame/video/thomson.cpp b/src/mame/video/thomson.cpp index 120f1cf1167..eb285ef840e 100644 --- a/src/mame/video/thomson.cpp +++ b/src/mame/video/thomson.cpp @@ -1202,17 +1202,17 @@ void thomson_state::video_start() m_caps_led.resolve(); - m_thom_video_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); + m_thom_video_timer = timer_alloc(); - m_thom_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::thom_scanline_start),this)); + m_thom_scanline_timer = timer_alloc(*this, FUNC(thomson_state::thom_scanline_start)); m_thom_lightpen_nb = 0; m_thom_lightpen_cb = nullptr; - m_thom_lightpen_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::thom_lightpen_step),this)); + m_thom_lightpen_timer = timer_alloc(*this, FUNC(thomson_state::thom_lightpen_step)); save_item(NAME(m_thom_lightpen_nb)); m_thom_init_cb = nullptr; - m_thom_init_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::thom_set_init),this)); + m_thom_init_timer = timer_alloc(*this, FUNC(thomson_state::thom_set_init)); m_thom_bwidth = 0; m_thom_bheight = 0; diff --git a/src/mame/video/twin16.cpp b/src/mame/video/twin16.cpp index d64d6824edc..7a8f03cbebb 100644 --- a/src/mame/video/twin16.cpp +++ b/src/mame/video/twin16.cpp @@ -447,7 +447,7 @@ void twin16_state::video_start() memset(m_sprite_buffer,0xff,0x800*sizeof(uint16_t)); m_video_register = 0; m_sprite_busy = 0; - m_sprite_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(twin16_state::sprite_tick),this)); + m_sprite_timer = timer_alloc(*this, FUNC(twin16_state::sprite_tick)); m_sprite_timer->adjust(attotime::never); /* register for savestates */ diff --git a/src/mame/video/tx1.cpp b/src/mame/video/tx1.cpp index 08b74e80462..84310c89b24 100644 --- a/src/mame/video/tx1.cpp +++ b/src/mame/video/tx1.cpp @@ -1103,7 +1103,7 @@ VIDEO_START_MEMBER(tx1_state,tx1) m_rod_bmp = std::make_unique<uint8_t[]>(256 * 3 * 240); /* Set a timer to run the interrupts */ - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx1_state::interrupt_callback),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(tx1_state::interrupt_callback)); /* /CUDISP CRTC interrupt */ m_interrupt_timer->adjust(m_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); @@ -2987,7 +2987,7 @@ VIDEO_START_MEMBER(tx1_state,buggyboy) m_rod_bmp = std::make_unique<uint8_t[]>(3 * 256 * 240); /* Set a timer to run the interrupts */ - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx1_state::interrupt_callback),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(tx1_state::interrupt_callback)); /* /CUDISP CRTC interrupt */ m_interrupt_timer->adjust(m_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); @@ -3001,7 +3001,7 @@ VIDEO_START_MEMBER(tx1_state,buggybjr) m_rod_bmp = std::make_unique<uint8_t[]>(256 * 240); /* Set a timer to run the interrupts */ - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx1_state::interrupt_callback),this)); + m_interrupt_timer = timer_alloc(*this, FUNC(tx1_state::interrupt_callback)); /* /CUDISP CRTC interrupt */ m_interrupt_timer->adjust(m_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); diff --git a/src/mame/video/victory.cpp b/src/mame/video/victory.cpp index c8179b29e18..d5ac009f660 100644 --- a/src/mame/video/victory.cpp +++ b/src/mame/video/victory.cpp @@ -47,8 +47,8 @@ void victory_state::video_start() m_scrollx = m_scrolly = 0; m_video_control = 0; memset(&m_micro, 0, sizeof(m_micro)); - m_micro.timer = machine().scheduler().timer_alloc(timer_expired_delegate()); - m_bgcoll_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(victory_state::bgcoll_irq_callback), this)); + m_micro.timer = timer_alloc(); + m_bgcoll_irq_timer = timer_alloc(*this, FUNC(victory_state::bgcoll_irq_callback)); /* register for state saving */ save_item(NAME(m_paletteram)); diff --git a/src/mame/video/vtvideo.cpp b/src/mame/video/vtvideo.cpp index 7480691e83b..afc3ebfc272 100644 --- a/src/mame/video/vtvideo.cpp +++ b/src/mame/video/vtvideo.cpp @@ -111,11 +111,11 @@ void vt100_video_device::device_start() m_write_lba7.resolve_safe(); // LBA7 is scan line frequency update - m_lba7_change_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vt100_video_device::lba7_change), this)); + m_lba7_change_timer = timer_alloc(*this, FUNC(vt100_video_device::lba7_change)); m_lba7_change_timer->adjust(clocks_to_attotime(765), 0, clocks_to_attotime(765)); // LBA3 and LBA4 are first two stages of divide-by-17 counter - m_lba3_change_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vt100_video_device::lba3_change), this)); + m_lba3_change_timer = timer_alloc(*this, FUNC(vt100_video_device::lba3_change)); screen().register_vblank_callback(vblank_state_delegate(&vt100_video_device::vblank_callback, this)); diff --git a/src/mame/video/x68k_crtc.cpp b/src/mame/video/x68k_crtc.cpp index 70453f92b53..77cf78c189a 100644 --- a/src/mame/video/x68k_crtc.cpp +++ b/src/mame/video/x68k_crtc.cpp @@ -70,11 +70,11 @@ void x68k_crtc_device::device_resolve_objects() void x68k_crtc_device::device_start() { - m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x68k_crtc_device::hsync), this)); - m_operation_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x68k_crtc_device::operation_end), this)); - m_raster_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x68k_crtc_device::raster_end), this)); - m_raster_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x68k_crtc_device::raster_irq), this)); - m_vblank_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x68k_crtc_device::vblank_irq), this)); + m_scanline_timer = timer_alloc(*this, FUNC(x68k_crtc_device::hsync)); + m_operation_end_timer = timer_alloc(*this, FUNC(x68k_crtc_device::operation_end)); + m_raster_end_timer = timer_alloc(*this, FUNC(x68k_crtc_device::raster_end)); + m_raster_irq_timer = timer_alloc(*this, FUNC(x68k_crtc_device::raster_irq)); + m_vblank_irq_timer = timer_alloc(*this, FUNC(x68k_crtc_device::vblank_irq)); // save state save_item(NAME(m_reg)); diff --git a/src/osd/osdnet.cpp b/src/osd/osdnet.cpp index b90a139731c..cb2d4d4e6e6 100644 --- a/src/osd/osdnet.cpp +++ b/src/osd/osdnet.cpp @@ -38,7 +38,7 @@ class osd_netdev *open_netdev(int id, class device_network_interface *ifdev, int osd_netdev::osd_netdev(class device_network_interface *ifdev, int rate) { m_dev = ifdev; - m_timer = ifdev->device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(osd_netdev::recv), this)); + m_timer = ifdev->device().timer_alloc(*this, FUNC(osd_netdev::recv)); m_timer->adjust(attotime::from_hz(rate), 0, attotime::from_hz(rate)); } |