Fix acceleration emulation for wiimote and nunchuk.

The 1-2 least significant bits were missing.
This commit is contained in:
Rachel Bryk
2014-10-24 21:59:16 -04:00
parent e9bbf00c88
commit f07d3be502
9 changed files with 286 additions and 111 deletions

View File

@ -378,7 +378,7 @@ void TASInputDlg::SetButtonValue(Button* button, bool CurrentState)
}
}
void TASInputDlg::SetWiiButtons(wm_core* butt)
void TASInputDlg::SetWiiButtons(u16* butt)
{
for (unsigned int i = 0; i < 14; ++i)
{
@ -415,7 +415,7 @@ void TASInputDlg::GetKeyBoardInput(u8* data, WiimoteEmu::ReportFeatures rptf)
for (unsigned int i = 0; i < 14; ++i)
{
if (m_buttons[i] != nullptr)
SetButtonValue(m_buttons[i], (*(wm_core*)coreData & m_wii_buttons_bitmask[i]) != 0);
SetButtonValue(m_buttons[i], (((wm_buttons*)coreData)->hex & m_wii_buttons_bitmask[i]) != 0);
}
}
if (accelData)
@ -450,7 +450,7 @@ void TASInputDlg::GetValues(u8* data, WiimoteEmu::ReportFeatures rptf)
u8* const irData = rptf.ir ? (data + rptf.ir) : nullptr;
if (coreData)
SetWiiButtons((wm_core*)coreData);
SetWiiButtons(&((wm_buttons*)coreData)->hex);
if (accelData)
{