settings.h 22 KB

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