settings.h 3.0 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. enum class LayoutOption {
  10. Default,
  11. SingleScreen,
  12. LargeScreen,
  13. SideScreen,
  14. };
  15. namespace NativeButton {
  16. enum Values {
  17. A,
  18. B,
  19. X,
  20. Y,
  21. Up,
  22. Down,
  23. Left,
  24. Right,
  25. L,
  26. R,
  27. Start,
  28. Select,
  29. ZL,
  30. ZR,
  31. Home,
  32. NumButtons,
  33. };
  34. constexpr int BUTTON_HID_BEGIN = A;
  35. constexpr int BUTTON_IR_BEGIN = ZL;
  36. constexpr int BUTTON_NS_BEGIN = Home;
  37. constexpr int BUTTON_HID_END = BUTTON_IR_BEGIN;
  38. constexpr int BUTTON_IR_END = BUTTON_NS_BEGIN;
  39. constexpr int BUTTON_NS_END = NumButtons;
  40. constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN;
  41. constexpr int NUM_BUTTONS_IR = BUTTON_IR_END - BUTTON_IR_BEGIN;
  42. constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN;
  43. static const std::array<const char*, NumButtons> mapping = {{
  44. "button_a", "button_b", "button_x", "button_y", "button_up", "button_down", "button_left",
  45. "button_right", "button_l", "button_r", "button_start", "button_select", "button_zl",
  46. "button_zr", "button_home",
  47. }};
  48. } // namespace NativeButton
  49. namespace NativeAnalog {
  50. enum Values {
  51. CirclePad,
  52. CStick,
  53. NumAnalogs,
  54. };
  55. static const std::array<const char*, NumAnalogs> mapping = {{
  56. "circle_pad", "c_stick",
  57. }};
  58. } // namespace NativeAnalog
  59. enum class CpuCore {
  60. Unicorn,
  61. Dynarmic,
  62. };
  63. struct Values {
  64. // CheckNew3DS
  65. bool is_new_3ds;
  66. // Controls
  67. std::array<std::string, NativeButton::NumButtons> buttons;
  68. std::array<std::string, NativeAnalog::NumAnalogs> analogs;
  69. std::string motion_device;
  70. std::string touch_device;
  71. // Core
  72. CpuCore cpu_core;
  73. // Data Storage
  74. bool use_virtual_sd;
  75. // System Region
  76. int region_value;
  77. // Renderer
  78. bool use_hw_renderer;
  79. bool use_shader_jit;
  80. float resolution_factor;
  81. bool use_vsync;
  82. bool toggle_framelimit;
  83. LayoutOption layout_option;
  84. bool swap_screen;
  85. bool custom_layout;
  86. u16 custom_top_left;
  87. u16 custom_top_top;
  88. u16 custom_top_right;
  89. u16 custom_top_bottom;
  90. u16 custom_bottom_left;
  91. u16 custom_bottom_top;
  92. u16 custom_bottom_right;
  93. u16 custom_bottom_bottom;
  94. float bg_red;
  95. float bg_green;
  96. float bg_blue;
  97. std::string log_filter;
  98. // Audio
  99. std::string sink_id;
  100. bool enable_audio_stretching;
  101. std::string audio_device_id;
  102. // Debugging
  103. bool use_gdbstub;
  104. u16 gdbstub_port;
  105. // WebService
  106. bool enable_telemetry;
  107. std::string telemetry_endpoint_url;
  108. std::string verify_endpoint_url;
  109. std::string citra_username;
  110. std::string citra_token;
  111. } extern values;
  112. // a special value for Values::region_value indicating that citra will automatically select a region
  113. // value to fit the region lockout info of the game
  114. static constexpr int REGION_VALUE_AUTO_SELECT = -1;
  115. void Apply();
  116. } // namespace Settings