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.
This commit is contained in:
lat9nq 2021-07-08 14:39:10 -04:00
parent 87b6e14d7c
commit c8b8674ffc
2 changed files with 10 additions and 1 deletions

View file

@ -286,6 +286,8 @@ struct Values {
// Cpu
Setting<CPUAccuracy> cpu_accuracy{CPUAccuracy::Auto, "cpu_accuracy"};
// TODO: remove cpu_accuracy_first_time, migration setting added 8 July 2021
BasicSetting<bool> cpu_accuracy_first_time{true, "cpu_accuracy_first_time"};
BasicSetting<bool> cpuopt_page_tables{true, "cpuopt_page_tables"};
BasicSetting<bool> cpuopt_block_linking{true, "cpuopt_block_linking"};

View file

@ -793,7 +793,13 @@ void Config::ReadPathValues() {
void Config::ReadCpuValues() {
qt_config->beginGroup(QStringLiteral("Cpu"));
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<u32>(Settings::values.cpu_accuracy.GetValue(global)),
static_cast<u32>(Settings::values.cpu_accuracy.GetDefault()),