settings.h 21 KB

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