diff options
author | Aaron Giles <aaron@aarongiles.com> | 2011-02-03 09:06:34 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2011-02-03 09:06:34 +0000 |
commit | f534d245c02059be44071e9c37f38497f12f67f8 (patch) | |
tree | b7b724026e8005bed1a42de7b3b6ea72178e4554 /src/emu/timer.c | |
parent | 1e88333178b63ee0d5b914e181b19b3b161f807b (diff) |
Attotime bulk conversion step:
attotime_zero => attotime::zero
attotime_never => attotime::never
ATTOTIME_IN_SEC(s) => attotime::from_seconds(s)
ATTOTIME_IN_MSEC(m) => attotime::from_msec(m)
ATTOTIME_IN_USEC(u) => attotime::from_usec(u)
ATTOTIME_IN_NSEC(n) => attotime::from_nsec(n)
ATTOTIME_IN_HZ(h) => attotime::from_hz(h)
Also, changed the following MCFG macros to require a full
attotime specification:
MCFG_TIMER_ADD_PERIODIC
MCFG_QUANTUM_TIME
MCFG_WATCHDOG_TIME_INIT
Diffstat (limited to 'src/emu/timer.c')
-rw-r--r-- | src/emu/timer.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/emu/timer.c b/src/emu/timer.c index 0c82b1d8a43..e93a85fbd87 100644 --- a/src/emu/timer.c +++ b/src/emu/timer.c @@ -173,7 +173,7 @@ INLINE emu_timer *timer_new(running_machine *machine) INLINE void timer_list_insert(emu_timer *timer) { - attotime expire = timer->enabled ? timer->expire : attotime_never; + attotime expire = timer->enabled ? timer->expire : attotime::never; timer_private *global = timer->machine->timer_data; emu_timer *t, *lt = NULL; @@ -281,8 +281,8 @@ void timer_init(running_machine *machine) global = machine->timer_data = auto_alloc_clear(machine, timer_private); /* we need to wait until the first call to timer_cyclestorun before using real CPU times */ - global->exec.basetime = attotime_zero; - global->exec.nextfire = attotime_never; + global->exec.basetime = attotime::zero; + global->exec.nextfire = attotime::never; global->exec.curquantum = DEFAULT_MINIMUM_QUANTUM; global->callback_timer = NULL; global->callback_timer_modified = FALSE; @@ -303,7 +303,7 @@ void timer_init(running_machine *machine) /* reset the quanta */ global->quantum_list[0].requested = DEFAULT_MINIMUM_QUANTUM; global->quantum_list[0].actual = DEFAULT_MINIMUM_QUANTUM; - global->quantum_list[0].expire = attotime_never; + global->quantum_list[0].expire = attotime::never; global->quantum_current = &global->quantum_list[0]; global->quantum_minimum = ATTOSECONDS_IN_NSEC(1) / 1000; } @@ -616,7 +616,7 @@ INLINE emu_timer *_timer_alloc_common(running_machine *machine, device_t *device timer->param = 0; timer->enabled = FALSE; timer->temporary = temp; - timer->period = attotime_zero; + timer->period = attotime::zero; timer->file = file; timer->line = line; timer->func = func; @@ -625,7 +625,7 @@ INLINE emu_timer *_timer_alloc_common(running_machine *machine, device_t *device /* compute the time of the next firing and insert into the list */ timer->start = time; - timer->expire = attotime_never; + timer->expire = attotime::never; timer_list_insert(timer); /* if we're not temporary, register ourselves with the save state system */ @@ -689,7 +689,7 @@ static void timer_remove(emu_timer *which) void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param) { - timer_adjust_periodic(which, duration, param, attotime_never); + timer_adjust_periodic(which, duration, param, attotime::never); } @@ -714,7 +714,7 @@ void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, /* clamp negative times to 0 */ if (start_delay.seconds < 0) - start_delay = attotime_zero; + start_delay = attotime::zero; /* set the start and expire times */ which->start = time; @@ -740,7 +740,7 @@ void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, void device_timer_call_after_resynch(device_t &device, device_timer_id id, INT32 param, void *ptr) { emu_timer *timer = _timer_alloc_common(device.machine, &device, id, NULL, ptr, __FILE__, __LINE__, device.tag(), TRUE); - timer_adjust_oneshot(timer, attotime_zero, param); + timer_adjust_oneshot(timer, attotime::zero, param); } @@ -977,8 +977,8 @@ timer_device_config::timer_device_config(const machine_config &mconfig, const ch m_type(TIMER_TYPE_GENERIC), m_callback(NULL), m_ptr(NULL), - m_start_delay(attotime_zero), - m_period(attotime_zero), + m_start_delay(attotime::zero), + m_period(attotime::zero), m_param(0), m_screen(NULL), m_first_vpos(0), @@ -1207,14 +1207,14 @@ void timer_device::device_reset() case timer_device_config::TIMER_TYPE_PERIODIC: { // convert the period into attotime - attotime period = attotime_never; + attotime period = attotime::never; if (m_config.m_period > attotime::zero) { period = m_config.m_period; // convert the start_delay into attotime - attotime start_delay = attotime_zero; - if (m_config.m_start_delay > attotime_zero) + attotime start_delay = attotime::zero; + if (m_config.m_start_delay > attotime::zero) start_delay = m_config.m_start_delay; // allocate and start the backing timer @@ -1229,7 +1229,7 @@ void timer_device::device_reset() // set the timer to to fire immediately m_first_time = true; - timer_adjust_oneshot(m_timer, attotime_zero, m_config.m_param); + timer_adjust_oneshot(m_timer, attotime::zero, m_config.m_param); break; } } |