cleanup check access, read, and factory GetNextInput funcs. Use size rather than magic number

This commit is contained in:
Ameer
2020-06-23 17:37:15 -04:00
parent d4e07fd95e
commit 743e1f02a0
4 changed files with 101 additions and 151 deletions

View File

@ -37,6 +37,12 @@ enum PadButton {
};
/// Used to loop through the and assign button in poller
static constexpr std::array<PadButton, 12> PadButtonArray{
PAD_BUTTON_LEFT, PAD_BUTTON_RIGHT, PAD_BUTTON_DOWN, PAD_BUTTON_UP,
PAD_TRIGGER_Z, PAD_TRIGGER_R, PAD_TRIGGER_L, PAD_BUTTON_A,
PAD_BUTTON_B, PAD_BUTTON_X, PAD_BUTTON_Y, PAD_BUTTON_START};
enum class PadAxes : u8 {
StickX,
StickY,
@ -100,7 +106,7 @@ public:
const std::array<GCState, 4>& GetPadState() const;
private:
GCPadStatus CheckStatus(int port, const std::array<u8, 37>& adapter_payload);
GCPadStatus GetPadStatus(int port, const std::array<u8, 37>& adapter_payload);
void PadToState(const GCPadStatus& pad, GCState& state);