trunk/src/emu/timer.c
| r18134 | r18135 | |
| 226 | 226 | // allocate the timer |
| 227 | 227 | m_timer = timer_alloc(); |
| 228 | 228 | |
| 229 | m_callback.bind_relative_to(*owner()); |
| 230 | |
| 229 | 231 | // register for save states |
| 230 | 232 | save_item(NAME(m_first_time)); |
| 231 | 233 | } |
| r18134 | r18135 | |
| 299 | 301 | { |
| 300 | 302 | // call the real callback |
| 301 | 303 | int vpos = m_screen->vpos(); |
| 302 | | (m_callback)(*this, m_ptr, vpos); |
| 304 | if (!m_callback.isnull()) |
| 305 | (m_callback)(*this, m_ptr, vpos); |
| 303 | 306 | |
| 304 | 307 | // advance by the increment only if we will still be within the screen bounds |
| 305 | 308 | if (m_increment != 0 && (vpos + m_increment) < m_screen->height()) |
trunk/src/emu/timer.h
| r18134 | r18135 | |
| 78 | 78 | |
| 79 | 79 | #define MCFG_TIMER_DRIVER_ADD(_tag, _class, _callback) \ |
| 80 | 80 | 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)); \ |
| 82 | 82 | |
| 83 | 83 | #define MCFG_TIMER_DRIVER_ADD_PERIODIC(_tag, _class, _callback, _period) \ |
| 84 | 84 | 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); \ |
| 86 | 86 | |
| 87 | 87 | #define MCFG_TIMER_DRIVER_ADD_SCANLINE(_tag, _class, _callback, _screen, _first_vpos, _increment) \ |
| 88 | 88 | 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); \ |
| 90 | 90 | |
| 91 | 91 | #define MCFG_TIMER_MODIFY(_tag) \ |
| 92 | 92 | MCFG_DEVICE_MODIFY(_tag) |
| r18134 | r18135 | |
| 95 | 95 | timer_device::static_set_callback(*device, timer_device_expired_delegate(&_callback, #_callback)); \ |
| 96 | 96 | |
| 97 | 97 | #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)); \ |
| 99 | 99 | |
| 100 | 100 | #define MCFG_TIMER_START_DELAY(_start_delay) \ |
| 101 | 101 | timer_device::static_set_start_delay(*device, _start_delay); \ |