diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt
index 5250837e6f..8d62fc0668 100644
--- a/Source/Core/Core/CMakeLists.txt
+++ b/Source/Core/Core/CMakeLists.txt
@@ -145,7 +145,9 @@ set(SRCS ActionReplay.cpp
IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp
IPC_HLE/WII_IPC_HLE_Device_stm.cpp
IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp
- IPC_HLE/WII_IPC_HLE_Device_usb.cpp
+ IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.cpp
+ IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.cpp
+ IPC_HLE/WII_IPC_HLE_Device_usb_bt_stub.cpp
IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp
IPC_HLE/WII_IPC_HLE_Device_usb_ven.cpp
IPC_HLE/WII_IPC_HLE_WiiMote.cpp
@@ -243,7 +245,8 @@ set(LIBS
if(LIBUSB_FOUND)
# Using shared LibUSB
set(LIBS ${LIBS} ${LIBUSB_LIBRARIES})
- set(SRCS ${SRCS} IPC_HLE/WII_IPC_HLE_Device_hid.cpp)
+ set(SRCS ${SRCS} IPC_HLE/WII_IPC_HLE_Device_hid.cpp
+ IPC_HLE/WII_IPC_HLE_Device_usb_bt_real.cpp)
endif(LIBUSB_FOUND)
set(LIBS ${LIBS} ${MBEDTLS_LIBRARIES})
diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp
index ec198b2837..6e896658ef 100644
--- a/Source/Core/Core/ConfigManager.cpp
+++ b/Source/Core/Core/ConfigManager.cpp
@@ -67,6 +67,7 @@ void SConfig::SaveSettings()
SaveFifoPlayerSettings(ini);
SaveAnalyticsSettings(ini);
SaveNetworkSettings(ini);
+ SaveBluetoothPassthroughSettings(ini);
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
m_SYSCONF->Save();
@@ -322,6 +323,15 @@ void SConfig::SaveAnalyticsSettings(IniFile& ini)
analytics->Set("PermissionAsked", m_analytics_permission_asked);
}
+void SConfig::SaveBluetoothPassthroughSettings(IniFile& ini)
+{
+ IniFile::Section* section = ini.GetOrCreateSection("BluetoothPassthrough");
+
+ section->Set("Enabled", m_bt_passthrough_enabled);
+ section->Set("VID", m_bt_passthrough_vid);
+ section->Set("PID", m_bt_passthrough_pid);
+}
+
void SConfig::LoadSettings()
{
INFO_LOG(BOOT, "Loading Settings from %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
@@ -339,6 +349,7 @@ void SConfig::LoadSettings()
LoadFifoPlayerSettings(ini);
LoadNetworkSettings(ini);
LoadAnalyticsSettings(ini);
+ LoadBluetoothPassthroughSettings(ini);
m_SYSCONF = new SysConf();
}
@@ -604,6 +615,15 @@ void SConfig::LoadAnalyticsSettings(IniFile& ini)
analytics->Get("PermissionAsked", &m_analytics_permission_asked, false);
}
+void SConfig::LoadBluetoothPassthroughSettings(IniFile& ini)
+{
+ IniFile::Section* section = ini.GetOrCreateSection("BluetoothPassthrough");
+
+ section->Get("Enabled", &m_bt_passthrough_enabled, false);
+ section->Get("VID", &m_bt_passthrough_vid, -1);
+ section->Get("PID", &m_bt_passthrough_pid, -1);
+}
+
void SConfig::LoadDefaults()
{
bEnableDebugging = false;
diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h
index 001417cb1c..2bb649fcbc 100644
--- a/Source/Core/Core/ConfigManager.h
+++ b/Source/Core/Core/ConfigManager.h
@@ -143,6 +143,11 @@ struct SConfig : NonCopyable
bool m_analytics_enabled = false;
bool m_analytics_permission_asked = false;
+ // Bluetooth passthrough mode settings
+ bool m_bt_passthrough_enabled = false;
+ int m_bt_passthrough_pid = -1;
+ int m_bt_passthrough_vid = -1;
+
// Fifo Player related settings
bool bLoopFifoReplay = true;
@@ -325,6 +330,7 @@ private:
void SaveFifoPlayerSettings(IniFile& ini);
void SaveNetworkSettings(IniFile& ini);
void SaveAnalyticsSettings(IniFile& ini);
+ void SaveBluetoothPassthroughSettings(IniFile& ini);
void LoadGeneralSettings(IniFile& ini);
void LoadInterfaceSettings(IniFile& ini);
@@ -337,6 +343,7 @@ private:
void LoadFifoPlayerSettings(IniFile& ini);
void LoadNetworkSettings(IniFile& ini);
void LoadAnalyticsSettings(IniFile& ini);
+ void LoadBluetoothPassthroughSettings(IniFile& ini);
static SConfig* m_Instance;
};
diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp
index b8cd1e2733..071302e17f 100644
--- a/Source/Core/Core/Core.cpp
+++ b/Source/Core/Core/Core.cpp
@@ -52,7 +52,7 @@
#include "Core/HW/SystemTimers.h"
#include "Core/HW/VideoInterface.h"
#include "Core/HW/Wiimote.h"
-#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb.h"
+#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_emu.h"
#include "Core/IPC_HLE/WII_IPC_HLE_WiiMote.h"
#include "Core/IPC_HLE/WII_Socket.h"
#include "Core/Movie.h"
@@ -528,7 +528,7 @@ void EmuThread()
}
// Load and Init Wiimotes - only if we are booting in Wii mode
- if (core_parameter.bWii)
+ if (core_parameter.bWii && !SConfig::GetInstance().m_bt_passthrough_enabled)
{
if (init_controllers)
Wiimote::Initialize(s_window_handle, !s_state_filename.empty() ?
diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj
index f0a54a74f3..62f953c2fe 100644
--- a/Source/Core/Core/Core.vcxproj
+++ b/Source/Core/Core/Core.vcxproj
@@ -185,7 +185,12 @@
-
+
+
+
+ 4200;%(DisableSpecificWarnings)
+
+
@@ -389,7 +394,10 @@
-
+
+
+
+
diff --git a/Source/Core/Core/Core.vcxproj.filters b/Source/Core/Core/Core.vcxproj.filters
index 082b302901..5479aee662 100644
--- a/Source/Core/Core/Core.vcxproj.filters
+++ b/Source/Core/Core/Core.vcxproj.filters
@@ -591,7 +591,16 @@
IPC HLE %28IOS/Starlet%29\USB
-
+
+ IPC HLE %28IOS/Starlet%29\USB/BT/Wiimote
+
+
+ IPC HLE %28IOS/Starlet%29\USB/BT/Wiimote
+
+
+ IPC HLE %28IOS/Starlet%29\USB/BT/Wiimote
+
+
IPC HLE %28IOS/Starlet%29\USB/BT/Wiimote
@@ -1148,7 +1157,16 @@
IPC HLE %28IOS/Starlet%29\USB
-
+
+ IPC HLE %28IOS/Starlet%29\USB/BT/Wiimote
+
+
+ IPC HLE %28IOS/Starlet%29\USB/BT/Wiimote
+
+
+ IPC HLE %28IOS/Starlet%29\USB/BT/Wiimote
+
+
IPC HLE %28IOS/Starlet%29\USB/BT/Wiimote
diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
index e455047a66..1e780d5c56 100644
--- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
+++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp
@@ -702,7 +702,8 @@ void Initialize(::Wiimote::InitializeMode init_mode)
g_wiimote_scanner.StartThread();
}
- if (SConfig::GetInstance().m_WiimoteContinuousScanning)
+ if (SConfig::GetInstance().m_WiimoteContinuousScanning &&
+ !SConfig::GetInstance().m_bt_passthrough_enabled)
g_wiimote_scanner.SetScanMode(WiimoteScanMode::CONTINUOUSLY_SCAN);
else
g_wiimote_scanner.SetScanMode(WiimoteScanMode::DO_NOT_SCAN);
diff --git a/Source/Core/Core/HotkeyManager.cpp b/Source/Core/Core/HotkeyManager.cpp
index 8e757384ab..a97c87ae25 100644
--- a/Source/Core/Core/HotkeyManager.cpp
+++ b/Source/Core/Core/HotkeyManager.cpp
@@ -32,6 +32,7 @@ const std::string hotkey_labels[] = {
_trans("Take Screenshot"),
_trans("Exit"),
+ _trans("Press Sync Button"),
_trans("Connect Wiimote 1"),
_trans("Connect Wiimote 2"),
_trans("Connect Wiimote 3"),
diff --git a/Source/Core/Core/HotkeyManager.h b/Source/Core/Core/HotkeyManager.h
index b8934dd79d..45dfc6474f 100644
--- a/Source/Core/Core/HotkeyManager.h
+++ b/Source/Core/Core/HotkeyManager.h
@@ -31,6 +31,7 @@ enum Hotkey
HK_SCREENSHOT,
HK_EXIT,
+ HK_TRIGGER_SYNC_BUTTON,
HK_WIIMOTE1_CONNECT,
HK_WIIMOTE2_CONNECT,
HK_WIIMOTE3_CONNECT,
diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp
index e52273f673..2cd0c130ac 100644
--- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp
+++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.cpp
@@ -22,6 +22,7 @@ They will also generate a true or false return for UpdateInterrupts() in WII_IPC
#include
#include