summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/timer.c
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2012-09-25 08:08:26 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2012-09-25 08:08:26 +0000
commit03bb4528a0b3a2265c455c068ad189c44a8723a9 (patch)
tree4849a62e3ee83fd6e60168de1006e0b7ce4fe77e /src/emu/timer.c
parenta68624339fd92b85cc8bd519d37d5108da9a1fae (diff)
timer - made member calls work (no whatsnew)
Diffstat (limited to 'src/emu/timer.c')
-rw-r--r--src/emu/timer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/emu/timer.c b/src/emu/timer.c
index e92cf0ba0af..5fdf6f06e7a 100644
--- a/src/emu/timer.c
+++ b/src/emu/timer.c
@@ -226,6 +226,8 @@ void timer_device::device_start()
// allocate the timer
m_timer = timer_alloc();
+ m_callback.bind_relative_to(*owner());
+
// register for save states
save_item(NAME(m_first_time));
}
@@ -299,7 +301,8 @@ void timer_device::device_timer(emu_timer &timer, device_timer_id id, int param,
{
// call the real callback
int vpos = m_screen->vpos();
- (m_callback)(*this, m_ptr, vpos);
+ if (!m_callback.isnull())
+ (m_callback)(*this, m_ptr, vpos);
// advance by the increment only if we will still be within the screen bounds
if (m_increment != 0 && (vpos + m_increment) < m_screen->height())