settings.h 22 KB

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