From: Toni Wilen Date: Fri, 16 Dec 2022 18:46:15 +0000 (+0200) Subject: Fix syncronize clock option. X-Git-Tag: 41000~4 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=90ab7a0e42727c347437a2a5f7c1e0d6a53c59d2;p=francis%2Fwinuae.git Fix syncronize clock option. --- diff --git a/cia.cpp b/cia.cpp index b64e00ad..89d4df8b 100644 --- a/cia.cpp +++ b/cia.cpp @@ -860,7 +860,7 @@ void cia_heartbeat(void) heartbeat_cnt = 10; } -static void do_tod_hack(void) +static void do_tod_hack(bool dotod) { struct timeval tv; static int oldrate; @@ -908,7 +908,7 @@ static void do_tod_hack(void) docount = 1; } - if (currprefs.cs_ciaatod == 0) + if (!dotod && currprefs.cs_ciaatod == 0) return; if (tod_hack_delay > 0) { @@ -1196,6 +1196,9 @@ void CIA_hsync_posthandler(bool ciahsync, bool dotod) // CIA-B HSync pulse // Delayed previous line TOD increase. cia_delayed_tod(1); + if (currprefs.tod_hack && cia[0].todon) { + do_tod_hack(dotod); + } } else if (currprefs.keyboard_connected) { // custom hsync if (resetwarning_phase) { @@ -1217,9 +1220,6 @@ void CIA_hsync_posthandler(bool ciahsync, bool dotod) if (!ciahsync) { // Increase CIA-A TOD if delayed from previous line cia_delayed_tod(0); - if (currprefs.tod_hack && cia[0].todon) { - do_tod_hack(); - } } }