From 73e55ccf4472db8c85255dd97ebb3c7596d5201f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 13 Nov 2016 14:16:13 +0100 Subject: [PATCH] IOS: Add base Host and USB::Device classes The Host class will be used by the OH0, VEN and HID implementations as the base class for the IOS HLE device. It handles scanning devices, detecting device changes and everything that will be needed for OH0, VEN and HID to be implemented, while mostly abstracting libusb away. The Device class is for actual USB devices. This commit adds a LibusbDevice which interacts with a real USB device and enables USB passthrough. --- Source/Core/Core/CMakeLists.txt | 4 +- Source/Core/Core/Core.vcxproj | 8 + Source/Core/Core/Core.vcxproj.filters | 12 + Source/Core/Core/IOS/USB/Common.cpp | 122 +++++- Source/Core/Core/IOS/USB/Common.h | 68 ++++ Source/Core/Core/IOS/USB/Host.cpp | 251 +++++++++++++ Source/Core/Core/IOS/USB/Host.h | 85 +++++ Source/Core/Core/IOS/USB/LibusbDevice.cpp | 437 ++++++++++++++++++++++ Source/Core/Core/IOS/USB/LibusbDevice.h | 94 +++++ 9 files changed, 1079 insertions(+), 2 deletions(-) create mode 100644 Source/Core/Core/IOS/USB/Host.cpp create mode 100644 Source/Core/Core/IOS/USB/Host.h create mode 100644 Source/Core/Core/IOS/USB/LibusbDevice.cpp create mode 100644 Source/Core/Core/IOS/USB/LibusbDevice.h diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index ed0cecdcc5..5d95be79fc 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -154,6 +154,7 @@ set(SRCS ActionReplay.cpp IOS/SDIO/SDIOSlot0.cpp IOS/STM/STM.cpp IOS/USB/Common.cpp + IOS/USB/Host.cpp IOS/USB/USBV0.cpp IOS/USB/USB_KBD.cpp IOS/USB/USB_VEN.cpp @@ -264,7 +265,8 @@ set(LIBS if(LIBUSB_FOUND) # Using shared LibUSB set(LIBS ${LIBS} ${LIBUSB_LIBRARIES}) - set(SRCS ${SRCS} IOS/USB/USB_HIDv4.cpp + set(SRCS ${SRCS} IOS/USB/LibusbDevice.cpp + IOS/USB/USB_HIDv4.cpp IOS/USB/Bluetooth/BTReal.cpp) endif() diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj index 42496fe3e0..4cb3db2b4d 100644 --- a/Source/Core/Core/Core.vcxproj +++ b/Source/Core/Core/Core.vcxproj @@ -186,6 +186,12 @@ + + 4200;%(DisableSpecificWarnings) + + + 4200;%(DisableSpecificWarnings) +