Changing the Nunchuk stick axis from center to center + 1

if the other axis isn't at center

because

* it's expected by some emulated programs
This commit is contained in:
John S. Peterson 2013-07-20 12:26:43 +02:00 committed by Rachel Bryk
parent 23f59a82f7
commit 9b20280bcf
1 changed files with 8 additions and 0 deletions

View File

@ -92,6 +92,14 @@ void Nunchuk::GetState(u8* const data, const bool focus)
ncdata->jx = u8(trim(state[0]));
ncdata->jy = u8(trim(state[1]));
if (ncdata->jx != cal.jx.center || ncdata->jy != cal.jy.center)
{
if (ncdata->jy == cal.jy.center)
ncdata->jy = cal.jy.center + 1;
if (ncdata->jx == cal.jx.center)
ncdata->jx = cal.jx.center + 1;
}
if (!focus)
{
ncdata->jx = cal.jx.center;