Previous 199869 Revisions Next

r18135 Tuesday 25th September, 2012 at 08:08:26 UTC by Miodrag Milanović
timer - made member calls work (no whatsnew)
[src/emu]timer.c timer.h

trunk/src/emu/timer.c
r18134r18135
226226   // allocate the timer
227227   m_timer = timer_alloc();
228228
229   m_callback.bind_relative_to(*owner());
230
229231   // register for save states
230232   save_item(NAME(m_first_time));
231233}
r18134r18135
299301         {
300302            // call the real callback
301303            int vpos = m_screen->vpos();
302            (m_callback)(*this, m_ptr, vpos);
304            if (!m_callback.isnull())
305               (m_callback)(*this, m_ptr, vpos);
303306
304307            // advance by the increment only if we will still be within the screen bounds
305308              if (m_increment != 0 && (vpos + m_increment) < m_screen->height())
trunk/src/emu/timer.h
r18134r18135
7878
7979#define MCFG_TIMER_DRIVER_ADD(_tag, _class, _callback) \
8080   MCFG_DEVICE_ADD(_tag, TIMER, 0) \
81   timer_device::static_configure_generic(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL)); \
81   timer_device::static_configure_generic(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL, (_class *)0)); \
8282
8383#define MCFG_TIMER_DRIVER_ADD_PERIODIC(_tag, _class, _callback, _period) \
8484   MCFG_DEVICE_ADD(_tag, TIMER, 0) \
85   timer_device::static_configure_periodic(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL), _period); \
85   timer_device::static_configure_periodic(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL, (_class *)0), _period); \
8686
8787#define MCFG_TIMER_DRIVER_ADD_SCANLINE(_tag, _class, _callback, _screen, _first_vpos, _increment) \
8888   MCFG_DEVICE_ADD(_tag, TIMER, 0) \
89   timer_device::static_configure_scanline(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL), _screen, _first_vpos, _increment); \
89   timer_device::static_configure_scanline(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL, (_class *)0), _screen, _first_vpos, _increment); \
9090
9191#define MCFG_TIMER_MODIFY(_tag) \
9292   MCFG_DEVICE_MODIFY(_tag)
r18134r18135
9595   timer_device::static_set_callback(*device, timer_device_expired_delegate(&_callback, #_callback)); \
9696
9797#define MCFG_TIMER_DRIVER_CALLBACK(_class, _callback) \
98   timer_device::static_set_callback(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL)); \
98   timer_device::static_set_callback(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, NULL, (_class *)0)); \
9999
100100#define MCFG_TIMER_START_DELAY(_start_delay) \
101101   timer_device::static_set_start_delay(*device, _start_delay); \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team