Skip to content

Commit

Permalink
more logging changes, handle output acknowledgements,
Browse files Browse the repository at this point in the history
  • Loading branch information
capitalistspz committed Aug 12, 2023
1 parent e6c8c31 commit 5476eb9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/input/api/Wiimote/WiimoteControllerProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ std::vector<std::shared_ptr<ControllerBase>> WiimoteControllerProvider::get_cont
{
// only add unknown, connected devices to our list
const bool is_new_device = std::none_of(m_wiimotes.cbegin(), m_wiimotes.cend(),
[&device](const auto& it) { return *it.device == *device; });
[device](const auto& it) { return *it.device == *device; });
if (is_new_device)
{
m_wiimotes.push_back(std::make_unique<Wiimote>(device));
Expand Down Expand Up @@ -290,7 +290,8 @@ void WiimoteControllerProvider::reader_thread()
request_status(index);
break;
default:
new_state.m_extension = {};
cemuLog_logDebug(LogType::Force,"Unknown extension: {:#x}", be_type.value());
new_state.m_extension = {};
break;
}

Expand Down Expand Up @@ -356,6 +357,16 @@ void WiimoteControllerProvider::reader_thread()
update_report = true;
}
break;
case kAcknowledge:
{
new_state.buttons = *(uint16*)data & (~0x60E0);
data += 2;
const auto report_id = *data++;
const auto error = *data++;
if (error)
cemuLog_logDebug(LogType::Force, "Error {:#x} from output report {:#x}", error, report_id);
break;
}
case kDataCore:
{
// 30 BB BB
Expand Down Expand Up @@ -580,7 +591,7 @@ void WiimoteControllerProvider::reader_thread()
break;
}
default:
cemuLog_logDebug(LogType::Force,"unhandled input packet id {} for wiimote", data[0]);
cemuLog_logDebug(LogType::Force,"unhandled input packet id {} for wiimote {}", id, index);
}

// update motion data
Expand Down
2 changes: 1 addition & 1 deletion src/input/api/Wiimote/WiimoteMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ enum InputReportId : uint8

kStatus = 0x20,
kRead = 0x21,
kWrite = 0x22,
kAcknowledge = 0x22,

kDataCore = 0x30,
kDataCoreAcc = 0x31,
Expand Down

0 comments on commit 5476eb9

Please sign in to comment.