aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/hid/controllers/npad.h
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2018-10-10 21:38:43 +1100
committerDavid Marcec <dmarcecguzman@gmail.com>2018-10-10 21:38:43 +1100
commit3d75c9cd7a75f7ef97e2e14fc2eb15e4bba92934 (patch)
treea4fd0d5c6ed5e11fa5eb0229b9dd9ab4e06885de /src/core/hle/service/hid/controllers/npad.h
parent46cdeb4549dbd549f9700967c25c089594f3b4ff (diff)
Added GetLedPattern and HandheldVariant
HandheldVariant is for specific games which expect handheld controllers to be at position 8(kirby), however this doesn't fix all games as some games require handhelds to be at position 0(snipperclips)
Diffstat (limited to 'src/core/hle/service/hid/controllers/npad.h')
-rw-r--r--src/core/hle/service/hid/controllers/npad.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 86ab0e429..28c89768c 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -65,12 +65,29 @@ public:
None,
ProController,
Handheld,
+ HandheldVariant, // Games which require the handheld controller to be at index 8
JoyLeft,
JoyRight,
Tabletop,
Pokeball,
};
+ struct LedPattern {
+ explicit LedPattern(u64 light1, u64 light2, u64 light3, u64 light4) {
+ position1.Assign(light1);
+ position1.Assign(light2);
+ position1.Assign(light3);
+ position1.Assign(light4);
+ };
+ union {
+ u64 raw{};
+ BitField<0, 1, u64> position1;
+ BitField<1, 1, u64> position2;
+ BitField<2, 1, u64> position3;
+ BitField<3, 1, u64> position4;
+ };
+ };
+
void SetSupportedStyleSet(NPadType style_set);
NPadType GetSupportedStyleSet() const;
@@ -93,6 +110,7 @@ public:
void ConnectNPad(u32 npad_id);
void DisconnectNPad(u32 npad_id);
+ LedPattern GetLedPattern(u32 npad_id);
private:
struct CommonHeader {
@@ -255,8 +273,8 @@ private:
std::size_t dump_idx{};
Vibration last_processed_vibration{};
std::size_t controller_count{};
- static constexpr std::array<u32, 9> npad_id_list{0, 1, 2, 3, 4, 5, 6, 7, 32};
- std::array<ControllerHolder, 9> connected_controllers{};
+ static constexpr std::array<u32, 10> npad_id_list{0, 1, 2, 3, 4, 5, 6, 7, 32, 16};
+ std::array<ControllerHolder, 10> connected_controllers{};
void InitNewlyAddedControler(std::size_t controller_idx);
};