summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2022-10-24 20:53:46 +0200
committer hap <happppp@users.noreply.github.com>2022-10-24 20:53:56 +0200
commit220a2cc8f6d7095348e21af6d0a99f8ee74ce072 (patch)
treee3f2384aacff9b6afb07d4dbfaf83956c35896ae /src/emu
parent71cd1a71685ac038c49fab9ad5e80716b51cdccf (diff)
emu_timer adjust(): set enable flag to false if timer isn't running
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/schedule.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/emu/schedule.cpp b/src/emu/schedule.cpp
index 838e70c22b6..bdba5a71d3d 100644
--- a/src/emu/schedule.cpp
+++ b/src/emu/schedule.cpp
@@ -142,9 +142,8 @@ void emu_timer::adjust(attotime start_delay, s32 param, const attotime &period)
if (m_scheduler->m_callback_timer == this)
m_scheduler->m_callback_timer_modified = true;
- // compute the time of the next firing and insert into the list
+ // set callback parameter
m_param = param;
- m_enabled = true;
// clamp negative times to 0
if (start_delay.seconds() < 0)
@@ -153,6 +152,7 @@ void emu_timer::adjust(attotime start_delay, s32 param, const attotime &period)
// set the start and expire times
m_start = m_scheduler->time();
m_expire = m_start + start_delay;
+ m_enabled = !m_expire.is_never();
m_period = period;
// remove and re-insert the timer in its new order