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