From 2b60fe684c4ed0966c2052ef17321f242e9b6290 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 20 Jun 2018 15:10:01 -0400 Subject: [PATCH] BTEmu: Make m_WiiMotes private We can already utilize the public interface to access the necessary instance without exposing a private data member. --- Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h | 3 ++- Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h index f695cfb4a1..03a5544b09 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h @@ -57,13 +57,14 @@ public: bool RemoteDisconnect(u16 _connectionHandle); - std::vector m_WiiMotes; WiimoteDevice* AccessWiiMote(const bdaddr_t& _rAddr); WiimoteDevice* AccessWiiMote(u16 _ConnectionHandle); void DoState(PointerWrap& p) override; private: + std::vector m_WiiMotes; + bdaddr_t m_ControllerBD{{0x11, 0x02, 0x19, 0x79, 0x00, 0xff}}; // this is used to trigger connecting via ACL diff --git a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp index c47636e31c..cb4b69b59c 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp @@ -915,7 +915,7 @@ void WiimoteDevice::ReceiveL2capData(u16 scid, const void* data, u32 size) namespace Core { /* This is called continuously from the Wiimote plugin as soon as it has received - a reporting mode. _Size is the byte size of the report. */ + a reporting mode. size is the byte size of the report. */ void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const void* opaque_data, u32 size) { const u8* data = (const u8*)opaque_data; @@ -928,6 +928,6 @@ void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const void* op const auto bt = std::static_pointer_cast( IOS::HLE::GetIOS()->GetDeviceByName("/dev/usb/oh1/57e/305")); if (bt) - bt->m_WiiMotes[number].ReceiveL2capData(channel_id, opaque_data, size); + bt->AccessWiiMote(0x100 + number)->ReceiveL2capData(channel_id, opaque_data, size); } }