32x, take over sh2 cycles setting in-game
authorkub <derkub@gmail.com>
Mon, 30 Dec 2024 15:35:50 +0000 (16:35 +0100)
committerkub <derkub@gmail.com>
Mon, 30 Dec 2024 15:35:50 +0000 (16:35 +0100)
pico/32x/32x.c
platform/common/menu_pico.c

index 1f92956..46f5be1 100644 (file)
@@ -658,7 +658,11 @@ void Pico32xStateLoaded(int is_early)
 
 void Pico32xPrepare(void)
 {
-  Pico32xSetClocks(PICO_MSH2_HZ, PICO_SSH2_HZ);
+  // fallback in case it was missing in saved config
+  if (msh2.mult_m68k_to_sh2 == 0 || msh2.mult_sh2_to_m68k == 0)
+    Pico32xSetClocks(PICO_MSH2_HZ, 0);
+  if (ssh2.mult_m68k_to_sh2 == 0 || ssh2.mult_sh2_to_m68k == 0)
+    Pico32xSetClocks(0, PICO_SSH2_HZ);
 
   sh2_execute_prepare(&msh2, PicoIn.opt & POPT_EN_DRC);
   sh2_execute_prepare(&ssh2, PicoIn.opt & POPT_EN_DRC);
index 934a1d2..70e18b4 100644 (file)
@@ -542,6 +542,8 @@ static int mh_opt_sh2cycles(int id, int keys)
        else if (*khz > 0x7fffffff / 1000)
                *khz = 0x7fffffff / 1000;
 
+       Pico32xSetClocks(currentConfig.msh2_khz * 1000, currentConfig.ssh2_khz * 1000);
+
        return 0;
 }
 
@@ -573,8 +575,6 @@ static int menu_loop_32x_options(int id, int keys)
                me_enable(e_menu_32x_options, MA_32XOPT_RENDERER, 0);
        me_loop_d(e_menu_32x_options, &sel, menu_draw_prep, NULL);
 
-       Pico32xSetClocks(currentConfig.msh2_khz * 1000, currentConfig.msh2_khz * 1000);
-
        return 0;
 }