Skip to content

Commit 071a9e5

Browse files
committed
32x, take over sh2 cycles setting in-game
1 parent 7808c76 commit 071a9e5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pico/32x/32x.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,11 @@ void Pico32xStateLoaded(int is_early)
658658

659659
void Pico32xPrepare(void)
660660
{
661-
Pico32xSetClocks(PICO_MSH2_HZ, PICO_SSH2_HZ);
661+
// fallback in case it was missing in saved config
662+
if (msh2.mult_m68k_to_sh2 == 0 || msh2.mult_sh2_to_m68k == 0)
663+
Pico32xSetClocks(PICO_MSH2_HZ, 0);
664+
if (ssh2.mult_m68k_to_sh2 == 0 || ssh2.mult_sh2_to_m68k == 0)
665+
Pico32xSetClocks(0, PICO_SSH2_HZ);
662666

663667
sh2_execute_prepare(&msh2, PicoIn.opt & POPT_EN_DRC);
664668
sh2_execute_prepare(&ssh2, PicoIn.opt & POPT_EN_DRC);

platform/common/menu_pico.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,8 @@ static int mh_opt_sh2cycles(int id, int keys)
542542
else if (*khz > 0x7fffffff / 1000)
543543
*khz = 0x7fffffff / 1000;
544544

545+
Pico32xSetClocks(currentConfig.msh2_khz * 1000, currentConfig.ssh2_khz * 1000);
546+
545547
return 0;
546548
}
547549

@@ -573,8 +575,6 @@ static int menu_loop_32x_options(int id, int keys)
573575
me_enable(e_menu_32x_options, MA_32XOPT_RENDERER, 0);
574576
me_loop_d(e_menu_32x_options, &sel, menu_draw_prep, NULL);
575577

576-
Pico32xSetClocks(currentConfig.msh2_khz * 1000, currentConfig.msh2_khz * 1000);
577-
578578
return 0;
579579
}
580580

0 commit comments

Comments
 (0)