From 8e9d82d022f06cc8c005c64ec25383a5e10136ca Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 16 Jan 2025 01:06:43 +0200 Subject: [PATCH] misc: hard-reset cpu on hle change --- libpcsxcore/misc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 1fb045ce..34745add 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -751,10 +751,10 @@ int LoadState(const char *file) { void *f; GPUFreeze_t *gpufP = NULL; SPUFreeze_t *spufP = NULL; + boolean hle, oldhle; int Size; char header[32]; u32 version; - boolean hle; int result = -1; f = SaveFuncs.open(file, "rb"); @@ -768,6 +768,7 @@ int LoadState(const char *file) { SysPrintf("incompatible savestate version %x\n", version); goto cleanup; } + oldhle = Config.HLE; Config.HLE = hle; if (Config.HLE) @@ -826,6 +827,11 @@ int LoadState(const char *file) { if (Config.HLE) psxBiosCheckExe(biosBranchCheckOld, 0x60, 1); + if (Config.HLE != oldhle) { + // at least ari64 drc compiles differently so hard reset + psxCpu->Shutdown(); + psxCpu->Init(); + } psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, NULL); result = 0; -- 2.39.5