summaryrefslogtreecommitdiffstats
path: root/src/mame/machine/megadriv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/megadriv.cpp')
-rw-r--r--src/mame/machine/megadriv.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mame/machine/megadriv.cpp b/src/mame/machine/megadriv.cpp
index 3f4d649db2c..f7513e21b51 100644
--- a/src/mame/machine/megadriv.cpp
+++ b/src/mame/machine/megadriv.cpp
@@ -649,7 +649,7 @@ void md_base_state::megadriv_68k_req_z80_bus(offs_t offset, uint16_t data, uint1
/* If the z80 is running, sync the z80 execution state */
if (!m_genz80.z80_is_reset)
- machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(md_base_state::megadriv_z80_run_state),this));
+ m_genz80.z80_run_timer->adjust(attotime::zero);
}
void md_base_state::megadriv_68k_req_z80_reset(offs_t offset, uint16_t data, uint16_t mem_mask)
@@ -693,7 +693,7 @@ void md_base_state::megadriv_68k_req_z80_reset(offs_t offset, uint16_t data, uin
m_genz80.z80_is_reset = 1;
}
}
- machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(md_base_state::megadriv_z80_run_state),this));
+ m_genz80.z80_run_timer->adjust(attotime::zero);
}
@@ -824,6 +824,9 @@ void md_base_state::machine_start()
save_item(NAME(m_megadrive_io_data_regs));
save_item(NAME(m_megadrive_io_ctrl_regs));
save_item(NAME(m_megadrive_io_tx_regs));
+
+ if (m_z80snd)
+ m_genz80.z80_run_timer = timer_alloc(FUNC(md_base_state::megadriv_z80_run_state), this);
}
void md_base_state::machine_reset()
@@ -837,7 +840,7 @@ void md_base_state::machine_reset()
m_genz80.z80_has_bus = 1;
m_genz80.z80_bank_addr = 0;
m_vdp->set_scanline_counter(-1);
- machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(md_base_state::megadriv_z80_run_state),this));
+ m_genz80.z80_run_timer->adjust(attotime::zero);
}
megadrive_reset_io();