settings.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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_rstick_left",
  69. "button_rstick_up",
  70. "button_rstick_right",
  71. "button_rstick_down",
  72. "button_sl",
  73. "button_sr",
  74. "button_home",
  75. "button_screenshot",
  76. }};
  77. } // namespace NativeButton
  78. namespace NativeAnalog {
  79. enum Values {
  80. LStick,
  81. RStick,
  82. NumAnalogs,
  83. };
  84. constexpr int STICK_HID_BEGIN = LStick;
  85. constexpr int STICK_HID_END = NumAnalogs;
  86. constexpr int NUM_STICKS_HID = NumAnalogs;
  87. static const std::array<const char*, NumAnalogs> mapping = {{
  88. "lstick",
  89. "rstick",
  90. }};
  91. } // namespace NativeAnalog
  92. struct Values {
  93. // System
  94. bool use_docked_mode;
  95. // Controls
  96. std::array<std::string, NativeButton::NumButtons> buttons;
  97. std::array<std::string, NativeAnalog::NumAnalogs> analogs;
  98. std::string motion_device;
  99. std::string touch_device;
  100. // Core
  101. bool use_cpu_jit;
  102. bool use_multi_core;
  103. // Data Storage
  104. bool use_virtual_sd;
  105. // Renderer
  106. float resolution_factor;
  107. bool toggle_framelimit;
  108. bool use_accurate_framebuffers;
  109. float bg_red;
  110. float bg_green;
  111. float bg_blue;
  112. std::string log_filter;
  113. // Debugging
  114. bool use_gdbstub;
  115. u16 gdbstub_port;
  116. } extern values;
  117. void Apply();
  118. } // namespace Settings