mirror of
https://github.com/holub/mame
synced 2025-05-24 14:56:21 +03:00
timer.c: timers get rescheduled only if enable state has changed [Christophe Jaillet]
This commit is contained in:
parent
dbf7afe106
commit
4c0b712c8e
@ -759,15 +759,18 @@ void timer_reset(emu_timer *which, attotime duration)
|
|||||||
|
|
||||||
int timer_enable(emu_timer *which, int enable)
|
int timer_enable(emu_timer *which, int enable)
|
||||||
{
|
{
|
||||||
int old;
|
int old = which->enabled;
|
||||||
|
|
||||||
/* set the enable flag */
|
/* reschedule only if the state has changed */
|
||||||
old = which->enabled;
|
if (old != enable)
|
||||||
which->enabled = enable;
|
{
|
||||||
|
/* set the enable flag */
|
||||||
|
which->enabled = enable;
|
||||||
|
|
||||||
/* remove the timer and insert back into the list */
|
/* remove the timer and insert back into the list */
|
||||||
timer_list_remove(which);
|
timer_list_remove(which);
|
||||||
timer_list_insert(which);
|
timer_list_insert(which);
|
||||||
|
}
|
||||||
|
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user