diff options
Diffstat (limited to 'src/core/settings.h')
| -rw-r--r-- | src/core/settings.h | 80 |
1 files changed, 42 insertions, 38 deletions
diff --git a/src/core/settings.h b/src/core/settings.h index b6c75531f..d1a9f0da8 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -18,64 +18,68 @@ enum class LayoutOption { | |||
| 18 | Custom, | 18 | Custom, |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | namespace NativeInput { | 21 | namespace NativeButton { |
| 22 | |||
| 23 | enum Values { | 22 | enum Values { |
| 24 | // directly mapped keys | ||
| 25 | A, | 23 | A, |
| 26 | B, | 24 | B, |
| 27 | X, | 25 | X, |
| 28 | Y, | 26 | Y, |
| 27 | Up, | ||
| 28 | Down, | ||
| 29 | Left, | ||
| 30 | Right, | ||
| 29 | L, | 31 | L, |
| 30 | R, | 32 | R, |
| 33 | Start, | ||
| 34 | Select, | ||
| 35 | |||
| 31 | ZL, | 36 | ZL, |
| 32 | ZR, | 37 | ZR, |
| 33 | START, | 38 | |
| 34 | SELECT, | 39 | Home, |
| 35 | HOME, | 40 | |
| 36 | DUP, | 41 | NumButtons, |
| 37 | DDOWN, | ||
| 38 | DLEFT, | ||
| 39 | DRIGHT, | ||
| 40 | CUP, | ||
| 41 | CDOWN, | ||
| 42 | CLEFT, | ||
| 43 | CRIGHT, | ||
| 44 | |||
| 45 | // indirectly mapped keys | ||
| 46 | CIRCLE_UP, | ||
| 47 | CIRCLE_DOWN, | ||
| 48 | CIRCLE_LEFT, | ||
| 49 | CIRCLE_RIGHT, | ||
| 50 | CIRCLE_MODIFIER, | ||
| 51 | |||
| 52 | NUM_INPUTS | ||
| 53 | }; | 42 | }; |
| 54 | 43 | ||
| 55 | static const std::array<const char*, NUM_INPUTS> Mapping = {{ | 44 | constexpr int BUTTON_HID_BEGIN = A; |
| 56 | // directly mapped keys | 45 | constexpr int BUTTON_IR_BEGIN = ZL; |
| 57 | "pad_a", "pad_b", "pad_x", "pad_y", "pad_l", "pad_r", "pad_zl", "pad_zr", "pad_start", | 46 | constexpr int BUTTON_NS_BEGIN = Home; |
| 58 | "pad_select", "pad_home", "pad_dup", "pad_ddown", "pad_dleft", "pad_dright", "pad_cup", | 47 | |
| 59 | "pad_cdown", "pad_cleft", "pad_cright", | 48 | constexpr int BUTTON_HID_END = BUTTON_IR_BEGIN; |
| 49 | constexpr int BUTTON_IR_END = BUTTON_NS_BEGIN; | ||
| 50 | constexpr int BUTTON_NS_END = NumButtons; | ||
| 51 | |||
| 52 | constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN; | ||
| 53 | constexpr int NUM_BUTTONS_IR = BUTTON_IR_END - BUTTON_IR_BEGIN; | ||
| 54 | constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN; | ||
| 60 | 55 | ||
| 61 | // indirectly mapped keys | 56 | static const std::array<const char*, NumButtons> mapping = {{ |
| 62 | "pad_circle_up", "pad_circle_down", "pad_circle_left", "pad_circle_right", | 57 | "button_a", "button_b", "button_x", "button_y", "button_up", "button_down", "button_left", |
| 63 | "pad_circle_modifier", | 58 | "button_right", "button_l", "button_r", "button_start", "button_select", "button_zl", |
| 59 | "button_zr", "button_home", | ||
| 64 | }}; | 60 | }}; |
| 65 | static const std::array<Values, NUM_INPUTS> All = {{ | 61 | } // namespace NativeButton |
| 66 | A, B, X, Y, L, R, ZL, ZR, | 62 | |
| 67 | START, SELECT, HOME, DUP, DDOWN, DLEFT, DRIGHT, CUP, | 63 | namespace NativeAnalog { |
| 68 | CDOWN, CLEFT, CRIGHT, CIRCLE_UP, CIRCLE_DOWN, CIRCLE_LEFT, CIRCLE_RIGHT, CIRCLE_MODIFIER, | 64 | enum Values { |
| 65 | CirclePad, | ||
| 66 | CStick, | ||
| 67 | |||
| 68 | NumAnalogs, | ||
| 69 | }; | ||
| 70 | |||
| 71 | static const std::array<const char*, NumAnalogs> mapping = {{ | ||
| 72 | "circle_pad", "c_stick", | ||
| 69 | }}; | 73 | }}; |
| 70 | } | 74 | } // namespace NumAnalog |
| 71 | 75 | ||
| 72 | struct Values { | 76 | struct Values { |
| 73 | // CheckNew3DS | 77 | // CheckNew3DS |
| 74 | bool is_new_3ds; | 78 | bool is_new_3ds; |
| 75 | 79 | ||
| 76 | // Controls | 80 | // Controls |
| 77 | std::array<int, NativeInput::NUM_INPUTS> input_mappings; | 81 | std::array<std::string, NativeButton::NumButtons> buttons; |
| 78 | float pad_circle_modifier_scale; | 82 | std::array<std::string, NativeAnalog::NumAnalogs> analogs; |
| 79 | 83 | ||
| 80 | // Core | 84 | // Core |
| 81 | bool use_cpu_jit; | 85 | bool use_cpu_jit; |