diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2018-10-18 05:11:15 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-19 05:21:33 +0100 |
commit | beab38601badd54930881858b4a021fe76a92b39 (patch) | |
tree | 1e385dee587c3b7b09d191a11c425983ec659b84 /src/core/hle/service/hid/controllers/npad.h | |
parent | Merge pull request #1717 from FreddyFunk/swizzle-gob (diff) | |
download | yuzu-beab38601badd54930881858b4a021fe76a92b39.tar yuzu-beab38601badd54930881858b4a021fe76a92b39.tar.gz yuzu-beab38601badd54930881858b4a021fe76a92b39.tar.bz2 yuzu-beab38601badd54930881858b4a021fe76a92b39.tar.lz yuzu-beab38601badd54930881858b4a021fe76a92b39.tar.xz yuzu-beab38601badd54930881858b4a021fe76a92b39.tar.zst yuzu-beab38601badd54930881858b4a021fe76a92b39.zip |
Diffstat (limited to 'src/core/hle/service/hid/controllers/npad.h')
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index ac86985ff..1192cfcd9 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -107,6 +107,7 @@ public: Vibration GetLastVibration() const; void AddNewController(NPadControllerType controller); + void AddNewControllerAt(NPadControllerType controller, u32 npad_id); void ConnectNPad(u32 npad_id); void DisconnectNPad(u32 npad_id); @@ -189,12 +190,17 @@ private: }; static_assert(sizeof(ConnectionState) == 4, "ConnectionState is an invalid size"); - struct GenericStates { - s64_le timestamp; - s64_le timestamp2; + struct ControllerPad { ControllerPadState pad_states; AnalogPosition l_stick; AnalogPosition r_stick; + }; + static_assert(sizeof(ControllerPad) == 0x18, "ControllerPad is an invalid size"); + + struct GenericStates { + s64_le timestamp; + s64_le timestamp2; + ControllerPad pad; ConnectionState connection_status; }; static_assert(sizeof(GenericStates) == 0x30, "NPadGenericStates is an invalid size"); @@ -285,5 +291,9 @@ private: void InitNewlyAddedControler(std::size_t controller_idx); bool IsControllerSupported(NPadControllerType controller) const; NPadControllerType DecideBestController(NPadControllerType priority) const; + void RequestPadStateUpdate(u32 npad_id); + std::size_t NPadIdToIndex(u32 npad_id); + u32 IndexToNPad(std::size_t index); + std::array<ControllerPad, 10> npad_pad_states{}; }; } // namespace Service::HID |