From: kub Date: Wed, 7 Jun 2023 21:21:58 +0000 (+0000) Subject: 32x, fix startup crash X-Git-Tag: v2.00~212 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d7abd69053bcf4512ff913f413efe2cf748e81c;p=picodrive.git 32x, fix startup crash --- diff --git a/pico/32x/32x.c b/pico/32x/32x.c index 8b91c7b4..e91c724b 100644 --- a/pico/32x/32x.c +++ b/pico/32x/32x.c @@ -120,6 +120,7 @@ void Pico32xStartup(void) rendstatus_old = -1; + Pico32xPrepare(); emu_32x_startup(); } @@ -580,10 +581,6 @@ void sync_sh2s_lockstep(unsigned int m68k_target) void PicoFrame32x(void) { - // XXX this is somehow misplaced here - sh2_execute_prepare(&msh2, PicoIn.opt & POPT_EN_DRC); - sh2_execute_prepare(&ssh2, PicoIn.opt & POPT_EN_DRC); - if (PicoIn.AHW & PAHW_MCD) pcd_prepare_frame(); @@ -627,4 +624,10 @@ void Pico32xStateLoaded(int is_early) p32x_run_events(SekCyclesDone()); } +void Pico32xPrepare(void) +{ + sh2_execute_prepare(&msh2, PicoIn.opt & POPT_EN_DRC); + sh2_execute_prepare(&ssh2, PicoIn.opt & POPT_EN_DRC); +} + // vim:shiftwidth=2:ts=2:expandtab diff --git a/pico/pico.c b/pico/pico.c index f0128dae..7976c9e4 100644 --- a/pico/pico.c +++ b/pico/pico.c @@ -227,6 +227,9 @@ void PicoLoopPrepare(void) Pico.m.dirtyPal = 1; rendstatus_old = -1; + + if (PicoIn.AHW & PAHW_32X) + Pico32xPrepare(); } #include "pico_cmn.c" diff --git a/pico/pico_int.h b/pico/pico_int.h index 062e7669..3ed7c0f8 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -996,6 +996,7 @@ void Pico32xStartup(void); void PicoUnload32x(void); void PicoFrame32x(void); void Pico32xStateLoaded(int is_early); +void Pico32xPrepare(void); void p32x_sync_sh2s(unsigned int m68k_target); void p32x_sync_other_sh2(SH2 *sh2, unsigned int m68k_target); void p32x_update_irls(SH2 *active_sh2, unsigned int m68k_cycles);