diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/settings.cpp | 16 | ||||
| -rw-r--r-- | src/common/settings.h | 410 |
2 files changed, 303 insertions, 123 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index e1bb4b7ff..0061e29cc 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -41,7 +41,7 @@ void LogSettings() { | |||
| 41 | LOG_INFO(Config, "yuzu Configuration:"); | 41 | LOG_INFO(Config, "yuzu Configuration:"); |
| 42 | log_setting("Controls_UseDockedMode", values.use_docked_mode.GetValue()); | 42 | log_setting("Controls_UseDockedMode", values.use_docked_mode.GetValue()); |
| 43 | log_setting("System_RngSeed", values.rng_seed.GetValue().value_or(0)); | 43 | log_setting("System_RngSeed", values.rng_seed.GetValue().value_or(0)); |
| 44 | log_setting("System_CurrentUser", values.current_user); | 44 | log_setting("System_CurrentUser", values.current_user.GetValue()); |
| 45 | log_setting("System_LanguageIndex", values.language_index.GetValue()); | 45 | log_setting("System_LanguageIndex", values.language_index.GetValue()); |
| 46 | log_setting("System_RegionIndex", values.region_index.GetValue()); | 46 | log_setting("System_RegionIndex", values.region_index.GetValue()); |
| 47 | log_setting("System_TimeZoneIndex", values.time_zone_index.GetValue()); | 47 | log_setting("System_TimeZoneIndex", values.time_zone_index.GetValue()); |
| @@ -61,18 +61,18 @@ void LogSettings() { | |||
| 61 | log_setting("Renderer_UseAsynchronousShaders", values.use_asynchronous_shaders.GetValue()); | 61 | log_setting("Renderer_UseAsynchronousShaders", values.use_asynchronous_shaders.GetValue()); |
| 62 | log_setting("Renderer_UseGarbageCollection", values.use_caches_gc.GetValue()); | 62 | log_setting("Renderer_UseGarbageCollection", values.use_caches_gc.GetValue()); |
| 63 | log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue()); | 63 | log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue()); |
| 64 | log_setting("Audio_OutputEngine", values.sink_id); | 64 | log_setting("Audio_OutputEngine", values.sink_id.GetValue()); |
| 65 | log_setting("Audio_EnableAudioStretching", values.enable_audio_stretching.GetValue()); | 65 | log_setting("Audio_EnableAudioStretching", values.enable_audio_stretching.GetValue()); |
| 66 | log_setting("Audio_OutputDevice", values.audio_device_id); | 66 | log_setting("Audio_OutputDevice", values.audio_device_id.GetValue()); |
| 67 | log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd); | 67 | log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd.GetValue()); |
| 68 | log_path("DataStorage_CacheDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir)); | 68 | log_path("DataStorage_CacheDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir)); |
| 69 | log_path("DataStorage_ConfigDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir)); | 69 | log_path("DataStorage_ConfigDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir)); |
| 70 | log_path("DataStorage_LoadDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::LoadDir)); | 70 | log_path("DataStorage_LoadDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::LoadDir)); |
| 71 | log_path("DataStorage_NANDDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir)); | 71 | log_path("DataStorage_NANDDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir)); |
| 72 | log_path("DataStorage_SDMCDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir)); | 72 | log_path("DataStorage_SDMCDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir)); |
| 73 | log_setting("Debugging_ProgramArgs", values.program_args); | 73 | log_setting("Debugging_ProgramArgs", values.program_args.GetValue()); |
| 74 | log_setting("Services_BCATBackend", values.bcat_backend); | 74 | log_setting("Services_BCATBackend", values.bcat_backend.GetValue()); |
| 75 | log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local); | 75 | log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local.GetValue()); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | bool IsConfiguringGlobal() { | 78 | bool IsConfiguringGlobal() { |
| @@ -94,7 +94,7 @@ bool IsGPULevelHigh() { | |||
| 94 | 94 | ||
| 95 | bool IsFastmemEnabled() { | 95 | bool IsFastmemEnabled() { |
| 96 | if (values.cpu_accuracy.GetValue() == CPUAccuracy::DebugMode) { | 96 | if (values.cpu_accuracy.GetValue() == CPUAccuracy::DebugMode) { |
| 97 | return values.cpuopt_fastmem; | 97 | return static_cast<bool>(values.cpuopt_fastmem); |
| 98 | } | 98 | } |
| 99 | return true; | 99 | return true; |
| 100 | } | 100 | } |
diff --git a/src/common/settings.h b/src/common/settings.h index 82ec18e27..bf83186f5 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -10,10 +10,12 @@ | |||
| 10 | #include <map> | 10 | #include <map> |
| 11 | #include <optional> | 11 | #include <optional> |
| 12 | #include <string> | 12 | #include <string> |
| 13 | #include <utility> | ||
| 13 | #include <vector> | 14 | #include <vector> |
| 14 | 15 | ||
| 15 | #include "common/common_types.h" | 16 | #include "common/common_types.h" |
| 16 | #include "common/settings_input.h" | 17 | #include "common/settings_input.h" |
| 18 | #include "input_common/udp/client.h" | ||
| 17 | 19 | ||
| 18 | namespace Settings { | 20 | namespace Settings { |
| 19 | 21 | ||
| @@ -34,68 +36,235 @@ enum class CPUAccuracy : u32 { | |||
| 34 | DebugMode = 2, | 36 | DebugMode = 2, |
| 35 | }; | 37 | }; |
| 36 | 38 | ||
| 39 | /** The BasicSetting class is a simple resource manager. It defines a label and default value | ||
| 40 | * alongside the actual value of the setting for simpler and less-error prone use with frontend | ||
| 41 | * configurations. Setting a default value and label is required, though subclasses may deviate from | ||
| 42 | * this requirement. | ||
| 43 | */ | ||
| 44 | template <typename Type> | ||
| 45 | class BasicSetting { | ||
| 46 | protected: | ||
| 47 | BasicSetting() = default; | ||
| 48 | |||
| 49 | /** | ||
| 50 | * Only sets the setting to the given initializer, leaving the other members to their default | ||
| 51 | * initializers. | ||
| 52 | * | ||
| 53 | * @param global_val Initial value of the setting | ||
| 54 | */ | ||
| 55 | explicit BasicSetting(const Type& global_val) : global{global_val} {} | ||
| 56 | |||
| 57 | public: | ||
| 58 | /** | ||
| 59 | * Sets a default value, label, and setting value. | ||
| 60 | * | ||
| 61 | * @param default_val Intial value of the setting, and default value of the setting | ||
| 62 | * @param name Label for the setting | ||
| 63 | */ | ||
| 64 | explicit BasicSetting(const Type& default_val, const std::string& name) | ||
| 65 | : default_value{default_val}, global{default_val}, label{name} {} | ||
| 66 | ~BasicSetting() = default; | ||
| 67 | |||
| 68 | /** | ||
| 69 | * Returns a reference to the setting's value. | ||
| 70 | * | ||
| 71 | * @returns A reference to the setting | ||
| 72 | */ | ||
| 73 | [[nodiscard]] const Type& GetValue() const { | ||
| 74 | return global; | ||
| 75 | } | ||
| 76 | |||
| 77 | /** | ||
| 78 | * Sets the setting to the given value. | ||
| 79 | * | ||
| 80 | * @param value The desired value | ||
| 81 | */ | ||
| 82 | void SetValue(const Type& value) { | ||
| 83 | Type temp{value}; | ||
| 84 | std::swap(global, temp); | ||
| 85 | } | ||
| 86 | |||
| 87 | /** | ||
| 88 | * Returns the value that this setting was created with. | ||
| 89 | * | ||
| 90 | * @returns A reference to the default value | ||
| 91 | */ | ||
| 92 | [[nodiscard]] const Type& GetDefault() const { | ||
| 93 | return default_value; | ||
| 94 | } | ||
| 95 | |||
| 96 | /** | ||
| 97 | * Returns the label this setting was created with. | ||
| 98 | * | ||
| 99 | * @returns A reference to the label | ||
| 100 | */ | ||
| 101 | [[nodiscard]] const std::string& GetLabel() const { | ||
| 102 | return label; | ||
| 103 | } | ||
| 104 | |||
| 105 | /** | ||
| 106 | * Assigns a value to the setting. | ||
| 107 | * | ||
| 108 | * @param value The desired setting value | ||
| 109 | * | ||
| 110 | * @returns A reference to the setting | ||
| 111 | */ | ||
| 112 | const Type& operator=(const Type& value) { | ||
| 113 | Type temp{value}; | ||
| 114 | std::swap(global, temp); | ||
| 115 | return global; | ||
| 116 | } | ||
| 117 | |||
| 118 | /** | ||
| 119 | * Returns a reference to the setting. | ||
| 120 | * | ||
| 121 | * @returns A reference to the setting | ||
| 122 | */ | ||
| 123 | explicit operator const Type&() const { | ||
| 124 | return global; | ||
| 125 | } | ||
| 126 | |||
| 127 | protected: | ||
| 128 | const Type default_value{}; ///< The default value | ||
| 129 | Type global{}; ///< The setting | ||
| 130 | const std::string label{}; ///< The setting's label | ||
| 131 | }; | ||
| 132 | |||
| 133 | /** | ||
| 134 | * The Setting class is a slightly more complex version of the BasicSetting class. This adds a | ||
| 135 | * custom setting to switch to when a guest application specifically requires it. The effect is that | ||
| 136 | * other components of the emulator can access the setting's intended value without any need for the | ||
| 137 | * component to ask whether the custom or global setting is needed at the moment. | ||
| 138 | * | ||
| 139 | * By default, the global setting is used. | ||
| 140 | * | ||
| 141 | * Like the BasicSetting, this requires setting a default value and label to use. | ||
| 142 | */ | ||
| 37 | template <typename Type> | 143 | template <typename Type> |
| 38 | class Setting final { | 144 | class Setting final : public BasicSetting<Type> { |
| 39 | public: | 145 | public: |
| 40 | Setting() = default; | 146 | /** |
| 41 | explicit Setting(Type val) : global{val} {} | 147 | * Sets a default value, label, and setting value. |
| 148 | * | ||
| 149 | * @param default_val Intial value of the setting, and default value of the setting | ||
| 150 | * @param name Label for the setting | ||
| 151 | */ | ||
| 152 | explicit Setting(const Type& default_val, const std::string& name) | ||
| 153 | : BasicSetting<Type>(default_val, name) {} | ||
| 42 | ~Setting() = default; | 154 | ~Setting() = default; |
| 155 | |||
| 156 | /** | ||
| 157 | * Tells this setting to represent either the global or custom setting when other member | ||
| 158 | * functions are used. | ||
| 159 | * | ||
| 160 | * @param to_global Whether to use the global or custom setting. | ||
| 161 | */ | ||
| 43 | void SetGlobal(bool to_global) { | 162 | void SetGlobal(bool to_global) { |
| 44 | use_global = to_global; | 163 | use_global = to_global; |
| 45 | } | 164 | } |
| 46 | bool UsingGlobal() const { | 165 | |
| 166 | /** | ||
| 167 | * Returns whether this setting is using the global setting or not. | ||
| 168 | * | ||
| 169 | * @returns The global state | ||
| 170 | */ | ||
| 171 | [[nodiscard]] bool UsingGlobal() const { | ||
| 47 | return use_global; | 172 | return use_global; |
| 48 | } | 173 | } |
| 49 | Type GetValue(bool need_global = false) const { | 174 | |
| 175 | /** | ||
| 176 | * Returns either the global or custom setting depending on the values of this setting's global | ||
| 177 | * state or if the global value was specifically requested. | ||
| 178 | * | ||
| 179 | * @param need_global Request global value regardless of setting's state; defaults to false | ||
| 180 | * | ||
| 181 | * @returns The required value of the setting | ||
| 182 | */ | ||
| 183 | [[nodiscard]] const Type& GetValue(bool need_global = false) const { | ||
| 50 | if (use_global || need_global) { | 184 | if (use_global || need_global) { |
| 51 | return global; | 185 | return this->global; |
| 52 | } | 186 | } |
| 53 | return local; | 187 | return custom; |
| 54 | } | 188 | } |
| 189 | |||
| 190 | /** | ||
| 191 | * Sets the current setting value depending on the global state. | ||
| 192 | * | ||
| 193 | * @param value The new value | ||
| 194 | */ | ||
| 55 | void SetValue(const Type& value) { | 195 | void SetValue(const Type& value) { |
| 196 | Type temp{value}; | ||
| 56 | if (use_global) { | 197 | if (use_global) { |
| 57 | global = value; | 198 | std::swap(this->global, temp); |
| 58 | } else { | 199 | } else { |
| 59 | local = value; | 200 | std::swap(custom, temp); |
| 201 | } | ||
| 202 | } | ||
| 203 | |||
| 204 | /** | ||
| 205 | * Assigns the current setting value depending on the global state. | ||
| 206 | * | ||
| 207 | * @param value The new value | ||
| 208 | * | ||
| 209 | * @returns A reference to the current setting value | ||
| 210 | */ | ||
| 211 | const Type& operator=(const Type& value) { | ||
| 212 | Type temp{value}; | ||
| 213 | if (use_global) { | ||
| 214 | std::swap(this->global, temp); | ||
| 215 | return this->global; | ||
| 216 | } | ||
| 217 | std::swap(custom, temp); | ||
| 218 | return custom; | ||
| 219 | } | ||
| 220 | |||
| 221 | /** | ||
| 222 | * Returns the current setting value depending on the global state. | ||
| 223 | * | ||
| 224 | * @returns A reference to the current setting value | ||
| 225 | */ | ||
| 226 | explicit operator const Type&() const { | ||
| 227 | if (use_global) { | ||
| 228 | return this->global; | ||
| 60 | } | 229 | } |
| 230 | return custom; | ||
| 61 | } | 231 | } |
| 62 | 232 | ||
| 63 | private: | 233 | private: |
| 64 | bool use_global = true; | 234 | bool use_global{true}; ///< The setting's global state |
| 65 | Type global{}; | 235 | Type custom{}; ///< The custom value of the setting |
| 66 | Type local{}; | ||
| 67 | }; | 236 | }; |
| 68 | 237 | ||
| 69 | /** | 238 | /** |
| 70 | * The InputSetting class allows for getting a reference to either the global or local members. | 239 | * The InputSetting class allows for getting a reference to either the global or custom members. |
| 71 | * This is required as we cannot easily modify the values of user-defined types within containers | 240 | * This is required as we cannot easily modify the values of user-defined types within containers |
| 72 | * using the SetValue() member function found in the Setting class. The primary purpose of this | 241 | * using the SetValue() member function found in the Setting class. The primary purpose of this |
| 73 | * class is to store an array of 10 PlayerInput structs for both the global and local (per-game) | 242 | * class is to store an array of 10 PlayerInput structs for both the global and custom setting and |
| 74 | * setting and allows for easily accessing and modifying both settings. | 243 | * allows for easily accessing and modifying both settings. |
| 75 | */ | 244 | */ |
| 76 | template <typename Type> | 245 | template <typename Type> |
| 77 | class InputSetting final { | 246 | class InputSetting final { |
| 78 | public: | 247 | public: |
| 79 | InputSetting() = default; | 248 | InputSetting() = default; |
| 80 | explicit InputSetting(Type val) : global{val} {} | 249 | explicit InputSetting(Type val) : BasicSetting<Type>(val) {} |
| 81 | ~InputSetting() = default; | 250 | ~InputSetting() = default; |
| 82 | void SetGlobal(bool to_global) { | 251 | void SetGlobal(bool to_global) { |
| 83 | use_global = to_global; | 252 | use_global = to_global; |
| 84 | } | 253 | } |
| 85 | bool UsingGlobal() const { | 254 | [[nodiscard]] bool UsingGlobal() const { |
| 86 | return use_global; | 255 | return use_global; |
| 87 | } | 256 | } |
| 88 | Type& GetValue(bool need_global = false) { | 257 | [[nodiscard]] Type& GetValue(bool need_global = false) { |
| 89 | if (use_global || need_global) { | 258 | if (use_global || need_global) { |
| 90 | return global; | 259 | return global; |
| 91 | } | 260 | } |
| 92 | return local; | 261 | return custom; |
| 93 | } | 262 | } |
| 94 | 263 | ||
| 95 | private: | 264 | private: |
| 96 | bool use_global = true; | 265 | bool use_global{true}; ///< The setting's global state |
| 97 | Type global{}; | 266 | Type global{}; ///< The setting |
| 98 | Type local{}; | 267 | Type custom{}; ///< The custom setting value |
| 99 | }; | 268 | }; |
| 100 | 269 | ||
| 101 | struct TouchFromButtonMap { | 270 | struct TouchFromButtonMap { |
| @@ -105,144 +274,155 @@ struct TouchFromButtonMap { | |||
| 105 | 274 | ||
| 106 | struct Values { | 275 | struct Values { |
| 107 | // Audio | 276 | // Audio |
| 108 | std::string audio_device_id; | 277 | BasicSetting<std::string> audio_device_id{"auto", "output_device"}; |
| 109 | std::string sink_id; | 278 | BasicSetting<std::string> sink_id{"auto", "output_engine"}; |
| 110 | bool audio_muted; | 279 | BasicSetting<bool> audio_muted{false, "audio_muted"}; |
| 111 | Setting<bool> enable_audio_stretching; | 280 | Setting<bool> enable_audio_stretching{true, "enable_audio_stretching"}; |
| 112 | Setting<float> volume; | 281 | Setting<float> volume{1.0f, "volume"}; |
| 113 | 282 | ||
| 114 | // Core | 283 | // Core |
| 115 | Setting<bool> use_multi_core; | 284 | Setting<bool> use_multi_core{true, "use_multi_core"}; |
| 116 | 285 | ||
| 117 | // Cpu | 286 | // Cpu |
| 118 | Setting<CPUAccuracy> cpu_accuracy; | 287 | Setting<CPUAccuracy> cpu_accuracy{CPUAccuracy::Accurate, "cpu_accuracy"}; |
| 119 | 288 | ||
| 120 | bool cpuopt_page_tables; | 289 | BasicSetting<bool> cpuopt_page_tables{true, "cpuopt_page_tables"}; |
| 121 | bool cpuopt_block_linking; | 290 | BasicSetting<bool> cpuopt_block_linking{true, "cpuopt_block_linking"}; |
| 122 | bool cpuopt_return_stack_buffer; | 291 | BasicSetting<bool> cpuopt_return_stack_buffer{true, "cpuopt_return_stack_buffer"}; |
| 123 | bool cpuopt_fast_dispatcher; | 292 | BasicSetting<bool> cpuopt_fast_dispatcher{true, "cpuopt_fast_dispatcher"}; |
| 124 | bool cpuopt_context_elimination; | 293 | BasicSetting<bool> cpuopt_context_elimination{true, "cpuopt_context_elimination"}; |
| 125 | bool cpuopt_const_prop; | 294 | BasicSetting<bool> cpuopt_const_prop{true, "cpuopt_const_prop"}; |
| 126 | bool cpuopt_misc_ir; | 295 | BasicSetting<bool> cpuopt_misc_ir{true, "cpuopt_misc_ir"}; |
| 127 | bool cpuopt_reduce_misalign_checks; | 296 | BasicSetting<bool> cpuopt_reduce_misalign_checks{true, "cpuopt_reduce_misalign_checks"}; |
| 128 | bool cpuopt_fastmem; | 297 | BasicSetting<bool> cpuopt_fastmem{true, "cpuopt_fastmem"}; |
| 129 | 298 | ||
| 130 | Setting<bool> cpuopt_unsafe_unfuse_fma; | 299 | Setting<bool> cpuopt_unsafe_unfuse_fma{true, "cpuopt_unsafe_unfuse_fma"}; |
| 131 | Setting<bool> cpuopt_unsafe_reduce_fp_error; | 300 | Setting<bool> cpuopt_unsafe_reduce_fp_error{true, "cpuopt_unsafe_reduce_fp_error"}; |
| 132 | Setting<bool> cpuopt_unsafe_ignore_standard_fpcr; | 301 | Setting<bool> cpuopt_unsafe_ignore_standard_fpcr{true, "cpuopt_unsafe_ignore_standard_fpcr"}; |
| 133 | Setting<bool> cpuopt_unsafe_inaccurate_nan; | 302 | Setting<bool> cpuopt_unsafe_inaccurate_nan{true, "cpuopt_unsafe_inaccurate_nan"}; |
| 134 | Setting<bool> cpuopt_unsafe_fastmem_check; | 303 | Setting<bool> cpuopt_unsafe_fastmem_check{true, "cpuopt_unsafe_fastmem_check"}; |
| 135 | 304 | ||
| 136 | // Renderer | 305 | // Renderer |
| 137 | Setting<RendererBackend> renderer_backend; | 306 | Setting<RendererBackend> renderer_backend{RendererBackend::OpenGL, "backend"}; |
| 138 | bool renderer_debug; | 307 | BasicSetting<bool> renderer_debug{false, "debug"}; |
| 139 | Setting<int> vulkan_device; | 308 | Setting<int> vulkan_device{0, "vulkan_device"}; |
| 140 | 309 | ||
| 141 | Setting<u16> resolution_factor{1}; | 310 | Setting<u16> resolution_factor{1, "resolution_factor"}; |
| 142 | Setting<int> fullscreen_mode; | 311 | // *nix platforms may have issues with the borderless windowed fullscreen mode. |
| 143 | Setting<int> aspect_ratio; | 312 | // Default to exclusive fullscreen on these platforms for now. |
| 144 | Setting<int> max_anisotropy; | 313 | Setting<int> fullscreen_mode{ |
| 145 | Setting<bool> use_frame_limit; | 314 | #ifdef _WIN32 |
| 146 | Setting<u16> frame_limit; | 315 | 0, |
| 147 | Setting<bool> use_disk_shader_cache; | 316 | #else |
| 148 | Setting<GPUAccuracy> gpu_accuracy; | 317 | 1, |
| 149 | Setting<bool> use_asynchronous_gpu_emulation; | 318 | #endif |
| 150 | Setting<bool> use_nvdec_emulation; | 319 | "fullscreen_mode"}; |
| 151 | Setting<bool> accelerate_astc; | 320 | Setting<int> aspect_ratio{0, "aspect_ratio"}; |
| 152 | Setting<bool> use_vsync; | 321 | Setting<int> max_anisotropy{0, "max_anisotropy"}; |
| 153 | Setting<bool> disable_fps_limit; | 322 | Setting<bool> use_frame_limit{true, "use_frame_limit"}; |
| 154 | Setting<bool> use_assembly_shaders; | 323 | Setting<u16> frame_limit{100, "frame_limit"}; |
| 155 | Setting<bool> use_asynchronous_shaders; | 324 | Setting<bool> use_disk_shader_cache{true, "use_disk_shader_cache"}; |
| 156 | Setting<bool> use_fast_gpu_time; | 325 | Setting<GPUAccuracy> gpu_accuracy{GPUAccuracy::High, "gpu_accuracy"}; |
| 157 | Setting<bool> use_caches_gc; | 326 | Setting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"}; |
| 158 | 327 | Setting<bool> use_nvdec_emulation{true, "use_nvdec_emulation"}; | |
| 159 | Setting<float> bg_red; | 328 | Setting<bool> accelerate_astc{true, "accelerate_astc"}; |
| 160 | Setting<float> bg_green; | 329 | Setting<bool> use_vsync{true, "use_vsync"}; |
| 161 | Setting<float> bg_blue; | 330 | Setting<bool> disable_fps_limit{false, "disable_fps_limit"}; |
| 331 | Setting<bool> use_assembly_shaders{false, "use_assembly_shaders"}; | ||
| 332 | Setting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"}; | ||
| 333 | Setting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; | ||
| 334 | Setting<bool> use_caches_gc{false, "use_caches_gc"}; | ||
| 335 | |||
| 336 | Setting<float> bg_red{0.0f, "bg_red"}; | ||
| 337 | Setting<float> bg_green{0.0f, "bg_green"}; | ||
| 338 | Setting<float> bg_blue{0.0f, "bg_blue"}; | ||
| 162 | 339 | ||
| 163 | // System | 340 | // System |
| 164 | Setting<std::optional<u32>> rng_seed; | 341 | Setting<std::optional<u32>> rng_seed{std::optional<u32>(), "rng_seed"}; |
| 165 | // Measured in seconds since epoch | 342 | // Measured in seconds since epoch |
| 166 | std::optional<std::chrono::seconds> custom_rtc; | 343 | std::optional<std::chrono::seconds> custom_rtc; |
| 167 | // Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc` | 344 | // Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc` |
| 168 | std::chrono::seconds custom_rtc_differential; | 345 | std::chrono::seconds custom_rtc_differential; |
| 169 | 346 | ||
| 170 | s32 current_user; | 347 | BasicSetting<s32> current_user{0, "current_user"}; |
| 171 | Setting<s32> language_index; | 348 | Setting<s32> language_index{1, "language_index"}; |
| 172 | Setting<s32> region_index; | 349 | Setting<s32> region_index{1, "region_index"}; |
| 173 | Setting<s32> time_zone_index; | 350 | Setting<s32> time_zone_index{0, "time_zone_index"}; |
| 174 | Setting<s32> sound_index; | 351 | Setting<s32> sound_index{1, "sound_index"}; |
| 175 | 352 | ||
| 176 | // Controls | 353 | // Controls |
| 177 | InputSetting<std::array<PlayerInput, 10>> players; | 354 | InputSetting<std::array<PlayerInput, 10>> players; |
| 178 | 355 | ||
| 179 | Setting<bool> use_docked_mode; | 356 | Setting<bool> use_docked_mode{true, "use_docked_mode"}; |
| 180 | 357 | ||
| 181 | Setting<bool> vibration_enabled; | 358 | Setting<bool> vibration_enabled{true, "vibration_enabled"}; |
| 182 | Setting<bool> enable_accurate_vibrations; | 359 | Setting<bool> enable_accurate_vibrations{false, "enable_accurate_vibrations"}; |
| 183 | 360 | ||
| 184 | Setting<bool> motion_enabled; | 361 | Setting<bool> motion_enabled{true, "motion_enabled"}; |
| 185 | std::string motion_device; | 362 | BasicSetting<std::string> motion_device{"engine:motion_emu,update_period:100,sensitivity:0.01", |
| 186 | std::string udp_input_servers; | 363 | "motion_device"}; |
| 364 | BasicSetting<std::string> udp_input_servers{InputCommon::CemuhookUDP::DEFAULT_SRV, | ||
| 365 | "udp_input_servers"}; | ||
| 187 | 366 | ||
| 188 | bool mouse_panning; | 367 | BasicSetting<bool> mouse_panning{false, "mouse_panning"}; |
| 189 | float mouse_panning_sensitivity; | 368 | BasicSetting<float> mouse_panning_sensitivity{1.0f, "mouse_panning_sensitivity"}; |
| 190 | bool mouse_enabled; | 369 | BasicSetting<bool> mouse_enabled{false, "mouse_enabled"}; |
| 191 | std::string mouse_device; | 370 | std::string mouse_device; |
| 192 | MouseButtonsRaw mouse_buttons; | 371 | MouseButtonsRaw mouse_buttons; |
| 193 | 372 | ||
| 194 | bool emulate_analog_keyboard; | 373 | BasicSetting<bool> emulate_analog_keyboard{false, "emulate_analog_keyboard"}; |
| 195 | bool keyboard_enabled; | 374 | BasicSetting<bool> keyboard_enabled{false, "keyboard_enabled"}; |
| 196 | KeyboardKeysRaw keyboard_keys; | 375 | KeyboardKeysRaw keyboard_keys; |
| 197 | KeyboardModsRaw keyboard_mods; | 376 | KeyboardModsRaw keyboard_mods; |
| 198 | 377 | ||
| 199 | bool debug_pad_enabled; | 378 | BasicSetting<bool> debug_pad_enabled{false, "debug_pad_enabled"}; |
| 200 | ButtonsRaw debug_pad_buttons; | 379 | ButtonsRaw debug_pad_buttons; |
| 201 | AnalogsRaw debug_pad_analogs; | 380 | AnalogsRaw debug_pad_analogs; |
| 202 | 381 | ||
| 203 | TouchscreenInput touchscreen; | 382 | TouchscreenInput touchscreen; |
| 204 | 383 | ||
| 205 | bool use_touch_from_button; | 384 | BasicSetting<bool> use_touch_from_button{false, "use_touch_from_button"}; |
| 206 | std::string touch_device; | 385 | BasicSetting<std::string> touch_device{"min_x:100,min_y:50,max_x:1800,max_y:850", |
| 207 | int touch_from_button_map_index; | 386 | "touch_device"}; |
| 387 | BasicSetting<int> touch_from_button_map_index{0, "touch_from_button_map"}; | ||
| 208 | std::vector<TouchFromButtonMap> touch_from_button_maps; | 388 | std::vector<TouchFromButtonMap> touch_from_button_maps; |
| 209 | 389 | ||
| 210 | std::atomic_bool is_device_reload_pending{true}; | 390 | std::atomic_bool is_device_reload_pending{true}; |
| 211 | 391 | ||
| 212 | // Data Storage | 392 | // Data Storage |
| 213 | bool use_virtual_sd; | 393 | BasicSetting<bool> use_virtual_sd{true, "use_virtual_sd"}; |
| 214 | bool gamecard_inserted; | 394 | BasicSetting<bool> gamecard_inserted{false, "gamecard_inserted"}; |
| 215 | bool gamecard_current_game; | 395 | BasicSetting<bool> gamecard_current_game{false, "gamecard_current_game"}; |
| 216 | std::string gamecard_path; | 396 | BasicSetting<std::string> gamecard_path{std::string(), "gamecard_path"}; |
| 217 | 397 | ||
| 218 | // Debugging | 398 | // Debugging |
| 219 | bool record_frame_times; | 399 | bool record_frame_times; |
| 220 | bool use_gdbstub; | 400 | BasicSetting<bool> use_gdbstub{false, "use_gdbstub"}; |
| 221 | u16 gdbstub_port; | 401 | BasicSetting<u16> gdbstub_port{0, "gdbstub_port"}; |
| 222 | std::string program_args; | 402 | BasicSetting<std::string> program_args{std::string(), "program_args"}; |
| 223 | bool dump_exefs; | 403 | BasicSetting<bool> dump_exefs{false, "dump_exefs"}; |
| 224 | bool dump_nso; | 404 | BasicSetting<bool> dump_nso{false, "dump_nso"}; |
| 225 | bool enable_fs_access_log; | 405 | BasicSetting<bool> enable_fs_access_log{false, "enable_fs_access_log"}; |
| 226 | bool reporting_services; | 406 | BasicSetting<bool> reporting_services{false, "reporting_services"}; |
| 227 | bool quest_flag; | 407 | BasicSetting<bool> quest_flag{false, "quest_flag"}; |
| 228 | bool disable_macro_jit; | 408 | BasicSetting<bool> disable_macro_jit{false, "disable_macro_jit"}; |
| 229 | bool extended_logging; | 409 | BasicSetting<bool> extended_logging{false, "extended_logging"}; |
| 230 | bool use_debug_asserts; | 410 | BasicSetting<bool> use_debug_asserts{false, "use_debug_asserts"}; |
| 231 | bool use_auto_stub; | 411 | BasicSetting<bool> use_auto_stub{false, "use_auto_stub"}; |
| 232 | 412 | ||
| 233 | // Miscellaneous | 413 | // Miscellaneous |
| 234 | std::string log_filter; | 414 | BasicSetting<std::string> log_filter{"*:Info", "log_filter"}; |
| 235 | bool use_dev_keys; | 415 | BasicSetting<bool> use_dev_keys{false, "use_dev_keys"}; |
| 236 | 416 | ||
| 237 | // Services | 417 | // Services |
| 238 | std::string bcat_backend; | 418 | BasicSetting<std::string> bcat_backend{"none", "bcat_backend"}; |
| 239 | bool bcat_boxcat_local; | 419 | BasicSetting<bool> bcat_boxcat_local{false, "bcat_boxcat_local"}; |
| 240 | 420 | ||
| 241 | // WebService | 421 | // WebService |
| 242 | bool enable_telemetry; | 422 | BasicSetting<bool> enable_telemetry{true, "enable_telemetry"}; |
| 243 | std::string web_api_url; | 423 | BasicSetting<std::string> web_api_url{"https://api.yuzu-emu.org", "web_api_url"}; |
| 244 | std::string yuzu_username; | 424 | BasicSetting<std::string> yuzu_username{std::string(), "yuzu_username"}; |
| 245 | std::string yuzu_token; | 425 | BasicSetting<std::string> yuzu_token{std::string(), "yuzu_token"}; |
| 246 | 426 | ||
| 247 | // Add-Ons | 427 | // Add-Ons |
| 248 | std::map<u64, std::vector<std::string>> disabled_addons; | 428 | std::map<u64, std::vector<std::string>> disabled_addons; |