Automatically disconnect and reconnect the Wiimotes after a save state has been loaded. This makes the save states a bit more stable for Wii games.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7090 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau 2011-02-06 05:42:58 +00:00
parent 0f7ff9c23e
commit 89594b1731

View File

@ -111,13 +111,22 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::DoState(PointerWrap &p)
p.Do(m_NumCompPackets_Freq); p.Do(m_NumCompPackets_Freq);
p.Do(m_WiimoteUpdate_Freq); p.Do(m_WiimoteUpdate_Freq);
for (int i = 0; i < 4; i++) if (p.GetMode() == PointerWrap::MODE_READ)
{ {
p.Do(m_PacketCount[i]); // Reset the connection of all connected wiimotes
for (unsigned int i = 0; i < 4; i++)
{
if (m_WiiMotes[i].IsConnected())
{
m_WiiMotes[i].Activate(false);
m_WiiMotes[i].Activate(true);
}
else
{
m_WiiMotes[i].Activate(false);
}
}
} }
for (unsigned int i = 0; i < m_WiiMotes.size(); i++)
m_WiiMotes[i].DoState(p);
} }
bool CWII_IPC_HLE_Device_usb_oh1_57e_305::RemoteDisconnect(u16 _connectionHandle) bool CWII_IPC_HLE_Device_usb_oh1_57e_305::RemoteDisconnect(u16 _connectionHandle)