Wiimote: Fixed the dual mode bug I mentioned in the last commit, now the Nunchuck should not get stuck when switching between the real and emulated Nunchuck. The only important problem left is disconnect problem that occurs about one in five times you switch to the real wiimote.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2130 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-02-07 04:19:52 +00:00
parent fcdd2a8e17
commit 382b4af74b
6 changed files with 88 additions and 51 deletions

View File

@ -517,10 +517,21 @@ void ReadDebugging(bool Emu, const void* _pData, int Size)
Console::Print("JS.Center.y: %i\n\n", data[7 + 13]);
// Save the values
if (!Emu && data[7 + 0] != 0xff)
if (!Emu)
{
memcpy(WiiMoteEmu::g_RegExt + 0x20, &data[7], 0x10);
memcpy(WiiMoteEmu::g_RegExt + 0x30, &data[7], 0x10);
// Save the values from the Nunchuck
if(data[7 + 0] != 0xff)
{
memcpy(WiiMoteEmu::g_RegExt + 0x20, &data[7], 0x10);
memcpy(WiiMoteEmu::g_RegExt + 0x30, &data[7], 0x10);
}
// Save the default values that should work with Wireless Nunchucks
else
{
WiiMoteEmu::SetDefaultExtensionRegistry();
}
WiiMoteEmu::UpdateEeprom();
}
// We got a third party nunchuck
else if(data[7 + 0] == 0xff)