diff options
author | 2011-02-06 07:15:01 +0000 | |
---|---|---|
committer | 2011-02-06 07:15:01 +0000 | |
commit | 0e627f1a5443528526eb35ec3a9cb7fb9e5af907 (patch) | |
tree | 3b44469d96597a98080accaec1bccbbad3815acc /src/emu/machine/6850acia.c | |
parent | f38d3384b648811571b50acd16709ae47becaabd (diff) |
Convert emu_timers to objects. Move implementation and management of
timers into the scheduler. Retain TIMER devices as a separate wrapper
in timer.c/.h. Inline wrappers are currently provided for all timer
operations; a future update will bulk clean these up.
Rather than using macros which hide generation of a string-ified name
for callback functions, the new methods require passing both a function
pointer plus a name string. A new macro FUNC() can be used to output
both, and another macro MFUNC() can be used to output a stub-wrapped
class member as a callback.
Also added a time() method on the machine, so that machine->time() gives
the current emulated time. A wrapper for timer_get_time is currently
provided but will be bulk replaced in the future.
For this update, convert all classic timer_alloc, timer_set,
timer_pulse, and timer_call_after_resynch calls into method calls on
the scheduler.
For new device timers, added methods to the device_t class that make
creating and managing these much simpler. Modern devices were updated
to use these.
Here are the regexes used; some manual cleanup (compiler-caught) will
be needed since regex doesn't handle nested parentheses cleanly
1. Convert timer_call_after_resynch calls
timer_call_after_resynch( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().synchronize\1\(\2FUNC(\6), \5, \4\)
2. Clean up trailing 0, NULL parameters
(synchronize[^;]+), 0, NULL\)
\1)
3. Clean up trailing NULL parameters
(synchronize[^;]+), NULL\)
\1)
4. Clean up completely empty parameter lists
synchronize\(FUNC\(NULL\)\)
synchronize()
5. Convert timer_set calls
timer_set( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().timer_set\1\(\2\4, FUNC(\7), \6, \5\)
6. Clean up trailing 0, NULL parameters
(timer_set[^;]+), 0, NULL\)
\1)
7. Clean up trailing NULL parameters
(timer_set[^;]+), NULL\)
\1)
8. Convert timer_set calls
timer_pulse( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().timer_pulse\1\(\2\4, FUNC(\7), \6, \5\)
9. Clean up trailing 0, NULL parameters
(timer_pulse[^;]+), 0, NULL\)
\1)
10. Clean up trailing NULL parameters
(timer_pulse[^;]+), NULL\)
\1)
11. Convert timer_alloc calls
timer_alloc( *)\(( *)([^,;]+), *([^,;]+), *([^);]+)\)
\3->scheduler().timer_alloc\1\(\2FUNC(\4), \5\)
12. Clean up trailing NULL parameters
(timer_alloc[^;]+), NULL\)
\1)
13. Clean up trailing 0 parameters
(timer_alloc[^;]+), 0\)
\1)
14. Fix oddities introduced
\&m_machine->scheduler()
m_machine.scheduler()
Diffstat (limited to 'src/emu/machine/6850acia.c')
-rw-r--r-- | src/emu/machine/6850acia.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/emu/machine/6850acia.c b/src/emu/machine/6850acia.c index 5bbe021d3a5..31c8498e3f0 100644 --- a/src/emu/machine/6850acia.c +++ b/src/emu/machine/6850acia.c @@ -116,8 +116,8 @@ void acia6850_device::device_start() m_tx_clock = m_config.m_tx_clock; m_tx_counter = 0; m_rx_counter = 0; - m_rx_timer = timer_alloc(&m_machine, receive_event_callback, (void *)this); - m_tx_timer = timer_alloc(&m_machine, transmit_event_callback, (void *)this); + m_rx_timer = m_machine.scheduler().timer_alloc(FUNC(receive_event_callback), (void *)this); + m_tx_timer = m_machine.scheduler().timer_alloc(FUNC(transmit_event_callback), (void *)this); m_first_reset = 1; m_status_read = 0; m_brk = 0; |