settings.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. Custom,
  14. };
  15. namespace NativeInput {
  16. enum Values {
  17. // directly mapped keys
  18. A,
  19. B,
  20. X,
  21. Y,
  22. L,
  23. R,
  24. ZL,
  25. ZR,
  26. START,
  27. SELECT,
  28. HOME,
  29. DUP,
  30. DDOWN,
  31. DLEFT,
  32. DRIGHT,
  33. CUP,
  34. CDOWN,
  35. CLEFT,
  36. CRIGHT,
  37. // indirectly mapped keys
  38. CIRCLE_UP,
  39. CIRCLE_DOWN,
  40. CIRCLE_LEFT,
  41. CIRCLE_RIGHT,
  42. CIRCLE_MODIFIER,
  43. NUM_INPUTS
  44. };
  45. static const std::array<const char*, NUM_INPUTS> Mapping = {{
  46. // directly mapped keys
  47. "pad_a", "pad_b", "pad_x", "pad_y", "pad_l", "pad_r", "pad_zl", "pad_zr", "pad_start",
  48. "pad_select", "pad_home", "pad_dup", "pad_ddown", "pad_dleft", "pad_dright", "pad_cup",
  49. "pad_cdown", "pad_cleft", "pad_cright",
  50. // indirectly mapped keys
  51. "pad_circle_up", "pad_circle_down", "pad_circle_left", "pad_circle_right",
  52. "pad_circle_modifier",
  53. }};
  54. static const std::array<Values, NUM_INPUTS> All = {{
  55. A, B, X, Y, L, R, ZL, ZR,
  56. START, SELECT, HOME, DUP, DDOWN, DLEFT, DRIGHT, CUP,
  57. CDOWN, CLEFT, CRIGHT, CIRCLE_UP, CIRCLE_DOWN, CIRCLE_LEFT, CIRCLE_RIGHT, CIRCLE_MODIFIER,
  58. }};
  59. }
  60. struct Values {
  61. // CheckNew3DS
  62. bool is_new_3ds;
  63. // Controls
  64. std::array<int, NativeInput::NUM_INPUTS> input_mappings;
  65. float pad_circle_modifier_scale;
  66. // Core
  67. bool use_cpu_jit;
  68. // Data Storage
  69. bool use_virtual_sd;
  70. // System Region
  71. int region_value;
  72. // Renderer
  73. bool use_hw_renderer;
  74. bool use_shader_jit;
  75. float resolution_factor;
  76. bool use_vsync;
  77. bool toggle_framelimit;
  78. LayoutOption layout_option;
  79. bool swap_screen;
  80. float bg_red;
  81. float bg_green;
  82. float bg_blue;
  83. std::string log_filter;
  84. // Audio
  85. std::string sink_id;
  86. bool enable_audio_stretching;
  87. std::string audio_device_id;
  88. // Debugging
  89. bool use_gdbstub;
  90. u16 gdbstub_port;
  91. } extern values;
  92. // a special value for Values::region_value indicating that citra will automatically select a region
  93. // value to fit the region lockout info of the game
  94. static constexpr int REGION_VALUE_AUTO_SELECT = -1;
  95. void Apply();
  96. }