diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp index a9d564d116a6..aae789db90b3 100644 --- a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp @@ -516,8 +516,15 @@ void Wiimote::SendDataReport() const u8 camera_data_offset = CameraLogic::REPORT_DATA_OFFSET + rpt_builder.GetIRDataFormatOffset(); - m_i2c_bus.BusRead(CameraLogic::I2C_ADDR, camera_data_offset, rpt_builder.GetIRDataSize(), - rpt_builder.GetIRDataPtr()); + u8* ir_data = rpt_builder.GetIRDataPtr(); + const u8 ir_size = rpt_builder.GetIRDataSize(); + + if (ir_size != m_i2c_bus.BusRead(CameraLogic::I2C_ADDR, camera_data_offset, ir_size, ir_data)) + { + // This happens when IR reporting is enabled but the camera hardware is disabled. + // It commonly occurs when changing IR sensitivity. + std::fill_n(ir_data, ir_size, 0xff); + } } // Extension port: