diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 0832a08837..f2554bd534 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -1025,6 +1025,9 @@ struct Pcsx2Config // You shouldn't assign to this class, because it'll mess with the runtime variables (Current...). // But you can still use this to copy config. Only needed until we drop wx. void CopyConfig(const Pcsx2Config& cfg); + + /// Copies runtime configuration settings (e.g. frame limiter state). + void CopyRuntimeConfig(Pcsx2Config& cfg); }; extern Pcsx2Config EmuConfig; diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index 2d4ab942fe..16e004e361 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -1238,6 +1238,17 @@ void Pcsx2Config::CopyConfig(const Pcsx2Config& cfg) LimiterMode = cfg.LimiterMode; } +void Pcsx2Config::CopyRuntimeConfig(Pcsx2Config& cfg) +{ + GS.LimitScalar = cfg.GS.LimitScalar; + UseBOOT2Injection = cfg.UseBOOT2Injection; + CurrentBlockdump = std::move(cfg.CurrentBlockdump); + CurrentIRX = std::move(cfg.CurrentIRX); + CurrentGameArgs = std::move(cfg.CurrentGameArgs); + CurrentAspectRatio = cfg.CurrentAspectRatio; + LimiterMode = cfg.LimiterMode; +} + void EmuFolders::SetDefaults(SettingsInterface& si) { si.SetStringValue("Folders", "Bios", "bios"); diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index 9f496ceba5..5f07846b20 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -1673,7 +1673,11 @@ void VMManager::ApplySettings() GetMTGS().WaitGS(false); } - const Pcsx2Config old_config(EmuConfig); + // Reset to a clean Pcsx2Config. Otherwise things which are optional (e.g. gamefixes) + // do not use the correct default values when loading. + Pcsx2Config old_config(std::move(EmuConfig)); + EmuConfig = Pcsx2Config(); + EmuConfig.CopyRuntimeConfig(old_config); LoadSettings(); CheckForConfigChanges(old_config); }