Fixed the emulated Wiimote in Rayman Rabbids 1, Sonic Rings and Wii Sports

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1283 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2008-11-24 02:29:38 +00:00
parent b19859450e
commit 67087170ab
13 changed files with 202 additions and 199 deletions

View File

@ -156,53 +156,47 @@ extern "C" void Wiimote_Shutdown(void)
WiiMoteEmu::Shutdown();
}
// ===================================================
/* This function produce Wiimote Input (reports from the Wiimote) in response
to Output from the Wii. It's called from WII_IPC_HLE_WiiMote.cpp. */
// ----------------
extern "C" void Wiimote_InterruptChannel(u16 _channelID, const void* _pData, u32 _Size)
{
LOGV(WII_IPC_WIIMOTE, 0, "=============================================================");
LOGV(WII_IPC_WIIMOTE, 3, "=============================================================");
const u8* data = (const u8*)_pData;
// Debugging. Dump raw data.
// Debugging
{
LOG(WII_IPC_WIIMOTE, "Wiimote_Input");
LOG(WII_IPC_WIIMOTE, " Channel ID: %04x", _channelID);
std::string Temp;
for (u32 j=0; j<_Size; j++)
{
char Buffer[128];
sprintf(Buffer, "%02x ", data[j]);
Temp.append(Buffer);
}
LOG(WII_IPC_WIIMOTE, " Data: %s", Temp.c_str());
LOGV(WII_IPC_WIIMOTE, 3, "Wiimote_Input");
LOGV(WII_IPC_WIIMOTE, 3, " Channel ID: %04x", _channelID);
std::string Temp = WiiMoteEmu::ArrayToString(data, _Size);
LOGV(WII_IPC_WIIMOTE, 3, " Data: %s", Temp.c_str());
}
if (g_UseRealWiiMote)
WiiMoteReal::InterruptChannel(_channelID, _pData, _Size);
else
WiiMoteEmu::InterruptChannel(_channelID, _pData, _Size);
LOGV(WII_IPC_WIIMOTE, 0, "=============================================================");
LOGV(WII_IPC_WIIMOTE, 3, "=============================================================");
}
extern "C" void Wiimote_ControlChannel(u16 _channelID, const void* _pData, u32 _Size)
{
LOGV(WII_IPC_WIIMOTE, 3, "=============================================================");
const u8* data = (const u8*)_pData;
// dump raw data
// Debugging
{
LOG(WII_IPC_WIIMOTE, "Wiimote_ControlChannel");
std::string Temp;
for (u32 j=0; j<_Size; j++)
{
char Buffer[128];
sprintf(Buffer, "%02x ", data[j]);
Temp.append(Buffer);
}
LOG(WII_IPC_WIIMOTE, " Data: %s", Temp.c_str());
LOGV(WII_IPC_WIIMOTE, 3, "Wiimote_ControlChannel");
std::string Temp = WiiMoteEmu::ArrayToString(data, _Size);
LOGV(WII_IPC_WIIMOTE, 3, " Data: %s", Temp.c_str());
}
if (g_UseRealWiiMote)
WiiMoteReal::ControlChannel(_channelID, _pData, _Size);
else
WiiMoteEmu::ControlChannel(_channelID, _pData, _Size);
LOGV(WII_IPC_WIIMOTE, 3, "=============================================================");
}
extern "C" void Wiimote_Update()