diff --git a/CMakeLists.txt b/CMakeLists.txt index b136f4e..f755188 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,6 @@ if(NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")) #Just avoid using it, when possible... set(USE_FTD3XX_FOR_N3DSXL_LOOPY 0) endif() -set(FTDI_EEPROM OFF) set(WINDOWS_ARM64 0) set(WINDOWS_x86_32 0) set(FETCHCONTENT_UPDATES_DISCONNECTED ON) diff --git a/include/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_general.hpp b/include/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_general.hpp index 53e5b28..4592a4f 100644 --- a/include/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_general.hpp +++ b/include/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_general.hpp @@ -39,6 +39,7 @@ struct FTD2CaptureReceivedData { ftd2_async_callback_data cb_data; }; +void insert_device_ftd2_shared(std::vector &devices_list, char* description, int debug_multiplier, std::string serial_number, void* descriptor, std::string path, std::string extra_particle); int get_num_ftd2_device_types(); const std::string get_ftd2_fw_desc(int index); const int get_ftd2_fw_index(int index); diff --git a/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_driver_acquisition.cpp b/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_driver_acquisition.cpp index afc4340..a36b82b 100644 --- a/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_driver_acquisition.cpp +++ b/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_driver_acquisition.cpp @@ -1,6 +1,7 @@ #include "dscapture_ftd2_driver_acquisition.hpp" #include "devicecapture.hpp" #include "usb_generic.hpp" +#include "dscapture_ftd2_shared.hpp" #include "dscapture_ftd2_general.hpp" #include "dscapture_ftd2_compatibility.hpp" diff --git a/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_driver_comms.cpp b/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_driver_comms.cpp index 4596f63..72ddb5d 100644 --- a/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_driver_comms.cpp +++ b/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_driver_comms.cpp @@ -18,8 +18,6 @@ #define REAL_SERIAL_NUMBER_SIZE 16 #define SERIAL_NUMBER_SIZE (REAL_SERIAL_NUMBER_SIZE+1) -#define ENABLE_AUDIO true - void list_devices_ftd2_driver(std::vector &devices_list, std::vector &no_access_list) { FT_STATUS ftStatus; DWORD numDevs = 0; @@ -39,15 +37,7 @@ void list_devices_ftd2_driver(std::vector &devices_list, std::vec ftStatus = FT_GetDeviceInfoDetail(i, &Flags, &Type, &ID, NULL, SerialNumber, Description, &ftHandle); if((!FT_FAILED(ftStatus)) && (Flags & FT_FLAGS_HISPEED) && (Type == FT_DEVICE_232H)) - { - for(int j = 0; j < get_num_ftd2_device_types(); j++) { - if(Description == get_ftd2_fw_desc(j)) { - for(int u = 0; u < debug_multiplier; u++) - devices_list.emplace_back(std::string(SerialNumber), "DS.2", "DS.2.d565", CAPTURE_CONN_FTD2, (void*)NULL, false, false, ENABLE_AUDIO, WIDTH_DS, HEIGHT_DS + HEIGHT_DS, get_max_samples(false), 0, 0, 0, 0, HEIGHT_DS, VIDEO_DATA_RGB16, get_ftd2_fw_index(j), false); - break; - } - } - } + insert_device_ftd2_shared(devices_list, Description, debug_multiplier, std::string(SerialNumber), NULL, "", "d"); } } } diff --git a/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_libusb_comms.cpp b/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_libusb_comms.cpp index 789a623..7f878f3 100644 --- a/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_libusb_comms.cpp +++ b/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_libusb_comms.cpp @@ -13,8 +13,6 @@ #define DESCRIPTION_SIZE 128 #define SERIAL_NUMBER_SIZE 128 -#define ENABLE_AUDIO true - #define FTDI_VID 0x0403 #define FT232H_PID 0x6014 @@ -158,13 +156,7 @@ void list_devices_ftd2_libusb(std::vector &devices_list, std::vec } if(is_already_inserted && (!insert_anyway)) continue; - for(int j = 0; j < get_num_ftd2_device_types(); j++) { - if(description == get_ftd2_fw_desc(j)) { - for(int u = 0; u < debug_multiplier; u++) - devices_list.emplace_back(serial_number, "DS.2", "DS.2.l565", CAPTURE_CONN_FTD2, (void*)curr_descriptor, false, false, ENABLE_AUDIO, WIDTH_DS, HEIGHT_DS + HEIGHT_DS, get_max_samples(false), 0, 0, 0, 0, HEIGHT_DS, VIDEO_DATA_RGB16, get_ftd2_fw_index(j), false, std::string(description)); - break; - } - } + insert_device_ftd2_shared(devices_list, description, debug_multiplier, serial_number, (void*)curr_descriptor, std::string(description), "l"); } if(perm_error) no_access_list.emplace_back("ftd2_libusb"); diff --git a/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_shared.cpp b/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_shared.cpp index 9607070..1e66a14 100644 --- a/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_shared.cpp +++ b/source/CaptureDeviceSpecific/DSCapture_FTD2/dscapture_ftd2_shared.cpp @@ -26,6 +26,8 @@ #define TX_SPI_SIZE (1 << 16) #define TX_SPI_OFFSET 3 +#define ENABLE_AUDIO true + const uint8_t* ftd2_ds2_fws[] = { ftd2_ds2_fw_1, ftd2_ds2_fw_2, @@ -57,6 +59,16 @@ const int get_ftd2_fw_index(int index) { return descriptions_firmware_ids[index]; } +void insert_device_ftd2_shared(std::vector &devices_list, char* description, int debug_multiplier, std::string serial_number, void* descriptor, std::string path, std::string extra_particle) { + for(int j = 0; j < get_num_ftd2_device_types(); j++) { + if(description == get_ftd2_fw_desc(j)) { + for(int u = 0; u < debug_multiplier; u++) + devices_list.emplace_back(serial_number, "DS.2", "DS.2." + extra_particle + "565", CAPTURE_CONN_FTD2, descriptor, false, false, ENABLE_AUDIO, WIDTH_DS, HEIGHT_DS + HEIGHT_DS, get_max_samples(false), 0, 0, 0, 0, HEIGHT_DS, VIDEO_DATA_RGB16, get_ftd2_fw_index(j), false, path); + break; + } + } +} + void list_devices_ftd2_shared(std::vector &devices_list, std::vector &no_access_list) { list_devices_ftd2_compatibility(devices_list, no_access_list); }