diff --git a/Source/Core/Core/HW/Wiimote.cpp b/Source/Core/Core/HW/Wiimote.cpp index 726f08b4c106..190d0a2a9e29 100644 --- a/Source/Core/Core/HW/Wiimote.cpp +++ b/Source/Core/Core/HW/Wiimote.cpp @@ -104,7 +104,7 @@ void Connect(unsigned int index, bool connect) ios->GetDeviceByName("/dev/usb/oh1/57e/305")); if (bluetooth) - bluetooth->AccessWiiMoteByIndex(index)->Activate(connect); + bluetooth->AccessWiimoteByIndex(index)->Activate(connect); const char* message = connect ? "Wii Remote %u connected" : "Wii Remote %u disconnected"; Core::DisplayMessage(StringFromFormat(message, index + 1), 3000); diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp index 40827b9dfc35..ba79a1e7ed6e 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp @@ -215,7 +215,7 @@ IPCCommandResult BluetoothEmu::IOCtlV(const IOCtlVRequest& request) // Here we handle the USB::IOCTLV_USBV0_BLKMSG Ioctlv void BluetoothEmu::SendToDevice(u16 connection_handle, u8* data, u32 size) { - WiimoteDevice* wiimote = AccessWiiMote(connection_handle); + WiimoteDevice* wiimote = AccessWiimote(connection_handle); if (wiimote == nullptr) return; @@ -482,7 +482,7 @@ bool BluetoothEmu::SendEventInquiryResponse() bool BluetoothEmu::SendEventConnectionComplete(const bdaddr_t& bd) { - WiimoteDevice* wiimote = AccessWiiMote(bd); + WiimoteDevice* wiimote = AccessWiimote(bd); if (wiimote == nullptr) return false; @@ -500,7 +500,7 @@ bool BluetoothEmu::SendEventConnectionComplete(const bdaddr_t& bd) AddEventToQueue(event); - WiimoteDevice* connection_wiimote = AccessWiiMote(connection_complete->Connection_Handle); + WiimoteDevice* connection_wiimote = AccessWiimote(connection_complete->Connection_Handle); if (connection_wiimote) connection_wiimote->EventConnectionAccepted(); @@ -560,7 +560,7 @@ bool BluetoothEmu::SendEventRequestConnection(const WiimoteDevice& wiimote) bool BluetoothEmu::SendEventDisconnect(u16 connection_handle, u8 reason) { - WiimoteDevice* wiimote = AccessWiiMote(connection_handle); + WiimoteDevice* wiimote = AccessWiimote(connection_handle); if (wiimote == nullptr) return false; @@ -584,7 +584,7 @@ bool BluetoothEmu::SendEventDisconnect(u16 connection_handle, u8 reason) bool BluetoothEmu::SendEventAuthenticationCompleted(u16 connection_handle) { - WiimoteDevice* wiimote = AccessWiiMote(connection_handle); + WiimoteDevice* wiimote = AccessWiimote(connection_handle); if (wiimote == nullptr) return false; @@ -608,7 +608,7 @@ bool BluetoothEmu::SendEventAuthenticationCompleted(u16 connection_handle) bool BluetoothEmu::SendEventRemoteNameReq(const bdaddr_t& bd) { - WiimoteDevice* wiimote = AccessWiiMote(bd); + WiimoteDevice* wiimote = AccessWiimote(bd); if (wiimote == nullptr) return false; @@ -635,7 +635,7 @@ bool BluetoothEmu::SendEventRemoteNameReq(const bdaddr_t& bd) bool BluetoothEmu::SendEventReadRemoteFeatures(u16 connection_handle) { - WiimoteDevice* wiimote = AccessWiiMote(connection_handle); + WiimoteDevice* wiimote = AccessWiimote(connection_handle); if (wiimote == nullptr) return false; @@ -671,7 +671,7 @@ bool BluetoothEmu::SendEventReadRemoteFeatures(u16 connection_handle) bool BluetoothEmu::SendEventReadRemoteVerInfo(u16 connection_handle) { - WiimoteDevice* wiimote = AccessWiiMote(connection_handle); + WiimoteDevice* wiimote = AccessWiimote(connection_handle); if (wiimote == nullptr) return false; @@ -741,7 +741,7 @@ bool BluetoothEmu::SendEventCommandStatus(u16 opcode) bool BluetoothEmu::SendEventRoleChange(bdaddr_t bd, bool master) { - WiimoteDevice* wiimote = AccessWiiMote(bd); + WiimoteDevice* wiimote = AccessWiimote(bd); if (wiimote == nullptr) return false; @@ -813,7 +813,7 @@ bool BluetoothEmu::SendEventNumberOfCompletedPackets() bool BluetoothEmu::SendEventModeChange(u16 connection_handle, u8 mode, u16 value) { - WiimoteDevice* wiimote = AccessWiiMote(connection_handle); + WiimoteDevice* wiimote = AccessWiimote(connection_handle); if (wiimote == nullptr) return false; @@ -892,7 +892,7 @@ bool BluetoothEmu::SendEventRequestLinkKey(const bdaddr_t& bd) bool BluetoothEmu::SendEventReadClockOffsetComplete(u16 connection_handle) { - WiimoteDevice* wiimote = AccessWiiMote(connection_handle); + WiimoteDevice* wiimote = AccessWiimote(connection_handle); if (wiimote == nullptr) return false; @@ -918,7 +918,7 @@ bool BluetoothEmu::SendEventReadClockOffsetComplete(u16 connection_handle) bool BluetoothEmu::SendEventConPacketTypeChange(u16 connection_handle, u16 packet_type) { - WiimoteDevice* wiimote = AccessWiiMote(connection_handle); + WiimoteDevice* wiimote = AccessWiimote(connection_handle); if (wiimote == nullptr) return false; @@ -1192,7 +1192,7 @@ void BluetoothEmu::CommandDisconnect(const u8* input) SendEventCommandStatus(HCI_CMD_DISCONNECT); SendEventDisconnect(disconnect->con_handle, disconnect->reason); - WiimoteDevice* wiimote = AccessWiiMote(disconnect->con_handle); + WiimoteDevice* wiimote = AccessWiimote(disconnect->con_handle); if (wiimote) wiimote->EventDisconnect(); } @@ -1449,7 +1449,7 @@ void BluetoothEmu::CommandDeleteStoredLinkKey(const u8* input) delete_stored_link_key->bdaddr[5]); DEBUG_LOG(IOS_WIIMOTE, " delete_all: 0x%01x", delete_stored_link_key->delete_all); - WiimoteDevice* wiimote = AccessWiiMote(delete_stored_link_key->bdaddr); + WiimoteDevice* wiimote = AccessWiimote(delete_stored_link_key->bdaddr); if (wiimote == nullptr) return; @@ -1739,13 +1739,13 @@ void BluetoothEmu::CommandVendorSpecific_FC4C(const u8* input, u32 size) // --- helper // // -WiimoteDevice* BluetoothEmu::AccessWiiMoteByIndex(std::size_t index) +WiimoteDevice* BluetoothEmu::AccessWiimoteByIndex(std::size_t index) { const u16 connection_handle = static_cast(0x100 + index); - return AccessWiiMote(connection_handle); + return AccessWiimote(connection_handle); } -WiimoteDevice* BluetoothEmu::AccessWiiMote(const bdaddr_t& address) +WiimoteDevice* BluetoothEmu::AccessWiimote(const bdaddr_t& address) { const auto iterator = std::find_if(m_wiimotes.begin(), m_wiimotes.end(), @@ -1753,7 +1753,7 @@ WiimoteDevice* BluetoothEmu::AccessWiiMote(const bdaddr_t& address) return iterator != m_wiimotes.cend() ? &*iterator : nullptr; } -WiimoteDevice* BluetoothEmu::AccessWiiMote(u16 connection_handle) +WiimoteDevice* BluetoothEmu::AccessWiimote(u16 connection_handle) { for (auto& wiimote : m_wiimotes) { diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h index 71313e9d6d75..f882eb229951 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.h @@ -56,7 +56,7 @@ class BluetoothEmu final : public BluetoothBase bool RemoteDisconnect(u16 connection_handle); - WiimoteDevice* AccessWiiMoteByIndex(std::size_t index); + WiimoteDevice* AccessWiimoteByIndex(std::size_t index); void DoState(PointerWrap& p) override; @@ -100,8 +100,8 @@ class BluetoothEmu final : public BluetoothBase u32 m_packet_count[MAX_BBMOTES] = {}; u64 m_last_ticks = 0; - WiimoteDevice* AccessWiiMote(const bdaddr_t& address); - WiimoteDevice* AccessWiiMote(u16 connection_handle); + WiimoteDevice* AccessWiimote(const bdaddr_t& address); + WiimoteDevice* AccessWiimote(u16 connection_handle); // Send ACL data to a device (wiimote) void IncDataPacket(u16 connection_handle); diff --git a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp index 4f95f956b295..cfce4d595950 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp @@ -926,6 +926,6 @@ void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const u8* data const auto bt = std::static_pointer_cast( IOS::HLE::GetIOS()->GetDeviceByName("/dev/usb/oh1/57e/305")); if (bt) - bt->AccessWiiMoteByIndex(number)->ReceiveL2capData(channel_id, data, size); + bt->AccessWiimoteByIndex(number)->ReceiveL2capData(channel_id, data, size); } } diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index 0807a6e65179..136b98ba80ff 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -470,7 +470,7 @@ void ChangeWiiPads(bool instantly) g_wiimote_sources[i] = is_using_wiimote ? WIIMOTE_SRC_EMU : WIIMOTE_SRC_NONE; if (!SConfig::GetInstance().m_bt_passthrough_enabled && bt) - bt->AccessWiiMoteByIndex(i)->Activate(is_using_wiimote); + bt->AccessWiimoteByIndex(i)->Activate(is_using_wiimote); } } diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index 389040ae0120..fabe0c0f349b 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -1401,7 +1401,7 @@ void MainWindow::OnConnectWiiRemote(int id) Core::RunAsCPUThread([&] { const auto bt = std::static_pointer_cast( ios->GetDeviceByName("/dev/usb/oh1/57e/305")); - const bool is_connected = bt && bt->AccessWiiMoteByIndex(id)->IsConnected(); + const bool is_connected = bt && bt->AccessWiimoteByIndex(id)->IsConnected(); Wiimote::Connect(id, !is_connected); }); } diff --git a/Source/Core/DolphinQt2/MenuBar.cpp b/Source/Core/DolphinQt2/MenuBar.cpp index cb146638961e..fb94d96d2532 100644 --- a/Source/Core/DolphinQt2/MenuBar.cpp +++ b/Source/Core/DolphinQt2/MenuBar.cpp @@ -923,7 +923,7 @@ void MenuBar::UpdateToolsMenu(bool emulation_started) wii_remote->setEnabled(enable_wiimotes); if (enable_wiimotes) - wii_remote->setChecked(bt->AccessWiiMoteByIndex(i)->IsConnected()); + wii_remote->setChecked(bt->AccessWiimoteByIndex(i)->IsConnected()); } } diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 2448fb279df3..d1f8c5ff1d16 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -1539,7 +1539,7 @@ void CFrame::OnConnectWiimote(wxCommandEvent& event) const auto bt = std::static_pointer_cast( ios->GetDeviceByName("/dev/usb/oh1/57e/305")); const unsigned int wiimote_index = event.GetId() - IDM_CONNECT_WIIMOTE1; - const bool is_connected = bt && bt->AccessWiiMoteByIndex(wiimote_index)->IsConnected(); + const bool is_connected = bt && bt->AccessWiimoteByIndex(wiimote_index)->IsConnected(); Wiimote::Connect(wiimote_index, !is_connected); }); } @@ -1715,11 +1715,11 @@ void CFrame::UpdateGUI() if (should_enable_wiimotes) { Core::RunAsCPUThread([&] { - wiimote_1->Check(bt->AccessWiiMoteByIndex(0)->IsConnected()); - wiimote_2->Check(bt->AccessWiiMoteByIndex(1)->IsConnected()); - wiimote_3->Check(bt->AccessWiiMoteByIndex(2)->IsConnected()); - wiimote_4->Check(bt->AccessWiiMoteByIndex(3)->IsConnected()); - balance_board->Check(bt->AccessWiiMoteByIndex(4)->IsConnected()); + wiimote_1->Check(bt->AccessWiimoteByIndex(0)->IsConnected()); + wiimote_2->Check(bt->AccessWiimoteByIndex(1)->IsConnected()); + wiimote_3->Check(bt->AccessWiimoteByIndex(2)->IsConnected()); + wiimote_4->Check(bt->AccessWiimoteByIndex(3)->IsConnected()); + balance_board->Check(bt->AccessWiimoteByIndex(4)->IsConnected()); }); }