settings.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <array>
  6. #include <atomic>
  7. #include <string>
  8. #include "common/common_types.h"
  9. namespace Settings {
  10. namespace NativeButton {
  11. enum Values {
  12. A,
  13. B,
  14. X,
  15. Y,
  16. LStick,
  17. RStick,
  18. L,
  19. R,
  20. ZL,
  21. ZR,
  22. Plus,
  23. Minus,
  24. DLeft,
  25. DUp,
  26. DRight,
  27. DDown,
  28. LStick_Left,
  29. LStick_Up,
  30. LStick_Right,
  31. LStick_Down,
  32. RStick_Left,
  33. RStick_Up,
  34. RStick_Right,
  35. RStick_Down,
  36. SL,
  37. SR,
  38. Home,
  39. Screenshot,
  40. NumButtons,
  41. };
  42. constexpr int BUTTON_HID_BEGIN = A;
  43. constexpr int BUTTON_NS_BEGIN = Home;
  44. constexpr int BUTTON_HID_END = BUTTON_NS_BEGIN;
  45. constexpr int BUTTON_NS_END = NumButtons;
  46. constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN;
  47. constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN;
  48. static const std::array<const char*, NumButtons> mapping = {{
  49. "button_a",
  50. "button_b",
  51. "button_x",
  52. "button_y",
  53. "button_lstick",
  54. "button_rstick",
  55. "button_l",
  56. "button_r",
  57. "button_zl",
  58. "button_zr",
  59. "button_plus",
  60. "button_minus",
  61. "button_dleft",
  62. "button_dup",
  63. "button_dright",
  64. "button_ddown",
  65. "button_lstick_left",
  66. "button_lstick_up",
  67. "button_lstick_right",
  68. "button_lstick_down",
  69. "button_rstick_left",
  70. "button_rstick_up",
  71. "button_rstick_right",
  72. "button_rstick_down",
  73. "button_sl",
  74. "button_sr",
  75. "button_home",
  76. "button_screenshot",
  77. }};
  78. } // namespace NativeButton
  79. namespace NativeAnalog {
  80. enum Values {
  81. LStick,
  82. RStick,
  83. NumAnalogs,
  84. };
  85. constexpr int STICK_HID_BEGIN = LStick;
  86. constexpr int STICK_HID_END = NumAnalogs;
  87. constexpr int NUM_STICKS_HID = NumAnalogs;
  88. static const std::array<const char*, NumAnalogs> mapping = {{
  89. "lstick",
  90. "rstick",
  91. }};
  92. } // namespace NativeAnalog
  93. struct Values {
  94. // System
  95. bool use_docked_mode;
  96. std::string username;
  97. int language_index;
  98. // Controls
  99. std::array<std::string, NativeButton::NumButtons> buttons;
  100. std::array<std::string, NativeAnalog::NumAnalogs> analogs;
  101. std::string motion_device;
  102. std::string touch_device;
  103. std::atomic_bool is_device_reload_pending{true};
  104. // Core
  105. bool use_cpu_jit;
  106. bool use_multi_core;
  107. // Data Storage
  108. bool use_virtual_sd;
  109. std::string nand_dir;
  110. std::string sdmc_dir;
  111. // Renderer
  112. float resolution_factor;
  113. bool use_frame_limit;
  114. u16 frame_limit;
  115. bool use_accurate_framebuffers;
  116. float bg_red;
  117. float bg_green;
  118. float bg_blue;
  119. std::string log_filter;
  120. bool use_dev_keys;
  121. // Audio
  122. std::string sink_id;
  123. bool enable_audio_stretching;
  124. std::string audio_device_id;
  125. float volume;
  126. // Debugging
  127. bool use_gdbstub;
  128. u16 gdbstub_port;
  129. std::string program_args;
  130. // WebService
  131. bool enable_telemetry;
  132. std::string web_api_url;
  133. std::string yuzu_username;
  134. std::string yuzu_token;
  135. } extern values;
  136. void Apply();
  137. } // namespace Settings