diff options
Diffstat (limited to 'src/emu/diexec.cpp')
-rw-r--r-- | src/emu/diexec.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/emu/diexec.cpp b/src/emu/diexec.cpp index ac72ce768d7..02684095b04 100644 --- a/src/emu/diexec.cpp +++ b/src/emu/diexec.cpp @@ -272,7 +272,7 @@ void device_execute_interface::spin_until_time(const attotime &duration) suspend_until_trigger(TRIGGER_SUSPENDTIME + timetrig, true); // then set a timer for it - m_scheduler->timer_set(duration, FUNC(static_timed_trigger_callback), TRIGGER_SUSPENDTIME + timetrig, this); + m_scheduler->timer_set(duration, timer_expired_delegate(FUNC(device_execute_interface::timed_trigger_callback),this), TRIGGER_SUSPENDTIME + timetrig, this); timetrig = (timetrig + 1) % 256; } @@ -484,7 +484,7 @@ void device_execute_interface::interface_pre_start() // allocate timers if we need them if (m_timed_interrupt_period != attotime::zero) - m_timedint_timer = m_scheduler->timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this); + m_timedint_timer = m_scheduler->timer_alloc(timer_expired_delegate(FUNC(device_execute_interface::trigger_periodic_interrupt), this)); } @@ -653,10 +653,9 @@ attoseconds_t device_execute_interface::minimum_quantum() const // trigger //------------------------------------------------- -TIMER_CALLBACK( device_execute_interface::static_timed_trigger_callback ) +TIMER_CALLBACK_MEMBER( device_execute_interface::timed_trigger_callback ) { - device_execute_interface *device = reinterpret_cast<device_execute_interface *>(ptr); - device->trigger(param); + trigger(param); } @@ -681,16 +680,11 @@ void device_execute_interface::on_vblank(screen_device &screen, bool vblank_stat //------------------------------------------------- -// static_trigger_periodic_interrupt - timer +// trigger_periodic_interrupt - timer // callback for timed interrupts //------------------------------------------------- -TIMER_CALLBACK( device_execute_interface::static_trigger_periodic_interrupt ) -{ - reinterpret_cast<device_execute_interface *>(ptr)->trigger_periodic_interrupt(); -} - -void device_execute_interface::trigger_periodic_interrupt() +TIMER_CALLBACK_MEMBER(device_execute_interface::trigger_periodic_interrupt) { // bail if there is no routine if (!suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE | SUSPEND_REASON_CLOCK)) @@ -781,7 +775,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag(), m_linen if (event_index >= ARRAY_LENGTH(m_queue)) { m_qindex--; - empty_event_queue(); + empty_event_queue(nullptr,0); event_index = m_qindex++; m_execute->device().logerror("Exceeded pending input line event queue on device '%s'!\n", m_execute->device().tag()); } @@ -795,7 +789,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag(), m_linen // if this is the first one, set the timer if (event_index == 0) - m_execute->scheduler().synchronize(FUNC(static_empty_event_queue), 0, (void *)this); + m_execute->scheduler().synchronize(timer_expired_delegate(FUNC(device_execute_interface::device_input::empty_event_queue),this), 0, this); } } @@ -804,12 +798,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_execute->device().tag(), m_linen // empty_event_queue - empty our event queue //------------------------------------------------- -TIMER_CALLBACK( device_execute_interface::device_input::static_empty_event_queue ) -{ - reinterpret_cast<device_input *>(ptr)->empty_event_queue(); -} - -void device_execute_interface::device_input::empty_event_queue() +TIMER_CALLBACK_MEMBER(device_execute_interface::device_input::empty_event_queue) { if (TEMPLOG) printf("empty_queue(%s,%d,%d)\n", m_execute->device().tag(), m_linenum, m_qindex); // loop over all events |