Merge pull request #7812 from jordan-woyak/wiimote-emu-minor

WiimoteEmu: Minor accuracy fixes.
This commit is contained in:
JMC47 2019-02-21 13:54:43 -05:00 committed by GitHub
commit 3426c985f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -84,8 +84,9 @@ static_assert(sizeof(OutputReportRequestStatus) == 1, "Wrong size");
struct OutputReportWriteData
{
u8 rumble : 1;
u8 : 1;
u8 space : 2;
u8 : 5;
u8 : 4;
// A real wiimote ignores the i2c read/write bit.
u8 i2c_rw_ignored : 1;
// Used only for register space (i2c bus) (7-bits):
@ -100,8 +101,9 @@ static_assert(sizeof(OutputReportWriteData) == 21, "Wrong size");
struct OutputReportReadData
{
u8 rumble : 1;
u8 : 1;
u8 space : 2;
u8 : 5;
u8 : 4;
// A real wiimote ignores the i2c read/write bit.
u8 i2c_rw_ignored : 1;
// Used only for register space (i2c bus) (7-bits):
@ -114,7 +116,8 @@ static_assert(sizeof(OutputReportReadData) == 6, "Wrong size");
struct OutputReportSpeakerData
{
u8 unknown : 3;
u8 rumble : 1;
u8 : 2;
u8 length : 5;
u8 data[20];
};

View File

@ -45,6 +45,7 @@ void Wiimote::HandleReportMode(const OutputReportMode& dr)
m_reporting_continuous = dr.continuous;
m_reporting_mode = dr.mode;
if (dr.ack)
SendAck(OutputReportID::ReportMode, ErrorCode::Success);
}
@ -322,6 +323,7 @@ void Wiimote::HandleWriteData(const OutputReportWriteData& wd)
break;
}
// Real wiimotes seem to always ACK data writes.
SendAck(OutputReportID::WriteData, error_code);
}
@ -426,6 +428,8 @@ void Wiimote::HandleReadData(const OutputReportReadData& rd)
// If more data needs to be sent it will happen on the next "Update()"
// TODO: should this be removed and let Update() take care of it?
ProcessReadDataRequest();
// FYI: No "ACK" is sent.
}
bool Wiimote::ProcessReadDataRequest()