From 220a2cc8f6d7095348e21af6d0a99f8ee74ce072 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 24 Oct 2022 20:53:46 +0200 Subject: emu_timer adjust(): set enable flag to false if timer isn't running --- src/emu/schedule.cpp | 4 ++-- src/mame/entex/advision.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 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 diff --git a/src/mame/entex/advision.cpp b/src/mame/entex/advision.cpp index 0b94bc839f6..f2b8149522c 100644 --- a/src/mame/entex/advision.cpp +++ b/src/mame/entex/advision.cpp @@ -143,7 +143,7 @@ private: u32 advision_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - bool hint_enable = bool(m_conf->read() & 1); + const bool hint_enable = bool(m_conf->read() & 1); for (int y = 0; y < 40; y++) { @@ -180,7 +180,7 @@ void advision_state::av_control_w(u8 data) // disable led outputs (there is some delay before it takes effect) // see for example codered twister and anime girl, gaps between the 'pixels' should be visible but minimal - if (m_video_bank == 0) + if (m_video_bank == 0 && !m_led_off->enabled()) m_led_off->adjust(attotime::from_usec(39)); // P24 rising edge: transfer led latches to outputs -- cgit v1.2.3