Fixed a bug in FillReport.cpp that caused the emulated Wiimote under Linux to case every button to be pressed(FillReport.cpp). Moving the read packet data one byte forward to match what is received under Windows. Don't know why the Wiimote doesn't work still

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2818 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2009-04-01 20:37:18 +00:00
parent e099934a85
commit ca7683a911
2 changed files with 8 additions and 13 deletions

View File

@ -381,7 +381,7 @@ int IsKey(int Key)
default: PanicAlert("There is syntax error in a function that is calling IsKey(%i)", Key); return false;
}
#else
return true;
return false;
#endif
}
//////////////////////////////////////////

View File

@ -148,8 +148,8 @@ void ReadData()
//INFO_LOG(CONSOLE, "Writing data to the Wiimote\n");
SEvent& rEvent = m_EventWriteQueue.front();
wiiuse_io_write(m_pWiiMote, (byte*)rEvent.m_PayLoad, MAX_PAYLOAD);
m_EventWriteQueue.pop();
m_EventWriteQueue.pop();
#ifdef _WIN32
// Debugging. Move the data one step to the right first.
memcpy(rEvent.m_PayLoad + 1, rEvent.m_PayLoad, sizeof(rEvent.m_PayLoad) - 1);
@ -164,12 +164,15 @@ void ReadData()
if (wiiuse_io_read(m_pWiiMote))
{
const byte* pBuffer = m_pWiiMote->event_buf;
#ifndef _WIN32
// The Linux packets are starting out one spot before the Windows one. This should really be handled in the wiiuse library
pBuffer++;
#endif
// Check if we have a channel (connection) if so save the data...
if (m_channelID > 0)
{
m_pCriticalSection->Enter();
// Filter out data reports
if (pBuffer[0] >= 0x30)
{
@ -188,14 +191,6 @@ void ReadData()
}
m_pCriticalSection->Leave();
}
#ifdef _WIN32
/* Debugging
//if(GetAsyncKeyState('V'))
{
std::string Temp = ArrayToString(pBuffer, 20, 0, 30);
INFO_LOG(CONSOLE, "Data: %s\n", Temp.c_str());
} */
#endif
}
};
/////////////////////