From 1d1329af23221be31c244889609415e0fb0b2641 Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 20 Jan 2017 22:46:39 +0200 Subject: HID: use ButtonDevice --- src/core/settings.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src/core/settings.h') diff --git a/src/core/settings.h b/src/core/settings.h index b6c75531f..dba57bd6c 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -69,6 +69,48 @@ static const std::array All = {{ }}; } +namespace NativeButton { +enum Values { + A, + B, + X, + Y, + Up, + Down, + Left, + Right, + L, + R, + Start, + Select, + + ZL, + ZR, + + Home, + + NumButtons, +}; + +constexpr int BUTTON_HID_BEGIN = A; +constexpr int BUTTON_IR_BEGIN = ZL; +constexpr int BUTTON_NS_BEGIN = Home; + +constexpr int BUTTON_HID_END = BUTTON_IR_BEGIN; +constexpr int BUTTON_IR_END = BUTTON_NS_BEGIN; +constexpr int BUTTON_NS_END = NumButtons; + +constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN; +constexpr int NUM_BUTTONS_IR = BUTTON_IR_END - BUTTON_IR_BEGIN; +constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN; + +static const std::array mapping = {{ + "button_a", "button_b", "button_x", "button_y", "button_up", "button_down", "button_left", + "button_right", "button_l", "button_r", "button_start", "button_select", "button_zl", + "button_zr", "button_home", +}}; +} // namespace NativeButton + struct Values { // CheckNew3DS bool is_new_3ds; @@ -77,6 +119,8 @@ struct Values { std::array input_mappings; float pad_circle_modifier_scale; + std::array buttons; + // Core bool use_cpu_jit; -- cgit v1.2.3 From 70420272ca63425b52844632c6be3d3691446468 Mon Sep 17 00:00:00 2001 From: wwylele Date: Fri, 20 Jan 2017 23:58:03 +0200 Subject: HID: use AnalogDevice --- src/core/settings.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/core/settings.h') diff --git a/src/core/settings.h b/src/core/settings.h index dba57bd6c..4f83d285c 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -111,6 +111,19 @@ static const std::array mapping = {{ }}; } // namespace NativeButton +namespace NativeAnalog { +enum Values { + CirclePad, + CStick, + + NumAnalogs, +}; + +static const std::array mapping = {{ + "circle_pad", "c_stick", +}}; +} // namespace NumAnalog + struct Values { // CheckNew3DS bool is_new_3ds; @@ -120,6 +133,7 @@ struct Values { float pad_circle_modifier_scale; std::array buttons; + std::array analogs; // Core bool use_cpu_jit; -- cgit v1.2.3 From e02c4b71955021ecca294015aaf331add8d5c554 Mon Sep 17 00:00:00 2001 From: wwylele Date: Sat, 28 Jan 2017 12:33:35 +0200 Subject: Input: remove unused stuff & clean up 1. removed zl, zr and c-stick from HID::PadState. They are handled by IR, not HID 2. removed button handling in EmuWindow 3. removed key_map 4. cleanup #include --- src/core/settings.h | 54 ----------------------------------------------------- 1 file changed, 54 deletions(-) (limited to 'src/core/settings.h') diff --git a/src/core/settings.h b/src/core/settings.h index 4f83d285c..d1a9f0da8 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -18,57 +18,6 @@ enum class LayoutOption { Custom, }; -namespace NativeInput { - -enum Values { - // directly mapped keys - A, - B, - X, - Y, - L, - R, - ZL, - ZR, - START, - SELECT, - HOME, - DUP, - DDOWN, - DLEFT, - DRIGHT, - CUP, - CDOWN, - CLEFT, - CRIGHT, - - // indirectly mapped keys - CIRCLE_UP, - CIRCLE_DOWN, - CIRCLE_LEFT, - CIRCLE_RIGHT, - CIRCLE_MODIFIER, - - NUM_INPUTS -}; - -static const std::array Mapping = {{ - // directly mapped keys - "pad_a", "pad_b", "pad_x", "pad_y", "pad_l", "pad_r", "pad_zl", "pad_zr", "pad_start", - "pad_select", "pad_home", "pad_dup", "pad_ddown", "pad_dleft", "pad_dright", "pad_cup", - "pad_cdown", "pad_cleft", "pad_cright", - - // indirectly mapped keys - "pad_circle_up", "pad_circle_down", "pad_circle_left", "pad_circle_right", - "pad_circle_modifier", -}}; -static const std::array All = {{ - A, B, X, Y, L, R, ZL, ZR, - START, SELECT, HOME, DUP, DDOWN, DLEFT, DRIGHT, CUP, - CDOWN, CLEFT, CRIGHT, CIRCLE_UP, CIRCLE_DOWN, CIRCLE_LEFT, CIRCLE_RIGHT, CIRCLE_MODIFIER, -}}; -} - namespace NativeButton { enum Values { A, @@ -129,9 +78,6 @@ struct Values { bool is_new_3ds; // Controls - std::array input_mappings; - float pad_circle_modifier_scale; - std::array buttons; std::array analogs; -- cgit v1.2.3