From e169fdad4f89675f5b56a3ca5004d593792426a0 Mon Sep 17 00:00:00 2001 From: lat9nq Date: Sat, 15 May 2021 20:46:48 -0400 Subject: general: Make CPU accuracy and related a Settings::Setting Required to make CPU accuracy and unsafe settings available to use as a per-game setting. --- src/common/settings.cpp | 2 +- src/common/settings.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/common') diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 702b6598d..b9a549c81 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -42,7 +42,7 @@ void LogSettings() { log_setting("System_RegionIndex", values.region_index.GetValue()); log_setting("System_TimeZoneIndex", values.time_zone_index.GetValue()); log_setting("Core_UseMultiCore", values.use_multi_core.GetValue()); - log_setting("CPU_Accuracy", values.cpu_accuracy); + log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue()); log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue()); log_setting("Renderer_UseFrameLimit", values.use_frame_limit.GetValue()); log_setting("Renderer_FrameLimit", values.frame_limit.GetValue()); diff --git a/src/common/settings.h b/src/common/settings.h index d39b4aa45..68dc2ea7d 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -115,7 +115,7 @@ struct Values { Setting use_multi_core; // Cpu - CPUAccuracy cpu_accuracy; + Setting cpu_accuracy; bool cpuopt_page_tables; bool cpuopt_block_linking; @@ -126,9 +126,9 @@ struct Values { bool cpuopt_misc_ir; bool cpuopt_reduce_misalign_checks; - bool cpuopt_unsafe_unfuse_fma; - bool cpuopt_unsafe_reduce_fp_error; - bool cpuopt_unsafe_inaccurate_nan; + Setting cpuopt_unsafe_unfuse_fma; + Setting cpuopt_unsafe_reduce_fp_error; + Setting cpuopt_unsafe_inaccurate_nan; // Renderer Setting renderer_backend; -- cgit v1.2.3 From ab2677f0a1b898ad767109d0d8cd3d4fa237252c Mon Sep 17 00:00:00 2001 From: lat9nq Date: Sat, 15 May 2021 23:53:36 -0400 Subject: configuration: Add CPU tab to game properties Allows setting CPU accuracy to Accurate or Unsafe per-game, as well as the accuracy options for Unsafe. Debug is not allowed here as a per-game CPU accuracy. --- src/common/settings.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common') diff --git a/src/common/settings.cpp b/src/common/settings.cpp index b9a549c81..7c8fced59 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -106,6 +106,12 @@ void RestoreGlobalState(bool is_powered_on) { // Core values.use_multi_core.SetGlobal(true); + // CPU + values.cpu_accuracy.SetGlobal(true); + values.cpuopt_unsafe_unfuse_fma.SetGlobal(true); + values.cpuopt_unsafe_reduce_fp_error.SetGlobal(true); + values.cpuopt_unsafe_inaccurate_nan.SetGlobal(true); + // Renderer values.renderer_backend.SetGlobal(true); values.vulkan_device.SetGlobal(true); -- cgit v1.2.3 From 339dc4f806b0c39a4ec6460187f345c4e2890d05 Mon Sep 17 00:00:00 2001 From: lat9nq Date: Sun, 16 May 2021 01:17:18 -0400 Subject: general: Demote custom_rtc to regular setting --- src/common/settings.cpp | 1 - src/common/settings.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 7c8fced59..e29cbf506 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -136,7 +136,6 @@ void RestoreGlobalState(bool is_powered_on) { values.region_index.SetGlobal(true); values.time_zone_index.SetGlobal(true); values.rng_seed.SetGlobal(true); - values.custom_rtc.SetGlobal(true); values.sound_index.SetGlobal(true); // Controls diff --git a/src/common/settings.h b/src/common/settings.h index 68dc2ea7d..48085b9a9 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -157,7 +157,7 @@ struct Values { // System Setting> rng_seed; // Measured in seconds since epoch - Setting> custom_rtc; + std::optional custom_rtc; // Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc` std::chrono::seconds custom_rtc_differential; -- cgit v1.2.3