From 9b03b236fe31a150a23c7ebba9ae3d728c9d7efb Mon Sep 17 00:00:00 2001 From: Benjamin Moir Date: Fri, 10 May 2024 01:57:47 +1000 Subject: [PATCH] VMManager: Clear protected pages before changing extra memory mode --- pcsx2/VMManager.cpp | 2 ++ pcsx2/x86/ix86-32/iR5900.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index 5ef9e7e24d..e3bde50353 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -1376,6 +1376,7 @@ bool VMManager::Initialize(VMBootParameters boot_params) s_cpu_implementation_changed = false; UpdateCPUImplementations(); + mmap_ResetBlockTracking(); memSetExtraMemMode(EmuConfig.Cpu.ExtraMemory); Internal::ClearCPUExecutionCaches(); FPControlRegister::SetCurrent(EmuConfig.Cpu.FPUFPCR); @@ -1617,6 +1618,7 @@ void VMManager::Reset() if (elf_was_changed) HandleELFChange(false); + mmap_ResetBlockTracking(); memSetExtraMemMode(EmuConfig.Cpu.ExtraMemory); Internal::ClearCPUExecutionCaches(); memBindConditionalHandlers(); diff --git a/pcsx2/x86/ix86-32/iR5900.cpp b/pcsx2/x86/ix86-32/iR5900.cpp index eb215d3d63..bf4bebc3f3 100644 --- a/pcsx2/x86/ix86-32/iR5900.cpp +++ b/pcsx2/x86/ix86-32/iR5900.cpp @@ -599,7 +599,6 @@ static void recResetRaw() memset(s_pInstCache, 0, sizeof(EEINST) * s_nInstCacheSize); recBlocks.Reset(); - mmap_ResetBlockTracking(); vtlb_ClearLoadStoreInfo(); g_branch = 0;