summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2022-06-16 09:59:48 -0400
committer AJR <ajrhacker@users.noreply.github.com>2022-06-16 10:00:43 -0400
commitb1a3c44e47864c441ac534b9a0f5855a6a754fa9 (patch)
tree00927fc4d2d5f818dcb7e8ba1bd87e48cf33387a
parent32c507d34d4bbe357a7ec6100025dc21a6e151c2 (diff)
kp64.cpp: Better workaround
-rw-r--r--src/devices/cpu/z80/kp64.cpp12
1 files 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