From 8baf48aa4972908ca8a4fbe02529ac1d47c905d3 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 12 Feb 2024 20:41:22 +0200 Subject: [PATCH] CIA E-clock mode on the fly change support --- cia.cpp | 6 +++--- custom.cpp | 1 + include/cia.h | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cia.cpp b/cia.cpp index e96b3b29..4afc5324 100644 --- a/cia.cpp +++ b/cia.cpp @@ -192,7 +192,7 @@ void cia_adjust_eclock_phase(int diff) //write_log("CIA E-clock phase %d\n", internaleclockphase); } -static void set_eclockphase(void) +void cia_set_eclockphase(void) { if (currprefs.cs_eclocksync == 3) { e_clock_sync = E_CLOCK_SYNC_X; @@ -228,7 +228,7 @@ static evt_t get_e_cycles(void) currprefs.cs_eclocksync = 1; } changed_prefs.cs_eclocksync = currprefs.cs_eclocksync; - set_eclockphase(); + cia_set_eclockphase(); write_log("CIA elock timing mode %d\n", currprefs.cs_eclocksync); blop2 = 0; } @@ -2197,7 +2197,7 @@ void CIA_reset(void) CIA_calctimers(); DISK_select_set(cia[1].prb); } - set_eclockphase(); + cia_set_eclockphase(); map_overlay(0); check_led(); #ifdef SERIAL_PORT diff --git a/custom.cpp b/custom.cpp index c81a74c8..340feb06 100644 --- a/custom.cpp +++ b/custom.cpp @@ -16372,6 +16372,7 @@ void check_prefs_changed_custom(void) currprefs.chipset_hr = changed_prefs.chipset_hr; init_custom(); } + cia_set_eclockphase(); if (syncchange) { varsync_changed = 2; } diff --git a/include/cia.h b/include/cia.h index ed2b3ff9..753e4582 100644 --- a/include/cia.h +++ b/include/cia.h @@ -22,6 +22,7 @@ extern void CIAB_tod_handler(int); extern void cia_parallelack (void); extern void cia_diskindex (void); extern void cia_adjust_eclock_phase(int); +extern void cia_set_eclockphase(void); extern void dumpcia(void); extern void rethink_cias(void); -- 2.47.3