settings.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. };
  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 NumAnalog
  59. struct Values {
  60. // CheckNew3DS
  61. bool is_new_3ds;
  62. // Controls
  63. std::array<std::string, NativeButton::NumButtons> buttons;
  64. std::array<std::string, NativeAnalog::NumAnalogs> analogs;
  65. // Core
  66. bool use_cpu_jit;
  67. // Data Storage
  68. bool use_virtual_sd;
  69. // System Region
  70. int region_value;
  71. // Renderer
  72. bool use_hw_renderer;
  73. bool use_shader_jit;
  74. float resolution_factor;
  75. bool use_vsync;
  76. bool toggle_framelimit;
  77. LayoutOption layout_option;
  78. bool swap_screen;
  79. bool custom_layout;
  80. u16 custom_top_left;
  81. u16 custom_top_top;
  82. u16 custom_top_right;
  83. u16 custom_top_bottom;
  84. u16 custom_bottom_left;
  85. u16 custom_bottom_top;
  86. u16 custom_bottom_right;
  87. u16 custom_bottom_bottom;
  88. float bg_red;
  89. float bg_green;
  90. float bg_blue;
  91. std::string log_filter;
  92. // Audio
  93. std::string sink_id;
  94. bool enable_audio_stretching;
  95. std::string audio_device_id;
  96. // Camera
  97. std::array<std::string, Service::CAM::NumCameras> camera_name;
  98. std::array<std::string, Service::CAM::NumCameras> camera_config;
  99. // Debugging
  100. bool use_gdbstub;
  101. u16 gdbstub_port;
  102. } extern values;
  103. // a special value for Values::region_value indicating that citra will automatically select a region
  104. // value to fit the region lockout info of the game
  105. static constexpr int REGION_VALUE_AUTO_SELECT = -1;
  106. void Apply();
  107. }