Save origin state of GC controller analog features, compare against origin for input detection

This commit is contained in:
Ameer 2020-07-06 21:58:31 -04:00
parent 52882a93a5
commit 7ad423923d
3 changed files with 72 additions and 28 deletions

View file

@ -13,12 +13,6 @@
namespace GCAdapter {
enum {
PAD_USE_ORIGIN = 0x0080,
PAD_GET_ORIGIN = 0x2000,
PAD_ERR_STATUS = 0x8000,
};
enum class PadButton {
PAD_BUTTON_LEFT = 0x0001,
PAD_BUTTON_RIGHT = 0x0002,
@ -102,6 +96,9 @@ public:
std::array<GCState, 4>& GetPadState();
const std::array<GCState, 4>& GetPadState() const;
int GetOriginValue(int port, int axis);
const int GetOriginValue(int port, int axis) const;
private:
GCPadStatus GetPadStatus(int port, const std::array<u8, 37>& adapter_payload);
@ -155,6 +152,8 @@ private:
std::array<Common::SPSCQueue<GCPadStatus>, 4> pad_queue;
std::array<GCState, 4> state;
std::array<bool, 4> get_origin;
std::array<GCPadStatus, 4> origin_status;
};
} // namespace GCAdapter