]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
CIA-A fix update
authorToni Wilen <twilen@winuae.net>
Sun, 27 Nov 2022 12:43:19 +0000 (14:43 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 27 Nov 2022 12:43:19 +0000 (14:43 +0200)
cia.cpp

diff --git a/cia.cpp b/cia.cpp
index 5b7ba2b32cf2495d031c1a3da8e4e1a3ceb2f77a..1ed9cb973576855950223c639a40d1c7974dcc57 100644 (file)
--- a/cia.cpp
+++ b/cia.cpp
@@ -1179,6 +1179,10 @@ static void check_keyboard(void)
 static void cia_delayed_tod(int num)
 {
        struct CIA *c = &cia[num];
+       if (c->tod_event_state == 4) {
+               c->tod_event_state = 1;
+               return;
+       }
        if (c->tod_event_state == 1) {
                CIA_tod_inc(false, num);
        }
@@ -1212,10 +1216,6 @@ void CIA_hsync_posthandler(bool ciahsync, bool dotod)
 
        if (!ciahsync) {
                // Increase CIA-A TOD if delayed from previous line
-               struct CIA *c = &cia[0];
-               if (c->tod_event_state == 4) {
-                       c->tod_event_state = 1;
-               }
                cia_delayed_tod(0);
                if (currprefs.tod_hack && cia[0].todon) {
                        do_tod_hack();