settings.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <algorithm>
  5. #include <array>
  6. #include <map>
  7. #include <optional>
  8. #include <string>
  9. #include <utility>
  10. #include <vector>
  11. #include "common/common_types.h"
  12. #include "common/settings_input.h"
  13. namespace Settings {
  14. enum class RendererBackend : u32 {
  15. OpenGL = 0,
  16. Vulkan = 1,
  17. Null = 2,
  18. };
  19. enum class ShaderBackend : u32 {
  20. GLSL = 0,
  21. GLASM = 1,
  22. SPIRV = 2,
  23. };
  24. enum class GPUAccuracy : u32 {
  25. Normal = 0,
  26. High = 1,
  27. Extreme = 2,
  28. };
  29. enum class CPUAccuracy : u32 {
  30. Auto = 0,
  31. Accurate = 1,
  32. Unsafe = 2,
  33. Paranoid = 3,
  34. };
  35. enum class FullscreenMode : u32 {
  36. Borderless = 0,
  37. Exclusive = 1,
  38. };
  39. enum class NvdecEmulation : u32 {
  40. Off = 0,
  41. CPU = 1,
  42. GPU = 2,
  43. };
  44. enum class ResolutionSetup : u32 {
  45. Res1_2X = 0,
  46. Res3_4X = 1,
  47. Res1X = 2,
  48. Res3_2X = 3,
  49. Res2X = 4,
  50. Res3X = 5,
  51. Res4X = 6,
  52. Res5X = 7,
  53. Res6X = 8,
  54. Res7X = 9,
  55. Res8X = 10,
  56. };
  57. enum class ScalingFilter : u32 {
  58. NearestNeighbor = 0,
  59. Bilinear = 1,
  60. Bicubic = 2,
  61. Gaussian = 3,
  62. ScaleForce = 4,
  63. Fsr = 5,
  64. LastFilter = Fsr,
  65. };
  66. enum class AntiAliasing : u32 {
  67. None = 0,
  68. Fxaa = 1,
  69. Smaa = 2,
  70. LastAA = Smaa,
  71. };
  72. struct ResolutionScalingInfo {
  73. u32 up_scale{1};
  74. u32 down_shift{0};
  75. f32 up_factor{1.0f};
  76. f32 down_factor{1.0f};
  77. bool active{};
  78. bool downscale{};
  79. s32 ScaleUp(s32 value) const {
  80. if (value == 0) {
  81. return 0;
  82. }
  83. return std::max((value * static_cast<s32>(up_scale)) >> static_cast<s32>(down_shift), 1);
  84. }
  85. u32 ScaleUp(u32 value) const {
  86. if (value == 0U) {
  87. return 0U;
  88. }
  89. return std::max((value * up_scale) >> down_shift, 1U);
  90. }
  91. };
  92. /** The Setting class is a simple resource manager. It defines a label and default value alongside
  93. * the actual value of the setting for simpler and less-error prone use with frontend
  94. * configurations. Specifying a default value and label is required. A minimum and maximum range can
  95. * be specified for sanitization.
  96. */
  97. template <typename Type, bool ranged = false>
  98. class Setting {
  99. protected:
  100. Setting() = default;
  101. /**
  102. * Only sets the setting to the given initializer, leaving the other members to their default
  103. * initializers.
  104. *
  105. * @param global_val Initial value of the setting
  106. */
  107. explicit Setting(const Type& val) : value{val} {}
  108. public:
  109. /**
  110. * Sets a default value, label, and setting value.
  111. *
  112. * @param default_val Intial value of the setting, and default value of the setting
  113. * @param name Label for the setting
  114. */
  115. explicit Setting(const Type& default_val, const std::string& name)
  116. requires(!ranged)
  117. : value{default_val}, default_value{default_val}, label{name} {}
  118. virtual ~Setting() = default;
  119. /**
  120. * Sets a default value, minimum value, maximum value, and label.
  121. *
  122. * @param default_val Intial value of the setting, and default value of the setting
  123. * @param min_val Sets the minimum allowed value of the setting
  124. * @param max_val Sets the maximum allowed value of the setting
  125. * @param name Label for the setting
  126. */
  127. explicit Setting(const Type& default_val, const Type& min_val, const Type& max_val,
  128. const std::string& name)
  129. requires(ranged)
  130. : value{default_val},
  131. default_value{default_val}, maximum{max_val}, minimum{min_val}, label{name} {}
  132. /**
  133. * Returns a reference to the setting's value.
  134. *
  135. * @returns A reference to the setting
  136. */
  137. [[nodiscard]] virtual const Type& GetValue() const {
  138. return value;
  139. }
  140. /**
  141. * Sets the setting to the given value.
  142. *
  143. * @param val The desired value
  144. */
  145. virtual void SetValue(const Type& val) {
  146. Type temp{ranged ? std::clamp(val, minimum, maximum) : val};
  147. std::swap(value, temp);
  148. }
  149. /**
  150. * Returns the value that this setting was created with.
  151. *
  152. * @returns A reference to the default value
  153. */
  154. [[nodiscard]] const Type& GetDefault() const {
  155. return default_value;
  156. }
  157. /**
  158. * Returns the label this setting was created with.
  159. *
  160. * @returns A reference to the label
  161. */
  162. [[nodiscard]] const std::string& GetLabel() const {
  163. return label;
  164. }
  165. /**
  166. * Assigns a value to the setting.
  167. *
  168. * @param val The desired setting value
  169. *
  170. * @returns A reference to the setting
  171. */
  172. virtual const Type& operator=(const Type& val) {
  173. Type temp{ranged ? std::clamp(val, minimum, maximum) : val};
  174. std::swap(value, temp);
  175. return value;
  176. }
  177. /**
  178. * Returns a reference to the setting.
  179. *
  180. * @returns A reference to the setting
  181. */
  182. explicit virtual operator const Type&() const {
  183. return value;
  184. }
  185. protected:
  186. Type value{}; ///< The setting
  187. const Type default_value{}; ///< The default value
  188. const Type maximum{}; ///< Maximum allowed value of the setting
  189. const Type minimum{}; ///< Minimum allowed value of the setting
  190. const std::string label{}; ///< The setting's label
  191. };
  192. /**
  193. * The SwitchableSetting class is a slightly more complex version of the Setting class. This adds a
  194. * custom setting to switch to when a guest application specifically requires it. The effect is that
  195. * other components of the emulator can access the setting's intended value without any need for the
  196. * component to ask whether the custom or global setting is needed at the moment.
  197. *
  198. * By default, the global setting is used.
  199. */
  200. template <typename Type, bool ranged = false>
  201. class SwitchableSetting : virtual public Setting<Type, ranged> {
  202. public:
  203. /**
  204. * Sets a default value, label, and setting value.
  205. *
  206. * @param default_val Intial value of the setting, and default value of the setting
  207. * @param name Label for the setting
  208. */
  209. explicit SwitchableSetting(const Type& default_val, const std::string& name)
  210. requires(!ranged)
  211. : Setting<Type>{default_val, name} {}
  212. virtual ~SwitchableSetting() = default;
  213. /**
  214. * Sets a default value, minimum value, maximum value, and label.
  215. *
  216. * @param default_val Intial value of the setting, and default value of the setting
  217. * @param min_val Sets the minimum allowed value of the setting
  218. * @param max_val Sets the maximum allowed value of the setting
  219. * @param name Label for the setting
  220. */
  221. explicit SwitchableSetting(const Type& default_val, const Type& min_val, const Type& max_val,
  222. const std::string& name)
  223. requires(ranged)
  224. : Setting<Type, true>{default_val, min_val, max_val, name} {}
  225. /**
  226. * Tells this setting to represent either the global or custom setting when other member
  227. * functions are used.
  228. *
  229. * @param to_global Whether to use the global or custom setting.
  230. */
  231. void SetGlobal(bool to_global) {
  232. use_global = to_global;
  233. }
  234. /**
  235. * Returns whether this setting is using the global setting or not.
  236. *
  237. * @returns The global state
  238. */
  239. [[nodiscard]] bool UsingGlobal() const {
  240. return use_global;
  241. }
  242. /**
  243. * Returns either the global or custom setting depending on the values of this setting's global
  244. * state or if the global value was specifically requested.
  245. *
  246. * @param need_global Request global value regardless of setting's state; defaults to false
  247. *
  248. * @returns The required value of the setting
  249. */
  250. [[nodiscard]] virtual const Type& GetValue() const override {
  251. if (use_global) {
  252. return this->value;
  253. }
  254. return custom;
  255. }
  256. [[nodiscard]] virtual const Type& GetValue(bool need_global) const {
  257. if (use_global || need_global) {
  258. return this->value;
  259. }
  260. return custom;
  261. }
  262. /**
  263. * Sets the current setting value depending on the global state.
  264. *
  265. * @param val The new value
  266. */
  267. void SetValue(const Type& val) override {
  268. Type temp{ranged ? std::clamp(val, this->minimum, this->maximum) : val};
  269. if (use_global) {
  270. std::swap(this->value, temp);
  271. } else {
  272. std::swap(custom, temp);
  273. }
  274. }
  275. /**
  276. * Assigns the current setting value depending on the global state.
  277. *
  278. * @param val The new value
  279. *
  280. * @returns A reference to the current setting value
  281. */
  282. const Type& operator=(const Type& val) override {
  283. Type temp{ranged ? std::clamp(val, this->minimum, this->maximum) : val};
  284. if (use_global) {
  285. std::swap(this->value, temp);
  286. return this->value;
  287. }
  288. std::swap(custom, temp);
  289. return custom;
  290. }
  291. /**
  292. * Returns the current setting value depending on the global state.
  293. *
  294. * @returns A reference to the current setting value
  295. */
  296. virtual explicit operator const Type&() const override {
  297. if (use_global) {
  298. return this->value;
  299. }
  300. return custom;
  301. }
  302. protected:
  303. bool use_global{true}; ///< The setting's global state
  304. Type custom{}; ///< The custom value of the setting
  305. };
  306. /**
  307. * The InputSetting class allows for getting a reference to either the global or custom members.
  308. * This is required as we cannot easily modify the values of user-defined types within containers
  309. * using the SetValue() member function found in the Setting class. The primary purpose of this
  310. * class is to store an array of 10 PlayerInput structs for both the global and custom setting and
  311. * allows for easily accessing and modifying both settings.
  312. */
  313. template <typename Type>
  314. class InputSetting final {
  315. public:
  316. InputSetting() = default;
  317. explicit InputSetting(Type val) : Setting<Type>(val) {}
  318. ~InputSetting() = default;
  319. void SetGlobal(bool to_global) {
  320. use_global = to_global;
  321. }
  322. [[nodiscard]] bool UsingGlobal() const {
  323. return use_global;
  324. }
  325. [[nodiscard]] Type& GetValue(bool need_global = false) {
  326. if (use_global || need_global) {
  327. return global;
  328. }
  329. return custom;
  330. }
  331. private:
  332. bool use_global{true}; ///< The setting's global state
  333. Type global{}; ///< The setting
  334. Type custom{}; ///< The custom setting value
  335. };
  336. struct TouchFromButtonMap {
  337. std::string name;
  338. std::vector<std::string> buttons;
  339. };
  340. struct Values {
  341. // Audio
  342. Setting<std::string> sink_id{"auto", "output_engine"};
  343. Setting<std::string> audio_output_device_id{"auto", "output_device"};
  344. Setting<std::string> audio_input_device_id{"auto", "input_device"};
  345. Setting<bool> audio_muted{false, "audio_muted"};
  346. SwitchableSetting<u8, true> volume{100, 0, 200, "volume"};
  347. Setting<bool> dump_audio_commands{false, "dump_audio_commands"};
  348. // Core
  349. SwitchableSetting<bool> use_multi_core{true, "use_multi_core"};
  350. SwitchableSetting<bool> use_extended_memory_layout{false, "use_extended_memory_layout"};
  351. // Cpu
  352. SwitchableSetting<CPUAccuracy, true> cpu_accuracy{CPUAccuracy::Auto, CPUAccuracy::Auto,
  353. CPUAccuracy::Paranoid, "cpu_accuracy"};
  354. // TODO: remove cpu_accuracy_first_time, migration setting added 8 July 2021
  355. Setting<bool> cpu_accuracy_first_time{true, "cpu_accuracy_first_time"};
  356. Setting<bool> cpu_debug_mode{false, "cpu_debug_mode"};
  357. Setting<bool> cpuopt_page_tables{true, "cpuopt_page_tables"};
  358. Setting<bool> cpuopt_block_linking{true, "cpuopt_block_linking"};
  359. Setting<bool> cpuopt_return_stack_buffer{true, "cpuopt_return_stack_buffer"};
  360. Setting<bool> cpuopt_fast_dispatcher{true, "cpuopt_fast_dispatcher"};
  361. Setting<bool> cpuopt_context_elimination{true, "cpuopt_context_elimination"};
  362. Setting<bool> cpuopt_const_prop{true, "cpuopt_const_prop"};
  363. Setting<bool> cpuopt_misc_ir{true, "cpuopt_misc_ir"};
  364. Setting<bool> cpuopt_reduce_misalign_checks{true, "cpuopt_reduce_misalign_checks"};
  365. Setting<bool> cpuopt_fastmem{true, "cpuopt_fastmem"};
  366. Setting<bool> cpuopt_fastmem_exclusives{true, "cpuopt_fastmem_exclusives"};
  367. Setting<bool> cpuopt_recompile_exclusives{true, "cpuopt_recompile_exclusives"};
  368. Setting<bool> cpuopt_ignore_memory_aborts{true, "cpuopt_ignore_memory_aborts"};
  369. SwitchableSetting<bool> cpuopt_unsafe_unfuse_fma{true, "cpuopt_unsafe_unfuse_fma"};
  370. SwitchableSetting<bool> cpuopt_unsafe_reduce_fp_error{true, "cpuopt_unsafe_reduce_fp_error"};
  371. SwitchableSetting<bool> cpuopt_unsafe_ignore_standard_fpcr{
  372. true, "cpuopt_unsafe_ignore_standard_fpcr"};
  373. SwitchableSetting<bool> cpuopt_unsafe_inaccurate_nan{true, "cpuopt_unsafe_inaccurate_nan"};
  374. SwitchableSetting<bool> cpuopt_unsafe_fastmem_check{true, "cpuopt_unsafe_fastmem_check"};
  375. SwitchableSetting<bool> cpuopt_unsafe_ignore_global_monitor{
  376. true, "cpuopt_unsafe_ignore_global_monitor"};
  377. // Renderer
  378. SwitchableSetting<RendererBackend, true> renderer_backend{
  379. RendererBackend::Vulkan, RendererBackend::OpenGL, RendererBackend::Null, "backend"};
  380. SwitchableSetting<bool> renderer_force_max_clock{false, "force_max_clock"};
  381. Setting<bool> renderer_debug{false, "debug"};
  382. Setting<bool> renderer_shader_feedback{false, "shader_feedback"};
  383. Setting<bool> enable_nsight_aftermath{false, "nsight_aftermath"};
  384. Setting<bool> disable_shader_loop_safety_checks{false, "disable_shader_loop_safety_checks"};
  385. SwitchableSetting<int> vulkan_device{0, "vulkan_device"};
  386. ResolutionScalingInfo resolution_info{};
  387. SwitchableSetting<ResolutionSetup> resolution_setup{ResolutionSetup::Res1X, "resolution_setup"};
  388. SwitchableSetting<ScalingFilter> scaling_filter{ScalingFilter::Bilinear, "scaling_filter"};
  389. SwitchableSetting<int, true> fsr_sharpening_slider{25, 0, 200, "fsr_sharpening_slider"};
  390. SwitchableSetting<AntiAliasing> anti_aliasing{AntiAliasing::None, "anti_aliasing"};
  391. // *nix platforms may have issues with the borderless windowed fullscreen mode.
  392. // Default to exclusive fullscreen on these platforms for now.
  393. SwitchableSetting<FullscreenMode, true> fullscreen_mode{
  394. #ifdef _WIN32
  395. FullscreenMode::Borderless,
  396. #else
  397. FullscreenMode::Exclusive,
  398. #endif
  399. FullscreenMode::Borderless, FullscreenMode::Exclusive, "fullscreen_mode"};
  400. SwitchableSetting<int, true> aspect_ratio{0, 0, 4, "aspect_ratio"};
  401. SwitchableSetting<int, true> max_anisotropy{0, 0, 5, "max_anisotropy"};
  402. SwitchableSetting<bool> use_speed_limit{true, "use_speed_limit"};
  403. SwitchableSetting<u16, true> speed_limit{100, 0, 9999, "speed_limit"};
  404. SwitchableSetting<bool> use_disk_shader_cache{true, "use_disk_shader_cache"};
  405. SwitchableSetting<GPUAccuracy, true> gpu_accuracy{GPUAccuracy::High, GPUAccuracy::Normal,
  406. GPUAccuracy::Extreme, "gpu_accuracy"};
  407. SwitchableSetting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"};
  408. SwitchableSetting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"};
  409. SwitchableSetting<bool> accelerate_astc{true, "accelerate_astc"};
  410. SwitchableSetting<bool> async_astc{false, "async_astc"};
  411. SwitchableSetting<bool> use_vsync{true, "use_vsync"};
  412. SwitchableSetting<ShaderBackend, true> shader_backend{ShaderBackend::GLSL, ShaderBackend::GLSL,
  413. ShaderBackend::SPIRV, "shader_backend"};
  414. SwitchableSetting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"};
  415. SwitchableSetting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"};
  416. SwitchableSetting<bool> use_pessimistic_flushes{false, "use_pessimistic_flushes"};
  417. SwitchableSetting<bool> use_vulkan_driver_pipeline_cache{true,
  418. "use_vulkan_driver_pipeline_cache"};
  419. SwitchableSetting<u8> bg_red{0, "bg_red"};
  420. SwitchableSetting<u8> bg_green{0, "bg_green"};
  421. SwitchableSetting<u8> bg_blue{0, "bg_blue"};
  422. // System
  423. SwitchableSetting<std::optional<u32>> rng_seed{std::optional<u32>(), "rng_seed"};
  424. Setting<std::string> device_name{"Yuzu", "device_name"};
  425. // Measured in seconds since epoch
  426. std::optional<s64> custom_rtc;
  427. // Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc`
  428. s64 custom_rtc_differential;
  429. Setting<s32> current_user{0, "current_user"};
  430. SwitchableSetting<s32, true> language_index{1, 0, 17, "language_index"};
  431. SwitchableSetting<s32, true> region_index{1, 0, 6, "region_index"};
  432. SwitchableSetting<s32, true> time_zone_index{0, 0, 45, "time_zone_index"};
  433. SwitchableSetting<s32, true> sound_index{1, 0, 2, "sound_index"};
  434. // Controls
  435. InputSetting<std::array<PlayerInput, 10>> players;
  436. SwitchableSetting<bool> use_docked_mode{true, "use_docked_mode"};
  437. Setting<bool> enable_raw_input{false, "enable_raw_input"};
  438. Setting<bool> controller_navigation{true, "controller_navigation"};
  439. Setting<bool> enable_joycon_driver{true, "enable_joycon_driver"};
  440. Setting<bool> enable_procon_driver{false, "enable_procon_driver"};
  441. SwitchableSetting<bool> vibration_enabled{true, "vibration_enabled"};
  442. SwitchableSetting<bool> enable_accurate_vibrations{false, "enable_accurate_vibrations"};
  443. SwitchableSetting<bool> motion_enabled{true, "motion_enabled"};
  444. Setting<std::string> udp_input_servers{"127.0.0.1:26760", "udp_input_servers"};
  445. Setting<bool> enable_udp_controller{false, "enable_udp_controller"};
  446. Setting<bool> pause_tas_on_load{true, "pause_tas_on_load"};
  447. Setting<bool> tas_enable{false, "tas_enable"};
  448. Setting<bool> tas_loop{false, "tas_loop"};
  449. Setting<bool> mouse_panning{false, "mouse_panning"};
  450. Setting<u8, true> mouse_panning_sensitivity{10, 1, 100, "mouse_panning_sensitivity"};
  451. Setting<bool> mouse_enabled{false, "mouse_enabled"};
  452. Setting<bool> emulate_analog_keyboard{false, "emulate_analog_keyboard"};
  453. Setting<bool> keyboard_enabled{false, "keyboard_enabled"};
  454. Setting<bool> debug_pad_enabled{false, "debug_pad_enabled"};
  455. ButtonsRaw debug_pad_buttons;
  456. AnalogsRaw debug_pad_analogs;
  457. TouchscreenInput touchscreen;
  458. Setting<std::string> touch_device{"min_x:100,min_y:50,max_x:1800,max_y:850", "touch_device"};
  459. Setting<int> touch_from_button_map_index{0, "touch_from_button_map"};
  460. std::vector<TouchFromButtonMap> touch_from_button_maps;
  461. Setting<bool> enable_ring_controller{true, "enable_ring_controller"};
  462. RingconRaw ringcon_analogs;
  463. Setting<bool> enable_ir_sensor{false, "enable_ir_sensor"};
  464. Setting<std::string> ir_sensor_device{"auto", "ir_sensor_device"};
  465. // Data Storage
  466. Setting<bool> use_virtual_sd{true, "use_virtual_sd"};
  467. Setting<bool> gamecard_inserted{false, "gamecard_inserted"};
  468. Setting<bool> gamecard_current_game{false, "gamecard_current_game"};
  469. Setting<std::string> gamecard_path{std::string(), "gamecard_path"};
  470. // Debugging
  471. bool record_frame_times;
  472. Setting<bool> use_gdbstub{false, "use_gdbstub"};
  473. Setting<u16> gdbstub_port{6543, "gdbstub_port"};
  474. Setting<std::string> program_args{std::string(), "program_args"};
  475. Setting<bool> dump_exefs{false, "dump_exefs"};
  476. Setting<bool> dump_nso{false, "dump_nso"};
  477. Setting<bool> dump_shaders{false, "dump_shaders"};
  478. Setting<bool> dump_macros{false, "dump_macros"};
  479. Setting<bool> enable_fs_access_log{false, "enable_fs_access_log"};
  480. Setting<bool> reporting_services{false, "reporting_services"};
  481. Setting<bool> quest_flag{false, "quest_flag"};
  482. Setting<bool> disable_macro_jit{false, "disable_macro_jit"};
  483. Setting<bool> disable_macro_hle{false, "disable_macro_hle"};
  484. Setting<bool> extended_logging{false, "extended_logging"};
  485. Setting<bool> use_debug_asserts{false, "use_debug_asserts"};
  486. Setting<bool> use_auto_stub{false, "use_auto_stub"};
  487. Setting<bool> enable_all_controllers{false, "enable_all_controllers"};
  488. Setting<bool> create_crash_dumps{false, "create_crash_dumps"};
  489. Setting<bool> perform_vulkan_check{true, "perform_vulkan_check"};
  490. // Miscellaneous
  491. Setting<std::string> log_filter{"*:Info", "log_filter"};
  492. Setting<bool> use_dev_keys{false, "use_dev_keys"};
  493. // Network
  494. Setting<std::string> network_interface{std::string(), "network_interface"};
  495. // WebService
  496. Setting<bool> enable_telemetry{true, "enable_telemetry"};
  497. Setting<std::string> web_api_url{"https://api.yuzu-emu.org", "web_api_url"};
  498. Setting<std::string> yuzu_username{std::string(), "yuzu_username"};
  499. Setting<std::string> yuzu_token{std::string(), "yuzu_token"};
  500. // Add-Ons
  501. std::map<u64, std::vector<std::string>> disabled_addons;
  502. };
  503. extern Values values;
  504. bool IsConfiguringGlobal();
  505. void SetConfiguringGlobal(bool is_global);
  506. bool IsGPULevelExtreme();
  507. bool IsGPULevelHigh();
  508. bool IsFastmemEnabled();
  509. float Volume();
  510. std::string GetTimeZoneString();
  511. void LogSettings();
  512. void UpdateRescalingInfo();
  513. // Restore the global state of all applicable settings in the Values struct
  514. void RestoreGlobalState(bool is_powered_on);
  515. } // namespace Settings