Skip to content
Permalink
Browse files

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

WiimoteEmu: Minor accuracy fixes.
  • Loading branch information...
JMC47 committed Feb 21, 2019
2 parents 286aafd + 58f1ff3 commit 3426c985f93801cf07fe88e2d0be73cea70a2cc0
@@ -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];
};
@@ -45,7 +45,8 @@ void Wiimote::HandleReportMode(const OutputReportMode& dr)
m_reporting_continuous = dr.continuous;
m_reporting_mode = dr.mode;

SendAck(OutputReportID::ReportMode, ErrorCode::Success);
if (dr.ack)
SendAck(OutputReportID::ReportMode, ErrorCode::Success);
}

// Tests that we have enough bytes for the report before we run the handler.
@@ -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()

0 comments on commit 3426c98

Please sign in to comment.
You can’t perform that action at this time.