summaryrefslogtreecommitdiff
path: root/src/common/settings.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/settings.h')
-rw-r--r--src/common/settings.h40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/common/settings.h b/src/common/settings.h
index a9ce113ef..141408d3e 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -91,6 +91,7 @@ public:
91 return {}; 91 return {};
92 } 92 }
93 virtual void LoadString(const std::string& load) = 0; 93 virtual void LoadString(const std::string& load) = 0;
94 virtual std::string Canonicalize() const = 0;
94 virtual const std::string& GetLabel() const = 0; 95 virtual const std::string& GetLabel() const = 0;
95 virtual std::string DefaultToString() const = 0; 96 virtual std::string DefaultToString() const = 0;
96 virtual bool Save() const = 0; 97 virtual bool Save() const = 0;
@@ -102,7 +103,7 @@ public:
102 virtual std::string MinVal() const = 0; 103 virtual std::string MinVal() const = 0;
103 virtual std::string MaxVal() const = 0; 104 virtual std::string MaxVal() const = 0;
104 virtual bool UsingGlobal() const { 105 virtual bool UsingGlobal() const {
105 return false; 106 return true;
106 } 107 }
107}; 108};
108 109
@@ -245,7 +246,7 @@ protected:
245 } else if constexpr (std::is_same<Type, bool>()) { 246 } else if constexpr (std::is_same<Type, bool>()) {
246 return value_ ? "true" : "false"; 247 return value_ ? "true" : "false";
247 } else if (std::is_same<Type, AudioEngine>()) { 248 } else if (std::is_same<Type, AudioEngine>()) {
248 return TranslateEnum(value_); 249 return CanonicalizeEnum(value_);
249 } else { 250 } else {
250 return std::to_string(static_cast<u64>(value_)); 251 return std::to_string(static_cast<u64>(value_));
251 } 252 }
@@ -321,6 +322,13 @@ public:
321 } 322 }
322 } 323 }
323 324
325 [[nodiscard]] std::string constexpr Canonicalize() const override {
326 if constexpr (std::is_enum<Type>::value) {
327 return CanonicalizeEnum(this->GetValue());
328 }
329 return ToString(this->GetValue());
330 }
331
324 /** 332 /**
325 * Returns the save preference of the setting i.e. when saving or reading the setting from a 333 * Returns the save preference of the setting i.e. when saving or reading the setting from a
326 * frontend, whether this setting should be skipped. 334 * frontend, whether this setting should be skipped.
@@ -560,8 +568,8 @@ struct Values {
560 linkage, false, "use_unsafe_extended_memory_layout", Category::Core}; 568 linkage, false, "use_unsafe_extended_memory_layout", Category::Core};
561 569
562 // Cpu 570 // Cpu
563 SwitchableSetting<CPUAccuracy, true> cpu_accuracy{linkage, CPUAccuracy::Auto, 571 SwitchableSetting<CpuAccuracy, true> cpu_accuracy{linkage, CpuAccuracy::Auto,
564 CPUAccuracy::Auto, CPUAccuracy::Paranoid, 572 CpuAccuracy::Auto, CpuAccuracy::Paranoid,
565 "cpu_accuracy", Category::Cpu}; 573 "cpu_accuracy", Category::Cpu};
566 // TODO: remove cpu_accuracy_first_time, migration setting added 8 July 2021 574 // TODO: remove cpu_accuracy_first_time, migration setting added 8 July 2021
567 Setting<bool> cpu_accuracy_first_time{linkage, true, "cpu_accuracy_first_time", Category::Cpu}; 575 Setting<bool> cpu_accuracy_first_time{linkage, true, "cpu_accuracy_first_time", Category::Cpu};
@@ -657,28 +665,28 @@ struct Values {
657 linkage, 100, 0, 9999, "speed_limit", Category::Renderer, true, true}; 665 linkage, 100, 0, 9999, "speed_limit", Category::Renderer, true, true};
658 SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache", 666 SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
659 Category::Renderer}; 667 Category::Renderer};
660 SwitchableSetting<GPUAccuracy, true> gpu_accuracy{linkage, 668 SwitchableSetting<GpuAccuracy, true> gpu_accuracy{linkage,
661 GPUAccuracy::High, 669 GpuAccuracy::High,
662 GPUAccuracy::Normal, 670 GpuAccuracy::Normal,
663 GPUAccuracy::Extreme, 671 GpuAccuracy::Extreme,
664 "gpu_accuracy", 672 "gpu_accuracy",
665 Category::RendererAdvanced, 673 Category::RendererAdvanced,
666 true, 674 true,
667 true}; 675 true};
668 SwitchableSetting<bool> use_asynchronous_gpu_emulation{ 676 SwitchableSetting<bool> use_asynchronous_gpu_emulation{
669 linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer}; 677 linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer};
670 SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::GPU, 678 SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::Gpu,
671 "nvdec_emulation", Category::Renderer}; 679 "nvdec_emulation", Category::Renderer};
672 SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage, 680 SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage,
673 AstcDecodeMode::CPU, 681 AstcDecodeMode::Cpu,
674 AstcDecodeMode::CPU, 682 AstcDecodeMode::Cpu,
675 AstcDecodeMode::CPUAsynchronous, 683 AstcDecodeMode::CpuAsynchronous,
676 "accelerate_astc", 684 "accelerate_astc",
677 Category::Renderer}; 685 Category::Renderer};
678 Setting<VSyncMode, true> vsync_mode{linkage, 686 Setting<VSyncMode, true> vsync_mode{linkage,
679 VSyncMode::FIFO, 687 VSyncMode::Fifo,
680 VSyncMode::Immediate, 688 VSyncMode::Immediate,
681 VSyncMode::FIFORelaxed, 689 VSyncMode::FifoRelaxed,
682 "use_vsync", 690 "use_vsync",
683 Category::Renderer, 691 Category::Renderer,
684 true, 692 true,
@@ -686,7 +694,7 @@ struct Values {
686 SwitchableSetting<bool> use_reactive_flushing{linkage, true, "use_reactive_flushing", 694 SwitchableSetting<bool> use_reactive_flushing{linkage, true, "use_reactive_flushing",
687 Category::RendererAdvanced}; 695 Category::RendererAdvanced};
688 SwitchableSetting<ShaderBackend, true> shader_backend{ 696 SwitchableSetting<ShaderBackend, true> shader_backend{
689 linkage, ShaderBackend::GLSL, ShaderBackend::GLSL, ShaderBackend::SPIRV, 697 linkage, ShaderBackend::Glsl, ShaderBackend::Glsl, ShaderBackend::SpirV,
690 "shader_backend", Category::Renderer}; 698 "shader_backend", Category::Renderer};
691 SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders", 699 SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
692 Category::RendererAdvanced}; 700 Category::RendererAdvanced};
@@ -730,7 +738,7 @@ struct Values {
730 Language::PortugueseBrazilian, 738 Language::PortugueseBrazilian,
731 "language_index", 739 "language_index",
732 Category::System}; 740 Category::System};
733 SwitchableSetting<Region, true> region_index{linkage, Region::USA, Region::Japan, 741 SwitchableSetting<Region, true> region_index{linkage, Region::Usa, Region::Japan,
734 Region::Taiwan, "region_index", Category::System}; 742 Region::Taiwan, "region_index", Category::System};
735 SwitchableSetting<TimeZone, true> time_zone_index{linkage, TimeZone::Auto, 743 SwitchableSetting<TimeZone, true> time_zone_index{linkage, TimeZone::Auto,
736 TimeZone::Auto, TimeZone::Zulu, 744 TimeZone::Auto, TimeZone::Zulu,