System: Reset code cache on fastmem mode change

Fixes excess backpatching and potential crashes when changing mode.
This commit is contained in:
Stenzek 2024-12-03 16:55:00 +10:00
parent 0a2facfaeb
commit 5b6e3a952c
No known key found for this signature in database
2 changed files with 3 additions and 1 deletions

View File

@ -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;

View File

@ -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());