From 071a9e5904982c33fa5ec1ea7ae2a5d597fa891a Mon Sep 17 00:00:00 2001 From: kub Date: Mon, 30 Dec 2024 16:35:50 +0100 Subject: [PATCH] 32x, take over sh2 cycles setting in-game --- pico/32x/32x.c | 6 +++++- platform/common/menu_pico.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pico/32x/32x.c b/pico/32x/32x.c index 1f9295697..46f5be152 100644 --- a/pico/32x/32x.c +++ b/pico/32x/32x.c @@ -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); diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c index 934a1d2f5..70e18b454 100644 --- a/platform/common/menu_pico.c +++ b/platform/common/menu_pico.c @@ -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; }