diff options
author | 2010-09-17 13:33:27 +0000 | |
---|---|---|
committer | 2010-09-17 13:33:27 +0000 | |
commit | 1a066df97d68010ec0b332c696ead694dea51d0f (patch) | |
tree | e95d1f01b698400f89e4e7ce90c96fb54f3a73de /src/emu/devintrf.h | |
parent | 893c1f3e81f86921eaa27c48adf994f8a1c9d538 (diff) |
Added an integral device_timer_id to device timers. This is a
cleaner way to differentiate between multiple timers rather than
relying on the pointers. These values are also saved with the
timers. Updated the few devices using device timers to leverage
this.
Added new function device_timer_call_after_resynch() which creates
a temporary 0-length timer that calls back through the device's
device_timer() method with a given device_timer_id.
Updated i8257_device to initialize its state and use device
timers.
(Fixes 04032: All sets in dkong.c: [debug] Game does not start.)
Diffstat (limited to 'src/emu/devintrf.h')
-rw-r--r-- | src/emu/devintrf.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/emu/devintrf.h b/src/emu/devintrf.h index e4330d19fba..59cf5628647 100644 --- a/src/emu/devintrf.h +++ b/src/emu/devintrf.h @@ -137,6 +137,10 @@ class device_missing_dependencies : public emu_exception { }; typedef device_config *(*device_type)(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); +// timer IDs for devices +typedef UINT32 device_timer_id; + + // read/write types for I/O lines (similar to read/write handlers but no offset) typedef int (*read_line_device_func)(device_t *device); typedef void (*write_line_device_func)(device_t *device, int state); @@ -425,7 +429,7 @@ public: void set_clock_scale(double clockscale); attotime clocks_to_attotime(UINT64 clocks) const; UINT64 attotime_to_clocks(attotime duration) const; - void timer_fired(emu_timer &timer, int param, void *ptr) { device_timer(timer, param, ptr); } + void timer_fired(emu_timer &timer, device_timer_id id, int param, void *ptr) { device_timer(timer, id, param, ptr); } // debugging device_debug *debug() const { return m_debug; } @@ -460,7 +464,7 @@ protected: virtual void device_post_load(); virtual void device_clock_changed(); virtual void device_debug_setup(); - virtual void device_timer(emu_timer &timer, int param, void *ptr); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); //------------------- end derived class overrides |