summaryrefslogtreecommitdiffstats
path: root/src/mame/machine/electron.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/electron.cpp')
-rw-r--r--src/mame/machine/electron.cpp33
1 files changed, 8 insertions, 25 deletions
diff --git a/src/mame/machine/electron.cpp b/src/mame/machine/electron.cpp
index 2bd23ed3a57..32d92743410 100644
--- a/src/mame/machine/electron.cpp
+++ b/src/mame/machine/electron.cpp
@@ -24,26 +24,12 @@ void electron_state::waitforramsync()
m_maincpu->adjust_icount(-cycles);
}
-
-void electron_state::device_timer(emu_timer &timer, device_timer_id id, int param)
+TIMER_CALLBACK_MEMBER(electron_state::setup_beep)
{
- switch (id)
- {
- case TIMER_TAPE_HANDLER:
- electron_tape_timer_handler(param);
- break;
- case TIMER_SETUP_BEEP:
- setup_beep(param);
- break;
- case TIMER_SCANLINE_INTERRUPT:
- electron_scanline_interrupt(param);
- break;
- default:
- throw emu_fatalerror("Unknown id in electron_state::device_timer");
- }
+ m_beeper->set_state( 0 );
+ m_beeper->set_clock( 300 );
}
-
void electron_state::electron_tape_start()
{
if (m_ula.tape_running )
@@ -583,20 +569,14 @@ void electron_state::electron_interrupt_handler(int mode, int interrupt)
Machine Initialisation functions
***************************************/
-TIMER_CALLBACK_MEMBER(electron_state::setup_beep)
-{
- m_beeper->set_state( 0 );
- m_beeper->set_clock( 300 );
-}
-
void electron_state::machine_start()
{
m_capslock_led.resolve();
m_ula.interrupt_status = 0x82;
m_ula.interrupt_control = 0x00;
- timer_set(attotime::zero, TIMER_SETUP_BEEP);
- m_tape_timer = timer_alloc(TIMER_TAPE_HANDLER);
+ m_tape_timer = timer_alloc(FUNC(electron_state::electron_tape_timer_handler), this);
+ m_beep_timer = timer_alloc(FUNC(electron_state::setup_beep), this);
/* register save states */
save_item(STRUCT_MEMBER(m_ula, interrupt_status));
@@ -630,6 +610,9 @@ void electron_state::machine_reset()
m_mrb_mapped = true;
m_vdu_drivers = false;
+
+ m_tape_timer->adjust(attotime::never);
+ m_beep_timer->adjust(attotime::never);
}
void electronsp_state::machine_start()