settings.h 28 KB

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