示例#1
0
// to be called from CPU thread
void Wiimote::WriteReport(Report rpt)
{
	if (rpt.size() >= 3)
	{
		bool const new_rumble_state = (rpt[2] & 0x1) != 0;

		// If this is a rumble report and the rumble state didn't change, ignore.
		if (WM_RUMBLE == rpt[1] && new_rumble_state == m_rumble_state)
			return;

		m_rumble_state = new_rumble_state;
	}

	m_write_reports.Push(std::move(rpt));
	IOWakeup();
}
示例#2
0
static bool IsDataReport(const Report& rpt)
{
	return rpt.size() >= 2 && rpt[1] >= WM_REPORT_CORE;
}