settings.h 3.1 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. #include "core/hle/service/cam/cam.h"
  9. namespace Settings {
  10. enum class LayoutOption {
  11. Default,
  12. SingleScreen,
  13. LargeScreen,
  14. SideScreen,
  15. };
  16. namespace NativeButton {
  17. enum Values {
  18. A,
  19. B,
  20. X,
  21. Y,
  22. Up,
  23. Down,
  24. Left,
  25. Right,
  26. L,
  27. R,
  28. Start,
  29. Select,
  30. ZL,
  31. ZR,
  32. Home,
  33. NumButtons,
  34. };
  35. constexpr int BUTTON_HID_BEGIN = A;
  36. constexpr int BUTTON_IR_BEGIN = ZL;
  37. constexpr int BUTTON_NS_BEGIN = Home;
  38. constexpr int BUTTON_HID_END = BUTTON_IR_BEGIN;
  39. constexpr int BUTTON_IR_END = BUTTON_NS_BEGIN;
  40. constexpr int BUTTON_NS_END = NumButtons;
  41. constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN;
  42. constexpr int NUM_BUTTONS_IR = BUTTON_IR_END - BUTTON_IR_BEGIN;
  43. constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN;
  44. static const std::array<const char*, NumButtons> mapping = {{
  45. "button_a", "button_b", "button_x", "button_y", "button_up", "button_down", "button_left",
  46. "button_right", "button_l", "button_r", "button_start", "button_select", "button_zl",
  47. "button_zr", "button_home",
  48. }};
  49. } // namespace NativeButton
  50. namespace NativeAnalog {
  51. enum Values {
  52. CirclePad,
  53. CStick,
  54. NumAnalogs,
  55. };
  56. static const std::array<const char*, NumAnalogs> mapping = {{
  57. "circle_pad", "c_stick",
  58. }};
  59. } // namespace NativeAnalog
  60. struct Values {
  61. // CheckNew3DS
  62. bool is_new_3ds;
  63. // Controls
  64. std::array<std::string, NativeButton::NumButtons> buttons;
  65. std::array<std::string, NativeAnalog::NumAnalogs> analogs;
  66. std::string motion_device;
  67. std::string touch_device;
  68. // Core
  69. bool use_cpu_jit;
  70. // Data Storage
  71. bool use_virtual_sd;
  72. // System Region
  73. int region_value;
  74. // Renderer
  75. bool use_hw_renderer;
  76. bool use_shader_jit;
  77. float resolution_factor;
  78. bool use_vsync;
  79. bool toggle_framelimit;
  80. LayoutOption layout_option;
  81. bool swap_screen;
  82. bool custom_layout;
  83. u16 custom_top_left;
  84. u16 custom_top_top;
  85. u16 custom_top_right;
  86. u16 custom_top_bottom;
  87. u16 custom_bottom_left;
  88. u16 custom_bottom_top;
  89. u16 custom_bottom_right;
  90. u16 custom_bottom_bottom;
  91. float bg_red;
  92. float bg_green;
  93. float bg_blue;
  94. std::string log_filter;
  95. // Audio
  96. std::string sink_id;
  97. bool enable_audio_stretching;
  98. std::string audio_device_id;
  99. // Camera
  100. std::array<std::string, Service::CAM::NumCameras> camera_name;
  101. std::array<std::string, Service::CAM::NumCameras> camera_config;
  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