From 0feec6ab6ef3670d4e2b503154022f11c86b8902 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 1 Apr 2023 17:05:50 +0300 Subject: [PATCH] CIA TOD clock sync fix --- cia.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cia.cpp b/cia.cpp index c5c74e3d..8bcec386 100644 --- a/cia.cpp +++ b/cia.cpp @@ -814,12 +814,12 @@ static bool cia_checkalarm(bool inc, bool irq, int num) { struct CIA *c = &cia[num]; +#if 0 // hack: do not trigger alarm interrupt if KS code and both // tod and alarm == 0. This incorrectly triggers on non-cycle exact // modes. Real hardware value written to ciabtod by KS is always // at least 1 or larger due to bus cycle delays when reading // old value. -#if 0 if (num) { if (!currprefs.cpu_compatible && (munge24(m68k_getpc()) & 0xFFF80000) != 0xF80000) { if (c->tod == 0 && c->alarm == 0) @@ -935,7 +935,7 @@ static void do_tod_hack(bool dotod) cia[0].tod++; cia[0].tod &= 0x00ffffff; tod_hack_tod_last = cia[0].tod; - cia_checkalarm(false, false, 0); + cia_checkalarm(false, true, 0); } } -- 2.47.3