From 6c307d2d02698d02f84e4b7f8e0f3bac4c93f83c Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Tue, 12 Sep 2023 23:33:04 +0200 Subject: [PATCH] libpcsxcore: Set unsafe flags after reset Lightrec is only initialized once, when the emulator starts. We need to set the unsafe flags after reset because the setting will be different across games. Signed-off-by: Paul Cercueil --- libpcsxcore/lightrec/plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpcsxcore/lightrec/plugin.c b/libpcsxcore/lightrec/plugin.c index d3e4b33f..e87396dc 100644 --- a/libpcsxcore/lightrec/plugin.c +++ b/libpcsxcore/lightrec/plugin.c @@ -470,8 +470,6 @@ static int lightrec_plugin_init(void) lightrec_map, ARRAY_SIZE(lightrec_map), &lightrec_ops); - lightrec_set_unsafe_opt_flags(lightrec_state, lightrec_hacks); - // fprintf(stderr, "M=0x%lx, P=0x%lx, R=0x%lx, H=0x%lx\n", // (uintptr_t) psxM, // (uintptr_t) psxP, @@ -625,6 +623,8 @@ static void lightrec_plugin_reset(void) regs->cp0[12] = 0x10900000; // COP0 enabled | BEV = 1 | TS = 1 regs->cp0[15] = 0x00000002; // PRevID = Revision ID, same as R3000A + + lightrec_set_unsafe_opt_flags(lightrec_state, lightrec_hacks); } static void lightrec_plugin_sync_regs_from_pcsx(bool need_cp2) -- 2.39.5