settings.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 <string>
  7. #include "common/common_types.h"
  8. namespace Settings {
  9. namespace NativeButton {
  10. enum Values {
  11. A,
  12. B,
  13. X,
  14. Y,
  15. LStick,
  16. RStick,
  17. L,
  18. R,
  19. ZL,
  20. ZR,
  21. Plus,
  22. Minus,
  23. DLeft,
  24. DUp,
  25. DRight,
  26. DDown,
  27. LStick_Left,
  28. LStick_Up,
  29. LStick_Right,
  30. LStick_Down,
  31. RStick_Left,
  32. RStick_Up,
  33. RStick_Right,
  34. RStick_Down,
  35. SL,
  36. SR,
  37. Home,
  38. Screenshot,
  39. NumButtons,
  40. };
  41. constexpr int BUTTON_HID_BEGIN = A;
  42. constexpr int BUTTON_NS_BEGIN = Home;
  43. constexpr int BUTTON_HID_END = BUTTON_NS_BEGIN;
  44. constexpr int BUTTON_NS_END = NumButtons;
  45. constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN;
  46. constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN;
  47. static const std::array<const char*, NumButtons> mapping = {{
  48. "button_a",
  49. "button_b",
  50. "button_x",
  51. "button_y",
  52. "button_lstick",
  53. "button_rstick",
  54. "button_l",
  55. "button_r",
  56. "button_zl",
  57. "button_zr",
  58. "button_plus",
  59. "button_minus",
  60. "button_dleft",
  61. "button_dup",
  62. "button_dright",
  63. "button_ddown",
  64. "button_lstick_left",
  65. "button_lstick_up",
  66. "button_lstick_right",
  67. "button_lstick_down",
  68. "button_sl",
  69. "button_sr",
  70. "button_home",
  71. "button_screenshot",
  72. }};
  73. } // namespace NativeButton
  74. namespace NativeAnalog {
  75. enum Values {
  76. LStick,
  77. RStick,
  78. NumAnalogs,
  79. };
  80. static const std::array<const char*, NumAnalogs> mapping = {{
  81. "lstick",
  82. "rstick",
  83. }};
  84. } // namespace NativeAnalog
  85. enum class CpuCore {
  86. Unicorn,
  87. Dynarmic,
  88. };
  89. struct Values {
  90. // Controls
  91. std::array<std::string, NativeButton::NumButtons> buttons;
  92. std::array<std::string, NativeAnalog::NumAnalogs> analogs;
  93. std::string motion_device;
  94. std::string touch_device;
  95. // Core
  96. CpuCore cpu_core;
  97. // Data Storage
  98. bool use_virtual_sd;
  99. // Renderer
  100. float resolution_factor;
  101. bool toggle_framelimit;
  102. float bg_red;
  103. float bg_green;
  104. float bg_blue;
  105. std::string log_filter;
  106. // Debugging
  107. bool use_gdbstub;
  108. u16 gdbstub_port;
  109. } extern values;
  110. void Apply();
  111. } // namespace Settings