settings.h 28 KB

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