DigitalController: Fix broken input due to 0x01 handling

Fixes THPS among others.
This commit is contained in:
Connor McLaughlin
2019-10-26 22:33:23 +10:00
parent 3b32053065
commit b0c492fd43
3 changed files with 46 additions and 48 deletions

View File

@ -1,5 +1,4 @@
#pragma once
#include "common/fifo_queue.h"
#include "pad_device.h"
#include <memory>
@ -37,10 +36,16 @@ public:
bool Transfer(const u8 data_in, u8* data_out) override;
private:
void QueryState();
enum class TransferState : u8
{
Idle,
IDMSB,
ButtonsLSB,
ButtonsMSB
};
// buttons are active low
u16 m_button_state = UINT16_C(0xFFFF);
InlineFIFOQueue<u8, 8> m_transfer_fifo;
TransferState m_transfer_state = TransferState::Idle;
};