]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix cpu_clock_multiplier when validating config, not when loading config.
authorToni Wilen <twilen@winuae.net>
Sun, 9 Jul 2023 17:21:20 +0000 (20:21 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 9 Jul 2023 17:21:20 +0000 (20:21 +0300)
cfgfile.cpp
main.cpp

index 35df82f56aed1e2cab4ac530161803e8364daac3..af30b7d4552e29a1218ba4e7d2921dae93b7ed44 100644 (file)
@@ -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;
index 5e33db414b1568c9558d4e888d324cd7ee169805..613275baed1ea2355881241d773e2a068f8748a7 100644 (file)
--- 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)