From: Toni Wilen Date: Sun, 9 Jul 2023 17:21:20 +0000 (+0300) Subject: Fix cpu_clock_multiplier when validating config, not when loading config. X-Git-Tag: 5.1.0~164 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=61fff280cf8068481391e5e1ede6fc34fcdf394a;p=francis%2Fwinuae.git Fix cpu_clock_multiplier when validating config, not when loading config. --- diff --git a/cfgfile.cpp b/cfgfile.cpp index 35df82f5..af30b7d4 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -5781,17 +5781,6 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH if (p->cpu_model >= 68020 && p->cachesize > 0) p->cpu_cycle_exact = p->cpu_memory_cycle_exact = p->blitter_cycle_exact = 0; p->cpu_memory_cycle_exact = p->cpu_cycle_exact; - // pre-4.4.0 didn't support cpu multiplier in prefetch mode without cycle-exact - // set pre-4.4.0 defaults first - if (!p->cpu_cycle_exact && p->cpu_compatible && !p->cpu_clock_multiplier) { - if (p->cpu_model < 68020) { - p->cpu_clock_multiplier = 2 * 256; - } else if (p->cpu_model == 68020) { - p->cpu_clock_multiplier = 4 * 256; - } else { - p->cpu_clock_multiplier = 8 * 256; - } - } return 1; } if (cfgfile_yesno (option, value, _T("blitter_cycle_exact"), &p->blitter_cycle_exact)) { @@ -8559,7 +8548,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type) p->fpu_model = 0; p->cpu_model = 68000; p->m68k_speed_throttle = 0; - p->cpu_clock_multiplier = 2 * 256; + p->cpu_clock_multiplier = 0; p->cpu_frequency = 0; p->mmu_model = 0; p->cpu060_revision = 6; diff --git a/main.cpp b/main.cpp index 5e33db41..613275ba 100644 --- a/main.cpp +++ b/main.cpp @@ -392,6 +392,19 @@ void fixup_cpu (struct uae_prefs *p) p->comptrustnaddr = 1; } #endif + + // pre-4.4.0 didn't support cpu multiplier in prefetch mode without cycle-exact + // set pre-4.4.0 defaults first + if (!p->cpu_cycle_exact && p->cpu_compatible && !p->cpu_clock_multiplier && p->config_version) { + if (p->cpu_model < 68020) { + p->cpu_clock_multiplier = 2 * 256; + } else if (p->cpu_model == 68020) { + p->cpu_clock_multiplier = 4 * 256; + } else { + p->cpu_clock_multiplier = 8 * 256; + } + } + } void fixup_prefs (struct uae_prefs *p, bool userconfig)