mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
WiiUtils: Add helper functions to get emulated/real Bluetooth device
This adds a function to get the emulated or real Bluetooth device for an active emulation instance. This lets us deduplicate all the `ios->GetDeviceByName("/dev/usb/oh1/57e/305")` calls that are currently scattered in the codebase and ensures Bluetooth passthrough is being handled correctly. This also fixes the broken check in WiimoteCommon::UpdateSource. There was a confusion between "emulated Bluetooth" (as opposed to "real Bluetooth" aka Bluetooth passthrough) and "emulated Wiimote".
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Core/IOS/ES/Formats.h"
|
||||
#include "Core/IOS/USB/Bluetooth/BTReal.h"
|
||||
|
||||
// Small utility functions for common Wii related tasks.
|
||||
|
||||
@ -22,6 +23,7 @@ class VolumeWAD;
|
||||
|
||||
namespace IOS::HLE
|
||||
{
|
||||
class BluetoothEmuDevice;
|
||||
class ESDevice;
|
||||
class Kernel;
|
||||
} // namespace IOS::HLE
|
||||
@ -101,4 +103,11 @@ struct NANDCheckResult
|
||||
};
|
||||
NANDCheckResult CheckNAND(IOS::HLE::Kernel& ios);
|
||||
bool RepairNAND(IOS::HLE::Kernel& ios);
|
||||
|
||||
// Get the BluetoothEmuDevice for an active emulation instance.
|
||||
// It is only safe to call this from the CPU thread.
|
||||
// Returns nullptr if we're not currently emulating a Wii game or if Bluetooth passthrough is used.
|
||||
std::shared_ptr<IOS::HLE::BluetoothEmuDevice> GetBluetoothEmuDevice();
|
||||
// Same as GetBluetoothEmuDevice, but for Bluetooth passthrough.
|
||||
std::shared_ptr<IOS::HLE::BluetoothRealDevice> GetBluetoothRealDevice();
|
||||
} // namespace WiiUtils
|
||||
|
Reference in New Issue
Block a user