VERY experimental Nintendo Switch 2 emulator
C++
settings: Move settings sanitization to its own function
lat9nqbe59d82047b5
diff --git a/src/core/settings.cpp b/src/core/settings.cppindex d3886c4ec7..38f0789a02 100644--- a/src/core/settings.cpp+++ b/src/core/settings.cpp@@ -184,4 +184,10 @@ void RestoreGlobalState() {values.sound_index.SetGlobal(true);}+void Sanitize() {+ values.use_asynchronous_gpu_emulation.SetValue(+ values.use_asynchronous_gpu_emulation.GetValue() ||+ values.use_multi_core.GetValue());+}+} // namespace Settingsdiff --git a/src/core/settings.h b/src/core/settings.hindex 850ca4072c..8788401162 100644--- a/src/core/settings.h+++ b/src/core/settings.h@@ -539,4 +539,7 @@ void LogSettings();// Restore the global state of all applicable settings in the Values structvoid RestoreGlobalState();+// Fixes settings that are known to cause issues with the emulator+void Sanitize();+} // namespace Settingsdiff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cppindex 1b2b1b2bb6..e586792bb4 100644--- a/src/yuzu/configuration/config.cpp+++ b/src/yuzu/configuration/config.cpp@@ -1342,11 +1342,13 @@ void Config::WriteSettingGlobal(const QString& name, const QVariant& value, boolvoid Config::Reload() {ReadValues();+ Settings::Sanitize();// To apply default value changesSaveValues();Settings::Apply();}void Config::Save() {+ Settings::Sanitize();SaveValues();}diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cppindex 8f889be3ae..4323797050 100644--- a/src/yuzu/main.cpp+++ b/src/yuzu/main.cpp@@ -1053,10 +1053,6 @@ void GMainWindow::BootGame(const QString& filename) {if (!(loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::Success)) {// Load per game settingsConfig per_game_config(fmt::format("{:016X}.ini", title_id), false);-- Settings::values.use_asynchronous_gpu_emulation.SetValue(- Settings::values.use_asynchronous_gpu_emulation.GetValue() ||- Settings::values.use_multi_core.GetValue());}Settings::LogSettings();