settings.h 22 KB

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