From 5b6e3a952cf6e15f46d8919772050d52a564183e Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 3 Dec 2024 16:55:00 +1000 Subject: [PATCH] System: Reset code cache on fastmem mode change Fixes excess backpatching and potential crashes when changing mode. --- src/core/settings.cpp | 2 +- src/core/system.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 8b46de696..feb4225fe 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -1012,7 +1012,7 @@ void Settings::FixIncompatibleSettings(bool display_osd_messages) } #endif - // fastmem should be off if we're not using the intepreter, save the allocation + // fastmem should be off if we're not using the recompiler, save the allocation if (g_settings.cpu_execution_mode != CPUExecutionMode::Recompiler) g_settings.cpu_fastmem_mode = CPUFastmemMode::Disabled; diff --git a/src/core/system.cpp b/src/core/system.cpp index e508c2c24..14e484e83 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -4338,6 +4338,8 @@ void System::CheckForSettingsChanges(const Settings& old_settings) { // Reallocate fastmem area, even if it's not being used. Bus::RemapFastmemViews(); + CPU::CodeCache::Reset(); + InterruptExecution(); } SPU::GetOutputStream()->SetOutputVolume(GetAudioOutputVolume());