settings.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  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 <memory>
  8. #include <stdexcept>
  9. #include <string>
  10. #include <utility>
  11. #include <vector>
  12. #include "common/common_types.h"
  13. #include "common/settings_common.h"
  14. #include "common/settings_enums.h"
  15. #include "common/settings_input.h"
  16. #include "common/settings_setting.h"
  17. namespace Settings {
  18. const char* TranslateCategory(Settings::Category category);
  19. struct ResolutionScalingInfo {
  20. u32 up_scale{1};
  21. u32 down_shift{0};
  22. f32 up_factor{1.0f};
  23. f32 down_factor{1.0f};
  24. bool active{};
  25. bool downscale{};
  26. s32 ScaleUp(s32 value) const {
  27. if (value == 0) {
  28. return 0;
  29. }
  30. return std::max((value * static_cast<s32>(up_scale)) >> static_cast<s32>(down_shift), 1);
  31. }
  32. u32 ScaleUp(u32 value) const {
  33. if (value == 0U) {
  34. return 0U;
  35. }
  36. return std::max((value * up_scale) >> down_shift, 1U);
  37. }
  38. };
  39. #ifndef CANNOT_EXPLICITLY_INSTANTIATE
  40. // Instantiate the classes elsewhere (settings.cpp) to reduce compiler/linker work
  41. #define SETTING(TYPE, RANGED) extern template class Setting<TYPE, RANGED>
  42. #define SWITCHABLE(TYPE, RANGED) extern template class SwitchableSetting<TYPE, RANGED>
  43. SETTING(AudioEngine, false);
  44. SETTING(bool, false);
  45. SETTING(int, false);
  46. SETTING(s32, false);
  47. SETTING(std::string, false);
  48. SETTING(std::string, false);
  49. SETTING(u16, false);
  50. SWITCHABLE(AnisotropyMode, true);
  51. SWITCHABLE(AntiAliasing, false);
  52. SWITCHABLE(AspectRatio, true);
  53. SWITCHABLE(AstcDecodeMode, true);
  54. SWITCHABLE(AstcRecompression, true);
  55. SWITCHABLE(AudioMode, true);
  56. SWITCHABLE(CpuAccuracy, true);
  57. SWITCHABLE(FullscreenMode, true);
  58. SWITCHABLE(GpuAccuracy, true);
  59. SWITCHABLE(Language, true);
  60. SWITCHABLE(MemoryLayout, true);
  61. SWITCHABLE(NvdecEmulation, false);
  62. SWITCHABLE(Region, true);
  63. SWITCHABLE(RendererBackend, true);
  64. SWITCHABLE(ScalingFilter, false);
  65. SWITCHABLE(ShaderBackend, true);
  66. SWITCHABLE(TimeZone, true);
  67. SETTING(VSyncMode, true);
  68. SWITCHABLE(bool, false);
  69. SWITCHABLE(int, false);
  70. SWITCHABLE(int, true);
  71. SWITCHABLE(s64, false);
  72. SWITCHABLE(u16, true);
  73. SWITCHABLE(u32, false);
  74. SWITCHABLE(u8, false);
  75. SWITCHABLE(u8, true);
  76. // Used in UISettings
  77. // TODO see if we can move this to uisettings.h
  78. SWITCHABLE(ConfirmStop, true);
  79. #undef SETTING
  80. #undef SWITCHABLE
  81. #endif
  82. /**
  83. * The InputSetting class allows for getting a reference to either the global or custom members.
  84. * This is required as we cannot easily modify the values of user-defined types within containers
  85. * using the SetValue() member function found in the Setting class. The primary purpose of this
  86. * class is to store an array of 10 PlayerInput structs for both the global and custom setting and
  87. * allows for easily accessing and modifying both settings.
  88. */
  89. template <typename Type>
  90. class InputSetting final {
  91. public:
  92. InputSetting() = default;
  93. explicit InputSetting(Type val) : Setting<Type>(val) {}
  94. ~InputSetting() = default;
  95. void SetGlobal(bool to_global) {
  96. use_global = to_global;
  97. }
  98. [[nodiscard]] bool UsingGlobal() const {
  99. return use_global;
  100. }
  101. [[nodiscard]] Type& GetValue(bool need_global = false) {
  102. if (use_global || need_global) {
  103. return global;
  104. }
  105. return custom;
  106. }
  107. private:
  108. bool use_global{true}; ///< The setting's global state
  109. Type global{}; ///< The setting
  110. Type custom{}; ///< The custom setting value
  111. };
  112. struct TouchFromButtonMap {
  113. std::string name;
  114. std::vector<std::string> buttons;
  115. };
  116. struct Values {
  117. Linkage linkage{};
  118. // Audio
  119. Setting<AudioEngine> sink_id{linkage, AudioEngine::Auto, "output_engine", Category::Audio,
  120. Specialization::RuntimeList};
  121. Setting<std::string> audio_output_device_id{linkage, "auto", "output_device", Category::Audio,
  122. Specialization::RuntimeList};
  123. Setting<std::string> audio_input_device_id{linkage, "auto", "input_device", Category::Audio,
  124. Specialization::RuntimeList};
  125. SwitchableSetting<AudioMode, true> sound_index{
  126. linkage, AudioMode::Stereo, AudioMode::Mono, AudioMode::Surround,
  127. "sound_index", Category::SystemAudio, Specialization::Default, true,
  128. true};
  129. SwitchableSetting<u8, true> volume{linkage,
  130. 100,
  131. 0,
  132. 200,
  133. "volume",
  134. Category::Audio,
  135. Specialization::Scalar | Specialization::Percentage,
  136. true,
  137. true};
  138. Setting<bool, false> audio_muted{
  139. linkage, false, "audio_muted", Category::Audio, Specialization::Default, true, true};
  140. Setting<bool, false> dump_audio_commands{
  141. linkage, false, "dump_audio_commands", Category::Audio, Specialization::Default, false};
  142. // Core
  143. SwitchableSetting<bool> use_multi_core{linkage, true, "use_multi_core", Category::Core};
  144. SwitchableSetting<MemoryLayout, true> memory_layout_mode{linkage,
  145. MemoryLayout::Memory_4Gb,
  146. MemoryLayout::Memory_4Gb,
  147. MemoryLayout::Memory_8Gb,
  148. "memory_layout_mode",
  149. Category::Core};
  150. SwitchableSetting<bool> use_speed_limit{
  151. linkage, true, "use_speed_limit", Category::Core, Specialization::Paired, false, true};
  152. SwitchableSetting<u16, true> speed_limit{linkage,
  153. 100,
  154. 0,
  155. 9999,
  156. "speed_limit",
  157. Category::Core,
  158. Specialization::Countable | Specialization::Percentage,
  159. true,
  160. true,
  161. &use_speed_limit};
  162. Setting<bool> enable_gamemode{linkage, false, "enable_gamemode", Category::Core};
  163. // Cpu
  164. SwitchableSetting<CpuAccuracy, true> cpu_accuracy{linkage, CpuAccuracy::Auto,
  165. CpuAccuracy::Auto, CpuAccuracy::Paranoid,
  166. "cpu_accuracy", Category::Cpu};
  167. Setting<bool> cpu_debug_mode{linkage, false, "cpu_debug_mode", Category::CpuDebug};
  168. Setting<bool> cpuopt_page_tables{linkage, true, "cpuopt_page_tables", Category::CpuDebug};
  169. Setting<bool> cpuopt_block_linking{linkage, true, "cpuopt_block_linking", Category::CpuDebug};
  170. Setting<bool> cpuopt_return_stack_buffer{linkage, true, "cpuopt_return_stack_buffer",
  171. Category::CpuDebug};
  172. Setting<bool> cpuopt_fast_dispatcher{linkage, true, "cpuopt_fast_dispatcher",
  173. Category::CpuDebug};
  174. Setting<bool> cpuopt_context_elimination{linkage, true, "cpuopt_context_elimination",
  175. Category::CpuDebug};
  176. Setting<bool> cpuopt_const_prop{linkage, true, "cpuopt_const_prop", Category::CpuDebug};
  177. Setting<bool> cpuopt_misc_ir{linkage, true, "cpuopt_misc_ir", Category::CpuDebug};
  178. Setting<bool> cpuopt_reduce_misalign_checks{linkage, true, "cpuopt_reduce_misalign_checks",
  179. Category::CpuDebug};
  180. Setting<bool> cpuopt_fastmem{linkage, true, "cpuopt_fastmem", Category::CpuDebug};
  181. Setting<bool> cpuopt_fastmem_exclusives{linkage, true, "cpuopt_fastmem_exclusives",
  182. Category::CpuDebug};
  183. Setting<bool> cpuopt_recompile_exclusives{linkage, true, "cpuopt_recompile_exclusives",
  184. Category::CpuDebug};
  185. Setting<bool> cpuopt_ignore_memory_aborts{linkage, true, "cpuopt_ignore_memory_aborts",
  186. Category::CpuDebug};
  187. SwitchableSetting<bool> cpuopt_unsafe_unfuse_fma{linkage, true, "cpuopt_unsafe_unfuse_fma",
  188. Category::CpuUnsafe};
  189. SwitchableSetting<bool> cpuopt_unsafe_reduce_fp_error{
  190. linkage, true, "cpuopt_unsafe_reduce_fp_error", Category::CpuUnsafe};
  191. SwitchableSetting<bool> cpuopt_unsafe_ignore_standard_fpcr{
  192. linkage, true, "cpuopt_unsafe_ignore_standard_fpcr", Category::CpuUnsafe};
  193. SwitchableSetting<bool> cpuopt_unsafe_inaccurate_nan{
  194. linkage, true, "cpuopt_unsafe_inaccurate_nan", Category::CpuUnsafe};
  195. SwitchableSetting<bool> cpuopt_unsafe_fastmem_check{
  196. linkage, true, "cpuopt_unsafe_fastmem_check", Category::CpuUnsafe};
  197. SwitchableSetting<bool> cpuopt_unsafe_ignore_global_monitor{
  198. linkage, true, "cpuopt_unsafe_ignore_global_monitor", Category::CpuUnsafe};
  199. // Renderer
  200. SwitchableSetting<RendererBackend, true> renderer_backend{
  201. linkage, RendererBackend::Vulkan, RendererBackend::OpenGL, RendererBackend::Null,
  202. "backend", Category::Renderer};
  203. SwitchableSetting<ShaderBackend, true> shader_backend{
  204. linkage, ShaderBackend::Glsl, ShaderBackend::Glsl, ShaderBackend::SpirV,
  205. "shader_backend", Category::Renderer, Specialization::RuntimeList};
  206. SwitchableSetting<int> vulkan_device{linkage, 0, "vulkan_device", Category::Renderer,
  207. Specialization::RuntimeList};
  208. SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
  209. Category::Renderer};
  210. SwitchableSetting<bool> use_asynchronous_gpu_emulation{
  211. linkage, true, "use_asynchronous_gpu_emulation", Category::Renderer};
  212. SwitchableSetting<AstcDecodeMode, true> accelerate_astc{linkage,
  213. #ifdef ANDROID
  214. AstcDecodeMode::Cpu,
  215. #else
  216. AstcDecodeMode::Gpu,
  217. #endif
  218. AstcDecodeMode::Cpu,
  219. AstcDecodeMode::CpuAsynchronous,
  220. "accelerate_astc",
  221. Category::Renderer};
  222. Setting<VSyncMode, true> vsync_mode{
  223. linkage, VSyncMode::Fifo, VSyncMode::Immediate, VSyncMode::FifoRelaxed,
  224. "use_vsync", Category::Renderer, Specialization::RuntimeList, true,
  225. true};
  226. SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::Gpu,
  227. "nvdec_emulation", Category::Renderer};
  228. // *nix platforms may have issues with the borderless windowed fullscreen mode.
  229. // Default to exclusive fullscreen on these platforms for now.
  230. SwitchableSetting<FullscreenMode, true> fullscreen_mode{linkage,
  231. #ifdef _WIN32
  232. FullscreenMode::Borderless,
  233. #else
  234. FullscreenMode::Exclusive,
  235. #endif
  236. FullscreenMode::Borderless,
  237. FullscreenMode::Exclusive,
  238. "fullscreen_mode",
  239. Category::Renderer,
  240. Specialization::Default,
  241. true,
  242. true};
  243. SwitchableSetting<AspectRatio, true> aspect_ratio{linkage,
  244. AspectRatio::R16_9,
  245. AspectRatio::R16_9,
  246. AspectRatio::Stretch,
  247. "aspect_ratio",
  248. Category::Renderer,
  249. Specialization::Default,
  250. true,
  251. true};
  252. ResolutionScalingInfo resolution_info{};
  253. SwitchableSetting<ResolutionSetup> resolution_setup{linkage, ResolutionSetup::Res1X,
  254. "resolution_setup", Category::Renderer};
  255. SwitchableSetting<ScalingFilter> scaling_filter{linkage,
  256. ScalingFilter::Bilinear,
  257. "scaling_filter",
  258. Category::Renderer,
  259. Specialization::Default,
  260. true,
  261. true};
  262. SwitchableSetting<AntiAliasing> anti_aliasing{linkage,
  263. AntiAliasing::None,
  264. "anti_aliasing",
  265. Category::Renderer,
  266. Specialization::Default,
  267. true,
  268. true};
  269. SwitchableSetting<int, true> fsr_sharpening_slider{linkage,
  270. 25,
  271. 0,
  272. 200,
  273. "fsr_sharpening_slider",
  274. Category::Renderer,
  275. Specialization::Scalar |
  276. Specialization::Percentage,
  277. true,
  278. true};
  279. SwitchableSetting<u8, false> bg_red{
  280. linkage, 0, "bg_red", Category::Renderer, Specialization::Default, true, true};
  281. SwitchableSetting<u8, false> bg_green{
  282. linkage, 0, "bg_green", Category::Renderer, Specialization::Default, true, true};
  283. SwitchableSetting<u8, false> bg_blue{
  284. linkage, 0, "bg_blue", Category::Renderer, Specialization::Default, true, true};
  285. SwitchableSetting<GpuAccuracy, true> gpu_accuracy{linkage,
  286. #ifdef ANDROID
  287. GpuAccuracy::Normal,
  288. #else
  289. GpuAccuracy::High,
  290. #endif
  291. GpuAccuracy::Normal,
  292. GpuAccuracy::Extreme,
  293. "gpu_accuracy",
  294. Category::RendererAdvanced,
  295. Specialization::Default,
  296. true,
  297. true};
  298. GpuAccuracy current_gpu_accuracy{GpuAccuracy::High};
  299. SwitchableSetting<AnisotropyMode, true> max_anisotropy{linkage,
  300. #ifdef ANDROID
  301. AnisotropyMode::Default,
  302. #else
  303. AnisotropyMode::Automatic,
  304. #endif
  305. AnisotropyMode::Automatic,
  306. AnisotropyMode::X16,
  307. "max_anisotropy",
  308. Category::RendererAdvanced};
  309. SwitchableSetting<AstcRecompression, true> astc_recompression{linkage,
  310. AstcRecompression::Uncompressed,
  311. AstcRecompression::Uncompressed,
  312. AstcRecompression::Bc3,
  313. "astc_recompression",
  314. Category::RendererAdvanced};
  315. SwitchableSetting<bool> async_presentation{linkage,
  316. #ifdef ANDROID
  317. true,
  318. #else
  319. false,
  320. #endif
  321. "async_presentation", Category::RendererAdvanced};
  322. SwitchableSetting<bool> renderer_force_max_clock{linkage, false, "force_max_clock",
  323. Category::RendererAdvanced};
  324. SwitchableSetting<bool> use_reactive_flushing{linkage,
  325. #ifdef ANDROID
  326. false,
  327. #else
  328. true,
  329. #endif
  330. "use_reactive_flushing",
  331. Category::RendererAdvanced};
  332. SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
  333. Category::RendererAdvanced};
  334. SwitchableSetting<bool> use_fast_gpu_time{
  335. linkage, true, "use_fast_gpu_time", Category::RendererAdvanced, Specialization::Default,
  336. true, true};
  337. SwitchableSetting<bool> use_vulkan_driver_pipeline_cache{linkage,
  338. true,
  339. "use_vulkan_driver_pipeline_cache",
  340. Category::RendererAdvanced,
  341. Specialization::Default,
  342. true,
  343. true};
  344. SwitchableSetting<bool> enable_compute_pipelines{linkage, false, "enable_compute_pipelines",
  345. Category::RendererAdvanced};
  346. SwitchableSetting<bool> use_video_framerate{linkage, false, "use_video_framerate",
  347. Category::RendererAdvanced};
  348. SwitchableSetting<bool> barrier_feedback_loops{linkage, true, "barrier_feedback_loops",
  349. Category::RendererAdvanced};
  350. Setting<bool> renderer_debug{linkage, false, "debug", Category::RendererDebug};
  351. Setting<bool> renderer_shader_feedback{linkage, false, "shader_feedback",
  352. Category::RendererDebug};
  353. Setting<bool> enable_nsight_aftermath{linkage, false, "nsight_aftermath",
  354. Category::RendererDebug};
  355. Setting<bool> disable_shader_loop_safety_checks{
  356. linkage, false, "disable_shader_loop_safety_checks", Category::RendererDebug};
  357. Setting<bool> enable_renderdoc_hotkey{linkage, false, "renderdoc_hotkey",
  358. Category::RendererDebug};
  359. // TODO: remove this once AMDVLK supports VK_EXT_depth_bias_control
  360. bool renderer_amdvlk_depth_bias_workaround{};
  361. // System
  362. SwitchableSetting<Language, true> language_index{linkage,
  363. Language::EnglishAmerican,
  364. Language::Japanese,
  365. Language::PortugueseBrazilian,
  366. "language_index",
  367. Category::System};
  368. SwitchableSetting<Region, true> region_index{linkage, Region::Usa, Region::Japan,
  369. Region::Taiwan, "region_index", Category::System};
  370. SwitchableSetting<TimeZone, true> time_zone_index{linkage, TimeZone::Auto,
  371. TimeZone::Auto, TimeZone::Zulu,
  372. "time_zone_index", Category::System};
  373. // Measured in seconds since epoch
  374. SwitchableSetting<bool> custom_rtc_enabled{
  375. linkage, false, "custom_rtc_enabled", Category::System, Specialization::Paired, true, true};
  376. SwitchableSetting<s64> custom_rtc{
  377. linkage, 0, "custom_rtc", Category::System, Specialization::Time,
  378. true, true, &custom_rtc_enabled};
  379. // Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc`
  380. s64 custom_rtc_differential;
  381. SwitchableSetting<bool> rng_seed_enabled{
  382. linkage, false, "rng_seed_enabled", Category::System, Specialization::Paired, true, true};
  383. SwitchableSetting<u32> rng_seed{
  384. linkage, 0, "rng_seed", Category::System, Specialization::Hex,
  385. true, true, &rng_seed_enabled};
  386. Setting<std::string> device_name{
  387. linkage, "yuzu", "device_name", Category::System, Specialization::Default, true, true};
  388. Setting<s32> current_user{linkage, 0, "current_user", Category::System};
  389. SwitchableSetting<ConsoleMode> use_docked_mode{linkage,
  390. #ifdef ANDROID
  391. ConsoleMode::Handheld,
  392. #else
  393. ConsoleMode::Docked,
  394. #endif
  395. "use_docked_mode",
  396. Category::System,
  397. Specialization::Radio,
  398. true,
  399. true};
  400. // Controls
  401. InputSetting<std::array<PlayerInput, 10>> players;
  402. Setting<bool> enable_raw_input{
  403. linkage, false, "enable_raw_input", Category::Controls, Specialization::Default,
  404. // Only read/write enable_raw_input on Windows platforms
  405. #ifdef _WIN32
  406. true
  407. #else
  408. false
  409. #endif
  410. };
  411. Setting<bool> controller_navigation{linkage, true, "controller_navigation", Category::Controls};
  412. Setting<bool> enable_joycon_driver{linkage, true, "enable_joycon_driver", Category::Controls};
  413. Setting<bool> enable_procon_driver{linkage, false, "enable_procon_driver", Category::Controls};
  414. SwitchableSetting<bool> vibration_enabled{linkage, true, "vibration_enabled",
  415. Category::Controls};
  416. SwitchableSetting<bool> enable_accurate_vibrations{linkage, false, "enable_accurate_vibrations",
  417. Category::Controls};
  418. SwitchableSetting<bool> motion_enabled{linkage, true, "motion_enabled", Category::Controls};
  419. Setting<std::string> udp_input_servers{linkage, "127.0.0.1:26760", "udp_input_servers",
  420. Category::Controls};
  421. Setting<bool> enable_udp_controller{linkage, false, "enable_udp_controller",
  422. Category::Controls};
  423. Setting<bool> pause_tas_on_load{linkage, true, "pause_tas_on_load", Category::Controls};
  424. Setting<bool> tas_enable{linkage, false, "tas_enable", Category::Controls};
  425. Setting<bool> tas_loop{linkage, false, "tas_loop", Category::Controls};
  426. Setting<bool> mouse_panning{
  427. linkage, false, "mouse_panning", Category::Controls, Specialization::Default, false};
  428. Setting<u8, true> mouse_panning_sensitivity{
  429. linkage, 50, 1, 100, "mouse_panning_sensitivity", Category::Controls};
  430. Setting<bool> mouse_enabled{linkage, false, "mouse_enabled", Category::Controls};
  431. Setting<u8, true> mouse_panning_x_sensitivity{
  432. linkage, 50, 1, 100, "mouse_panning_x_sensitivity", Category::Controls};
  433. Setting<u8, true> mouse_panning_y_sensitivity{
  434. linkage, 50, 1, 100, "mouse_panning_y_sensitivity", Category::Controls};
  435. Setting<u8, true> mouse_panning_deadzone_counterweight{
  436. linkage, 20, 0, 100, "mouse_panning_deadzone_counterweight", Category::Controls};
  437. Setting<u8, true> mouse_panning_decay_strength{
  438. linkage, 18, 0, 100, "mouse_panning_decay_strength", Category::Controls};
  439. Setting<u8, true> mouse_panning_min_decay{
  440. linkage, 6, 0, 100, "mouse_panning_min_decay", Category::Controls};
  441. Setting<bool> emulate_analog_keyboard{linkage, false, "emulate_analog_keyboard",
  442. Category::Controls};
  443. Setting<bool> keyboard_enabled{linkage, false, "keyboard_enabled", Category::Controls};
  444. Setting<bool> debug_pad_enabled{linkage, false, "debug_pad_enabled", Category::Controls};
  445. ButtonsRaw debug_pad_buttons;
  446. AnalogsRaw debug_pad_analogs;
  447. TouchscreenInput touchscreen;
  448. Setting<std::string> touch_device{linkage, "min_x:100,min_y:50,max_x:1800,max_y:850",
  449. "touch_device", Category::Controls};
  450. Setting<int> touch_from_button_map_index{linkage, 0, "touch_from_button_map",
  451. Category::Controls};
  452. std::vector<TouchFromButtonMap> touch_from_button_maps;
  453. Setting<bool> enable_ring_controller{linkage, true, "enable_ring_controller",
  454. Category::Controls};
  455. RingconRaw ringcon_analogs;
  456. Setting<bool> enable_ir_sensor{linkage, false, "enable_ir_sensor", Category::Controls};
  457. Setting<std::string> ir_sensor_device{linkage, "auto", "ir_sensor_device", Category::Controls};
  458. Setting<bool> random_amiibo_id{linkage, false, "random_amiibo_id", Category::Controls};
  459. // Data Storage
  460. Setting<bool> use_virtual_sd{linkage, true, "use_virtual_sd", Category::DataStorage};
  461. Setting<bool> gamecard_inserted{linkage, false, "gamecard_inserted", Category::DataStorage};
  462. Setting<bool> gamecard_current_game{linkage, false, "gamecard_current_game",
  463. Category::DataStorage};
  464. Setting<std::string> gamecard_path{linkage, std::string(), "gamecard_path",
  465. Category::DataStorage};
  466. // Debugging
  467. bool record_frame_times;
  468. Setting<bool> use_gdbstub{linkage, false, "use_gdbstub", Category::Debugging};
  469. Setting<u16> gdbstub_port{linkage, 6543, "gdbstub_port", Category::Debugging};
  470. Setting<std::string> program_args{linkage, std::string(), "program_args", Category::Debugging};
  471. Setting<bool> dump_exefs{linkage, false, "dump_exefs", Category::Debugging};
  472. Setting<bool> dump_nso{linkage, false, "dump_nso", Category::Debugging};
  473. Setting<bool> dump_shaders{
  474. linkage, false, "dump_shaders", Category::DebuggingGraphics, Specialization::Default,
  475. false};
  476. Setting<bool> dump_macros{
  477. linkage, false, "dump_macros", Category::DebuggingGraphics, Specialization::Default, false};
  478. Setting<bool> enable_fs_access_log{linkage, false, "enable_fs_access_log", Category::Debugging};
  479. Setting<bool> reporting_services{
  480. linkage, false, "reporting_services", Category::Debugging, Specialization::Default, false};
  481. Setting<bool> quest_flag{linkage, false, "quest_flag", Category::Debugging};
  482. Setting<bool> disable_macro_jit{linkage, false, "disable_macro_jit",
  483. Category::DebuggingGraphics};
  484. Setting<bool> disable_macro_hle{linkage, false, "disable_macro_hle",
  485. Category::DebuggingGraphics};
  486. Setting<bool> extended_logging{
  487. linkage, false, "extended_logging", Category::Debugging, Specialization::Default, false};
  488. Setting<bool> use_debug_asserts{linkage, false, "use_debug_asserts", Category::Debugging};
  489. Setting<bool> use_auto_stub{
  490. linkage, false, "use_auto_stub", Category::Debugging, Specialization::Default, false};
  491. Setting<bool> enable_all_controllers{linkage, false, "enable_all_controllers",
  492. Category::Debugging};
  493. Setting<bool> perform_vulkan_check{linkage, true, "perform_vulkan_check", Category::Debugging};
  494. // Miscellaneous
  495. Setting<std::string> log_filter{linkage, "*:Info", "log_filter", Category::Miscellaneous};
  496. Setting<bool> use_dev_keys{linkage, false, "use_dev_keys", Category::Miscellaneous};
  497. // Network
  498. Setting<std::string> network_interface{linkage, std::string(), "network_interface",
  499. Category::Network};
  500. // WebService
  501. Setting<bool> enable_telemetry{linkage, true, "enable_telemetry", Category::WebService};
  502. Setting<std::string> web_api_url{linkage, "https://api.yuzu-emu.org", "web_api_url",
  503. Category::WebService};
  504. Setting<std::string> yuzu_username{linkage, std::string(), "yuzu_username",
  505. Category::WebService};
  506. Setting<std::string> yuzu_token{linkage, std::string(), "yuzu_token", Category::WebService};
  507. // Add-Ons
  508. std::map<u64, std::vector<std::string>> disabled_addons;
  509. };
  510. extern Values values;
  511. void UpdateGPUAccuracy();
  512. bool IsGPULevelExtreme();
  513. bool IsGPULevelHigh();
  514. bool IsFastmemEnabled();
  515. bool IsDockedMode();
  516. float Volume();
  517. std::string GetTimeZoneString(TimeZone time_zone);
  518. void LogSettings();
  519. void TranslateResolutionInfo(ResolutionSetup setup, ResolutionScalingInfo& info);
  520. void UpdateRescalingInfo();
  521. // Restore the global state of all applicable settings in the Values struct
  522. void RestoreGlobalState(bool is_powered_on);
  523. bool IsConfiguringGlobal();
  524. void SetConfiguringGlobal(bool is_global);
  525. } // namespace Settings