From c16b5d911f97bc6385b7f30b6c8cb07f0eba7a49 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Thu, 18 Apr 2024 22:47:03 +0200 Subject: [PATCH] count of zero is possible --- rl02.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rl02.cpp b/rl02.cpp index 68acc73..b39cfaf 100644 --- a/rl02.cpp +++ b/rl02.cpp @@ -189,6 +189,8 @@ void rl02::writeWord(const uint16_t addr, uint16_t v) uint32_t memory_address = get_bus_address(); uint32_t count = (65536l - registers[(RL02_MPR - RL02_BASE) / 2]) * 2; + if (count == 65536) + count = 0; uint16_t temp = registers[(RL02_DAR - RL02_BASE) / 2];