summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2011-02-06 05:42:58 +0000
committerskidau <skidau@gmail.com>2011-02-06 05:42:58 +0000
commit89594b173111b1185babe65ea9b5d596cc443458 (patch)
tree5ca135f2dac8d4330cc93c4b8615d1abfb196288 /Source/Core
parent0f7ff9c23efffdcbdbc1cd3e4584a68588dd8130 (diff)
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
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
index 78541e609e..da8b06748c 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
@@ -111,13 +111,22 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::DoState(PointerWrap &p)
p.Do(m_NumCompPackets_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)