Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Edge case where balance board returns corrupt extension type...
  • Loading branch information
Parlane committed May 22, 2013
1 parent 2effab9 commit 3778c96
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Source/Core/Core/Src/HW/WiimoteReal/IOWin.cpp
Expand Up @@ -353,6 +353,8 @@ void WiimoteScanner::CheckDeviceType(std::basic_string<TCHAR> &devicepath, bool
{
case WM_STATUS_REPORT:
{
real_wiimote = true;

// DEBUG_LOG(WIIMOTE, "CheckDeviceType: Got Status Report");
wm_status_report * wsr = (wm_status_report*)&buf[2];
if (wsr->extension)
Expand All @@ -369,15 +371,16 @@ void WiimoteScanner::CheckDeviceType(std::basic_string<TCHAR> &devicepath, bool
}
else
{
real_wiimote = true;
// Normal Wiimote, exit while and be happy.
rc = -1;
}
break;
}
case WM_ACK_DATA:
{
// DEBUG_LOG(WIIMOTE, "CheckDeviceType: Got Ack");
real_wiimote = true;
//wm_acknowledge * wm = (wm_acknowledge*)&buf[2];
//DEBUG_LOG(WIIMOTE, "CheckDeviceType: Got Ack Error: %X ReportID: %X", wm->errorID, wm->reportID);
break;
}
case WM_READ_DATA_REPLY:
Expand All @@ -394,7 +397,9 @@ void WiimoteScanner::CheckDeviceType(std::basic_string<TCHAR> &devicepath, bool
// DEBUG_LOG(WIIMOTE,
// "CheckDeviceType: GOT EXT TYPE %llX",
// ext_type);
is_bb = ext_type == 0x020420A40000ULL;
is_bb = (ext_type == 0x020420A40000ULL) ||
((ext_type & 0xf00000000000ULL) &&
ext_type != 0xffffffffffffULL);
}
else
{
Expand Down

0 comments on commit 3778c96

Please sign in to comment.