From c14becd575e8bedd306c0a337025a2795d847aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 10 Feb 2017 19:03:19 +0100 Subject: [PATCH] Fix connecting Wii remotes on boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The recent IOS initialization changes caused the Bluetooth device to no longer exist before "starting" IOS (as it should be…), which meant that Core could not activate Wii remotes during the boot process anymore. But that is actually completely useless, because we can just have the emulated Bluetooth code itself activate Wii remotes as appropriate, at the right moment. --- Source/Core/Core/Core.cpp | 9 --------- Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp | 4 +--- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 5d7b1da8d3..acb17a4434 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -55,8 +55,6 @@ #include "Core/HW/VideoInterface.h" #include "Core/HW/Wiimote.h" #include "Core/IOS/IPC.h" -#include "Core/IOS/USB/Bluetooth/BTEmu.h" -#include "Core/IOS/USB/Bluetooth/WiimoteDevice.h" #include "Core/Movie.h" #include "Core/NetPlayClient.h" #include "Core/NetPlayProto.h" @@ -526,13 +524,6 @@ void EmuThread() Wiimote::InitializeMode::DO_NOT_WAIT_FOR_WIIMOTES); else Wiimote::LoadConfig(); - - // Activate Wiimotes which don't have source set to "None" - const auto bt = std::static_pointer_cast( - IOS::HLE::GetDeviceByName("/dev/usb/oh1/57e/305")); - for (unsigned int i = 0; i != MAX_BBMOTES; ++i) - if (g_wiimote_sources[i] && bt) - bt->AccessWiiMote(i | 0x100)->Activate(true); } AudioCommon::InitSoundStream(); diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp index f167d1ae23..0ba7c572ea 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp @@ -47,8 +47,6 @@ BluetoothEmu::BluetoothEmu(u32 device_id, const std::string& device_name) if (!Core::g_want_determinism) BackUpBTInfoSection(&sysconf); - // Activate only first Wii Remote by default - _conf_pads BT_DINF; if (!sysconf.GetArrayData("BT.DINF", (u8*)&BT_DINF, sizeof(_conf_pads))) { @@ -78,7 +76,7 @@ BluetoothEmu::BluetoothEmu(u32 device_id, const std::string& device_name) DEBUG_LOG(IOS_WIIMOTE, "Wii Remote %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.emplace_back(this, i, tmpBD, false); + m_WiiMotes.emplace_back(this, i, tmpBD, g_wiimote_sources[i] != WIIMOTE_SRC_NONE); i++; }