From 58f1ff3773935187092109716e0e19b1aa260f0f Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Wed, 20 Feb 2019 17:44:55 -0600 Subject: [PATCH] WiimoteEmu: Minor accuracy fixes. --- Source/Core/Core/HW/WiimoteCommon/WiimoteReport.h | 9 ++++++--- Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/HW/WiimoteCommon/WiimoteReport.h b/Source/Core/Core/HW/WiimoteCommon/WiimoteReport.h index 18b0293804..58332383d0 100644 --- a/Source/Core/Core/HW/WiimoteCommon/WiimoteReport.h +++ b/Source/Core/Core/HW/WiimoteCommon/WiimoteReport.h @@ -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]; }; diff --git a/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp b/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp index 99f622a904..354a748b8f 100644 --- a/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp @@ -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()