From 46e30467deb5719a6ccc8bccd595e061d89b59f6 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 1 Jul 2024 18:53:20 +1000 Subject: [PATCH] Config: Don't copy global WS/NI to game settings --- pcsx2-qt/Settings/SettingsWindow.cpp | 1 + pcsx2/Config.h | 3 +++ pcsx2/ImGui/FullscreenUI.cpp | 1 + pcsx2/Pcsx2Config.cpp | 7 +++++++ 4 files changed, 12 insertions(+) diff --git a/pcsx2-qt/Settings/SettingsWindow.cpp b/pcsx2-qt/Settings/SettingsWindow.cpp index ff5000f828..f1841643f5 100644 --- a/pcsx2-qt/Settings/SettingsWindow.cpp +++ b/pcsx2-qt/Settings/SettingsWindow.cpp @@ -299,6 +299,7 @@ void SettingsWindow::onCopyGlobalSettingsClicked() { auto lock = Host::GetSettingsLock(); Pcsx2Config::CopyConfiguration(m_sif.get(), *Host::Internal::GetBaseSettingsLayer()); + Pcsx2Config::ClearInvalidPerGameConfiguration(m_sif.get()); } saveAndReloadGameSettings(); diff --git a/pcsx2/Config.h b/pcsx2/Config.h index 8c412d6785..f70d6d9754 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -1195,6 +1195,9 @@ struct Pcsx2Config /// Clears all core keys from the specified interface. static void ClearConfiguration(SettingsInterface* dest_si); + + /// Removes keys that are not valid for per-game settings. + static void ClearInvalidPerGameConfiguration(SettingsInterface* si); }; extern Pcsx2Config EmuConfig; diff --git a/pcsx2/ImGui/FullscreenUI.cpp b/pcsx2/ImGui/FullscreenUI.cpp index b0ec473baf..286b826dd2 100644 --- a/pcsx2/ImGui/FullscreenUI.cpp +++ b/pcsx2/ImGui/FullscreenUI.cpp @@ -2770,6 +2770,7 @@ void FullscreenUI::DoCopyGameSettings() return; Pcsx2Config::CopyConfiguration(s_game_settings_interface.get(), *GetEditingSettingsInterface(false)); + Pcsx2Config::ClearInvalidPerGameConfiguration(s_game_settings_interface.get()); SetSettingsChanged(s_game_settings_interface.get()); diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index ccb179f7c3..e2326f7a1b 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -1838,6 +1838,13 @@ void Pcsx2Config::ClearConfiguration(SettingsInterface* dest_si) temp.LoadSaveCore(wrapper); } +void Pcsx2Config::ClearInvalidPerGameConfiguration(SettingsInterface* si) +{ + // Deprecated in favor of patches. + si->DeleteValue("EmuCore", "EnableWideScreenPatches"); + si->DeleteValue("EmuCore", "EnableNoInterlacingPatches"); +} + void EmuFolders::SetAppRoot() { const std::string program_path = FileSystem::GetProgramPath();