diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 46bba9d0d9..0b0c8af66a 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -53,6 +53,8 @@ #include "HW/VideoInterface.h" #include "HW/SystemTimers.h" +#include "IPC_HLE/WII_IPC_HLE_Device_usb.h" + #include "PowerPC/PowerPC.h" #include "PowerPC/JitCommon/JitBase.h" @@ -390,8 +392,15 @@ THREAD_RETURN EmuThread(void *pArg) // Load and Init Wiimotes - only if we are booting in wii mode if (_CoreParameter.bWii) + { Wiimote::Initialize(g_pWindowHandle); + // activate wiimotes which don't have source set to "None" + for (unsigned int i = 0; i != MAX_WIIMOTES; ++i) + if (g_wiimote_sources[i]) + GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(true); + } + // The hardware is initialized. g_bHwInit = true; diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp index 727cd29d48..9bb1f9d24d 100644 --- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp @@ -266,7 +266,7 @@ void LoadSettings() secname += (char)('1' + i); IniFile::Section& sec = *inifile.GetOrCreateSection(secname.c_str()); - sec.Get("Source", &g_wiimote_sources[i], WIIMOTE_SRC_EMU); + sec.Get("Source", &g_wiimote_sources[i], i ? WIIMOTE_SRC_NONE : WIIMOTE_SRC_EMU); } } 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 2873a2f684..ad2fdfdb3e 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 @@ -57,7 +57,7 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De tmpBD.b[0] = BT_DINF[6 + (i * WIIMOTESIZE)]; INFO_LOG(WII_IPC_WIIMOTE, "Wiimote %d BT ID %x,%x,%x,%x,%x,%x", i, tmpBD.b[0], tmpBD.b[1], tmpBD.b[2], tmpBD.b[3], tmpBD.b[4], tmpBD.b[5]); - m_WiiMotes.push_back(CWII_IPC_HLE_WiiMote(this, i, tmpBD, !i)); + m_WiiMotes.push_back(CWII_IPC_HLE_WiiMote(this, i, tmpBD, false)); i++; } while (i < 4) @@ -73,7 +73,7 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De memcpy((BT_DINF+7 + (i * WIIMOTESIZE)), wmName, 20); INFO_LOG(WII_IPC_WIIMOTE, "Adding to SYSConf Wiimote %d BT ID %x,%x,%x,%x,%x,%x", i, tmpBD.b[0], tmpBD.b[1], tmpBD.b[2], tmpBD.b[3], tmpBD.b[4], tmpBD.b[5]); - m_WiiMotes.push_back(CWII_IPC_HLE_WiiMote(this, i, tmpBD, !i)); + m_WiiMotes.push_back(CWII_IPC_HLE_WiiMote(this, i, tmpBD, false)); i++; } if (BT_DINF[0] != maxWM)