From b1a3c44e47864c441ac534b9a0f5855a6a754fa9 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 16 Jun 2022 09:59:48 -0400 Subject: [PATCH] kp64.cpp: Better workaround --- src/devices/cpu/z80/kp64.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/devices/cpu/z80/kp64.cpp b/src/devices/cpu/z80/kp64.cpp index aac78425951..697ed65268a 100644 --- a/src/devices/cpu/z80/kp64.cpp +++ b/src/devices/cpu/z80/kp64.cpp @@ -189,11 +189,13 @@ u16 kp64_device::count_value() const noexcept void kp64_device::reload_count() { m_count = BIT(m_status, 5) ? 0xffff : m_cr; - if (BIT(m_status, 0)) { - if(m_cr == 0) - m_cr = 0xffff; - - m_count_timer->adjust(clocks_to_attotime(u32(m_count) + 1)); + if (BIT(m_status, 0)) + { + // hng64 network MCU configures this supposedly invalid value and thrashes the scheduler if the timer is enabled + if (m_count == 0) + logerror("%s: Zero reload value specified for timer\n", machine().describe_context()); + else + m_count_timer->adjust(clocks_to_attotime(u32(m_count) + 1)); } // Count is now started whether or not it was before