From c8b8674ffc4225dce222bad702241afd640b9e86 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Thu, 8 Jul 2021 14:39:10 -0400 Subject: [PATCH] settings, yuzu qt: Add migration code for CPU accuracy Old CPU Accuracy setting won't translate well into since we're adding one at the beginning of the list. On first boot with the new setting, just use the default setting. --- src/common/settings.h | 2 ++ src/yuzu/configuration/config.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/settings.h b/src/common/settings.h index f9988c2667..9f7e1096bc 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -286,6 +286,8 @@ struct Values { // Cpu Setting cpu_accuracy{CPUAccuracy::Auto, "cpu_accuracy"}; + // TODO: remove cpu_accuracy_first_time, migration setting added 8 July 2021 + BasicSetting cpu_accuracy_first_time{true, "cpu_accuracy_first_time"}; BasicSetting cpuopt_page_tables{true, "cpuopt_page_tables"}; BasicSetting cpuopt_block_linking{true, "cpuopt_block_linking"}; diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 1a0f75373d..1e77c1e514 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -793,7 +793,13 @@ void Config::ReadPathValues() { void Config::ReadCpuValues() { qt_config->beginGroup(QStringLiteral("Cpu")); - ReadGlobalSetting(Settings::values.cpu_accuracy); + ReadBasicSetting(Settings::values.cpu_accuracy_first_time); + if (Settings::values.cpu_accuracy_first_time) { + Settings::values.cpu_accuracy.SetValue(Settings::values.cpu_accuracy.GetDefault()); + Settings::values.cpu_accuracy_first_time.SetValue(false); + } else { + ReadGlobalSetting(Settings::values.cpu_accuracy); + } ReadGlobalSetting(Settings::values.cpuopt_unsafe_unfuse_fma); ReadGlobalSetting(Settings::values.cpuopt_unsafe_reduce_fp_error); @@ -1309,6 +1315,7 @@ void Config::SavePathValues() { void Config::SaveCpuValues() { qt_config->beginGroup(QStringLiteral("Cpu")); + WriteBasicSetting(Settings::values.cpu_accuracy_first_time); WriteSetting(QStringLiteral("cpu_accuracy"), static_cast(Settings::values.cpu_accuracy.GetValue(global)), static_cast(Settings::values.cpu_accuracy.GetDefault()),