mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-03-21 17:55:00 -05:00
Fix locking up while reconnecting - Version bump
Some checks failed
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 Win32 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 x64 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 ARM os:windows-2022]) (push) Has been cancelled
CD / Create Pi Mono Setup (push) Has been cancelled
CD / Publishing (push) Has been cancelled
Some checks failed
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 Win32 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 x64 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 ARM os:windows-2022]) (push) Has been cancelled
CD / Create Pi Mono Setup (push) Has been cancelled
CD / Publishing (push) Has been cancelled
This commit is contained in:
parent
dc21e1babe
commit
b93c1507aa
10
README.md
10
README.md
|
|
@ -5,7 +5,9 @@ The main goal is to offer the ability to use the Capture Card with a TV, via ful
|
|||
|
||||
IS Nitro Emulator (newer revisions), IS Nitro Capture and IS TWL Capture support is also present. Though results may vary (and the amount of video delay may be significantly higher based on the cable used).
|
||||
|
||||
Support for a really old Optimize board is also present, used with Nisetro DS capture boards.
|
||||
Optimize Old 3DS capture boards and Optimize New 3DS capture boards are also supported. Older revisions of the capture boards may not be supported at the moment, though.
|
||||
|
||||
Finally, support for a really old Chameleon USB FX2 board is also present, used with Nisetro DS(i) capture boards.
|
||||
|
||||
## Features
|
||||
|
||||
|
|
@ -153,10 +155,10 @@ The CC3DSFS\_CFG\_DIR environment variable can be used to specify a different ta
|
|||
- Certain TVs/Monitors may add some audio delay for the purpose of video/lip syncing. If you're experiencing too much audio delay when using this software, try checking in the TV/Monitor settings whether you can reduce that added delay. One of the names used for that setting is "Lip Sync", or something along that line.
|
||||
- When using IS Nitro Emulator, IS Nitro Capture or IS TWL Capture devices on Windows, cc3dsfs is compatible with both the official driver and WinUSB, with the latter being useful if you don't have access to the official driver. To install and use WinUSB, plug in your device, download a software to install drivers like [Zadig](https://zadig.akeo.ie/), select the device in question and select WinUSB. Then install the driver and wait for it to finish. The devices should now work properly with this application.
|
||||
- When using the new 2024 Loopy DS Capture Card on Windows, the default driver (FTD2XX) adds one extra frame of latency. To remove that, consider switching to WinUSB as the driver. To change driver, download a software to install drivers like [Zadig](https://zadig.akeo.ie/), select the device in question and select WinUSB. Then install the driver and wait for it to finish. The application will now use WinUSB, with better latency (the serial shown in the Status menu will have an l where there previously was a d).
|
||||
- There are multiple capture cards which use the same EZ-USB FX2LP board, creating a conflict. This means that when the user connects a device which uses the EZ-USB FX2LP board, they need to select one capture card among the possible ones. To avoid this extra step, the user can disable scanning for the conflicting capture cards they do not intend to use. The settings to do this are available under Extra Settings -> USB Conflict Resolution.
|
||||
- There are multiple capture cards which use the same EZ-USB FX2LP board, creating a conflict. These are the Optimize Old 3DS capture cards and the Nisetro DS(i) capture cards. This means that when the user connects a device which uses the EZ-USB FX2LP board, they need to select one capture card among the possible ones. To avoid this extra step, the user can disable scanning for the conflicting capture cards they do not intend to use. The settings to do this are available under Extra Settings -> USB Conflict Resolution.
|
||||
- MacOS does not allow running multiple instances of the same application, normally. If you want to run multiple instances of cc3dsfs on MacOS, open the terminal in the folder where cc3dsfs is and type `open -n cc3dsfs.app`.
|
||||
- To properly use the Optimize capture cards with cc3dsfs, a serial key is needed. This can be added via the _Optimize 3DS Settings_, under the _Add New Serial Key_ option. You can use CTRL+V in the textbox to copy the serial key, or insert it manually. To obtain the key, get your device ID (it can be copied from the _Optimize 3DS Settings_ menu) and type it in the [Official site](https://optimize.ath.cx/productkey_en.html). Using a keyboard to do this is suggested (but not required).
|
||||
- Keys are saved under the keys folder inside the cc3dsfs config folder.
|
||||
- To reset to the default settings, besides the options shown in [Controls](#Controls), you can find the _Reset Settings_ option inside of the _Extra Settings_.
|
||||
- When using an Optimize Old 3DS Capture Card or a Nisetro DS(i) Capture Card on Windows, make sure either the Cypress USB drivers are installed, or the Optimize Old 3DS drivers are installed. Alternatively, it is also possible to install WinUSB to use with the devices via software to install drivers like [Zadig](https://zadig.akeo.ie/).
|
||||
- When using an Optimize New 3DS Capture Card on Windows, make sure the Optimize New 3DS drivers are installed. Also ensure either the Cypress USB drivers are installed, or the Optimize Old 3DS drivers are installed. Alternatively, it is also possible to install WinUSB to use with the device via software to install drivers like [Zadig](https://zadig.akeo.ie/).
|
||||
- When using an Optimize Old 3DS Capture Card or a Nisetro DS(i) Capture Card on Windows, make sure either the Cypress USB drivers are installed, or the Optimize Old 3DS drivers are installed. Alternatively, it is also possible to install libusb-win32 or alternatives to use with the devices via software to install drivers like [Zadig](https://zadig.akeo.ie/).
|
||||
- When using an Optimize New 3DS Capture Card on Windows, make sure the Optimize New 3DS drivers are installed. Also ensure either the Cypress USB drivers are installed, or the Optimize Old 3DS drivers are installed. Alternatively, it is also possible to install libusb-win32 or alternatives to use with the device via software to install drivers like [Zadig](https://zadig.akeo.ie/).
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "devicecapture.hpp"
|
||||
|
||||
void list_devices_cyni_device(std::vector<CaptureDevice> &devices_list, std::vector<no_access_recap_data> &no_access_list, bool* devices_allowed_scan);
|
||||
bool cyni_device_connect_usb(bool print_failed, CaptureData* capture_data, CaptureDevice* device);
|
||||
bool cyni_device_connect_usb(bool print_failed, CaptureData* capture_data, CaptureDevice* device, void* info);
|
||||
uint64_t cyni_device_get_video_in_size(CaptureStatus* status);
|
||||
uint64_t cyni_device_get_video_in_size(CaptureData* capture_data);
|
||||
void cyni_device_acquisition_main_loop(CaptureData* capture_data);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include "devicecapture.hpp"
|
||||
|
||||
void list_devices_cyop_device(std::vector<CaptureDevice> &devices_list, std::vector<no_access_recap_data> &no_access_list, bool* devices_allowed_scan);
|
||||
bool cyop_device_connect_usb(bool print_failed, CaptureData* capture_data, CaptureDevice* device);
|
||||
bool cyop_device_connect_usb(bool print_failed, CaptureData* capture_data, CaptureDevice* device, void* info);
|
||||
uint64_t cyop_device_get_video_in_size(CaptureStatus* status, bool is_3d, bool should_be_3d, InputVideoDataType video_data_type);
|
||||
uint64_t cyop_device_get_video_in_size(CaptureData* capture_data, bool is_3d, bool should_be_3d, InputVideoDataType video_data_type);
|
||||
void cyop_device_acquisition_main_loop(CaptureData* capture_data);
|
||||
|
|
|
|||
|
|
@ -40,4 +40,7 @@ bool set_3d_enabled(CaptureStatus* capture_status, bool new_value);
|
|||
float get_framerate_multiplier(CaptureStatus* capture_status);
|
||||
KeySaveError save_cc_key(std::string key, CaptureConnectionType conn_type, bool differentiator);
|
||||
void check_device_serial_key_update(CaptureStatus* capture_status, bool differentiator, std::string key);
|
||||
void setup_reconnection_device(void* info);
|
||||
bool wait_reconnection_device(void* info);
|
||||
void end_reconnection_device(void* info);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ enum ScreenType { TOP, BOTTOM, JOINT };
|
|||
enum BottomRelativePosition { UNDER_TOP, LEFT_TOP, ABOVE_TOP, RIGHT_TOP, BOT_REL_POS_END };
|
||||
enum SecondScreen3DRelativePosition { UNDER_FIRST, LEFT_FIRST, ABOVE_FIRST, RIGHT_FIRST, SECOND_SCREEN_3D_REL_POS_END };
|
||||
enum NonIntegerScalingModes { SMALLER_PRIORITY, INVERSE_PROPORTIONAL_PRIORITY, EQUAL_PRIORITY, PROPORTIONAL_PRIORITY, BIGGER_PRIORITY, END_NONINT_SCALE_MODES };
|
||||
enum CurrMenuType { DEFAULT_MENU_TYPE, CONNECT_MENU_TYPE, MAIN_MENU_TYPE, VIDEO_MENU_TYPE, AUDIO_MENU_TYPE, CROP_MENU_TYPE, TOP_PAR_MENU_TYPE, BOTTOM_PAR_MENU_TYPE, ROTATION_MENU_TYPE, OFFSET_MENU_TYPE, BFI_MENU_TYPE, LOAD_MENU_TYPE, SAVE_MENU_TYPE, RESOLUTION_MENU_TYPE, EXTRA_MENU_TYPE, STATUS_MENU_TYPE, LICENSES_MENU_TYPE, RELATIVE_POS_MENU_TYPE, SHORTCUTS_MENU_TYPE, ACTION_SELECTION_MENU_TYPE, SCALING_RATIO_MENU_TYPE, ISN_MENU_TYPE, VIDEO_EFFECTS_MENU_TYPE, INPUT_MENU_TYPE, AUDIO_DEVICE_MENU_TYPE, SEPARATOR_MENU_TYPE, COLOR_CORRECTION_MENU_TYPE, MAIN_3D_MENU_TYPE, SECOND_SCREEN_RELATIVE_POS_MENU_TYPE, USB_CONFLICT_RESOLUTION_MENU_TYPE, OPTIMIZE_3DS_MENU_TYPE, OPTIMIZE_SERIAL_KEY_ADD_MENU_TYPE };
|
||||
enum CurrMenuType { DEFAULT_MENU_TYPE, CONNECT_MENU_TYPE, MAIN_MENU_TYPE, VIDEO_MENU_TYPE, AUDIO_MENU_TYPE, CROP_MENU_TYPE, TOP_PAR_MENU_TYPE, BOTTOM_PAR_MENU_TYPE, ROTATION_MENU_TYPE, OFFSET_MENU_TYPE, BFI_MENU_TYPE, LOAD_MENU_TYPE, SAVE_MENU_TYPE, RESOLUTION_MENU_TYPE, EXTRA_MENU_TYPE, STATUS_MENU_TYPE, LICENSES_MENU_TYPE, RELATIVE_POS_MENU_TYPE, SHORTCUTS_MENU_TYPE, ACTION_SELECTION_MENU_TYPE, SCALING_RATIO_MENU_TYPE, ISN_MENU_TYPE, VIDEO_EFFECTS_MENU_TYPE, INPUT_MENU_TYPE, AUDIO_DEVICE_MENU_TYPE, SEPARATOR_MENU_TYPE, COLOR_CORRECTION_MENU_TYPE, MAIN_3D_MENU_TYPE, SECOND_SCREEN_RELATIVE_POS_MENU_TYPE, USB_CONFLICT_RESOLUTION_MENU_TYPE, OPTIMIZE_3DS_MENU_TYPE, OPTIMIZE_SERIAL_KEY_ADD_MENU_TYPE, RECONNECT_MENU_TYPE };
|
||||
enum InputColorspaceMode { FULL_COLORSPACE, DS_COLORSPACE, GBA_COLORSPACE, INPUT_COLORSPACE_END };
|
||||
enum FrameBlendingMode { NO_FRAME_BLENDING, FULL_FRAME_BLENDING, DS_3D_BOTH_SCREENS_FRAME_BLENDING, FRAME_BLENDING_END };
|
||||
|
||||
|
|
|
|||
|
|
@ -81,8 +81,10 @@ public:
|
|||
void after_thread_join();
|
||||
void draw(double frame_time, VideoOutputData* out_buf, InputVideoDataType video_data_type);
|
||||
void setup_connection_menu(std::vector<CaptureDevice> *devices_list, bool reset_data = true);
|
||||
void setup_reconnection_menu(bool reset_data = true);
|
||||
int check_connection_menu_result();
|
||||
void end_connection_menu();
|
||||
void end_reconnection_menu();
|
||||
void update_ds_3ds_connection(bool changed_type);
|
||||
void update_capture_specific_settings();
|
||||
void update_save_menu();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,19 @@
|
|||
1.3.0
|
||||
- Added support for IS TWL Capture. Thanks Lesserkuma.
|
||||
- Added support for Nisetro DS(i) capture card. Thanks Lesserkuma.
|
||||
- Added support for Old 3DS Optimize capture card. Serial key needed.
|
||||
- Added support for New 3DS Optimize capture card. Serial key needed.
|
||||
- Switched off FTD3XX for Linux, MacOS and Windows for ARM (or regular Windows when using a newer FTD3 driver).
|
||||
- Switched off libftdi for Linux and MacOS.
|
||||
- Added support for 3D mode output (when applicable).
|
||||
- Added menu for Color Correction.
|
||||
- Added settings for Top/Bottom screen separator space.
|
||||
- Added menu to choose Audio output device. Thanks R3alCl0ud.
|
||||
- Added option to choose between stability and latency for audio.
|
||||
- Added menu to choose allowed Input devices.
|
||||
- Improved Raspberry Pi Kiosk setup. Moved most data to cc3dsfs folder in bootfs, so it can be easily edited on Windows. Added example of Multi capture card setup.
|
||||
- Various smaller fixes, improvements and changes.
|
||||
-----------------------------------------
|
||||
1.2.0
|
||||
- Added support for the new Loopy DS (2024) Capture Card.
|
||||
- Added support for IS Nitro Capture.
|
||||
|
|
|
|||
|
|
@ -129,6 +129,22 @@ static int cypress_libusb_insert_device(std::vector<CaptureDevice> &devices_list
|
|||
return result;
|
||||
}
|
||||
|
||||
static void cypress_libusb_fix_device_intial_check(const cy_device_usb_device* usb_device_desc, libusb_device *usb_device, libusb_device_descriptor *usb_descriptor) {
|
||||
libusb_device_handle *handle = NULL;
|
||||
if((usb_descriptor->idVendor != usb_device_desc->vid) || (usb_descriptor->idProduct != usb_device_desc->pid))
|
||||
return;
|
||||
uint16_t masked_wanted_bcd_device = usb_device_desc->bcd_device_mask & usb_device_desc->bcd_device_wanted_value;
|
||||
|
||||
if((masked_wanted_bcd_device == 0xFFFF) || (usb_descriptor->bcdDevice != 0xFFFF))
|
||||
return;
|
||||
|
||||
int result = libusb_open(usb_device, &handle);
|
||||
if((result < 0) || (handle == NULL))
|
||||
return;
|
||||
libusb_close(handle);
|
||||
return;
|
||||
}
|
||||
|
||||
cy_device_device_handlers* cypress_libusb_serial_reconnection(const cy_device_usb_device* usb_device_desc, std::string wanted_serial_number, int &curr_serial_extra_id, CaptureDevice* new_device) {
|
||||
if(!usb_is_initialized())
|
||||
return NULL;
|
||||
|
|
@ -187,6 +203,16 @@ void cypress_libusb_find_used_serial(const cy_device_usb_device* usb_device_desc
|
|||
ssize_t num_devices = libusb_get_device_list(get_usb_ctx(), &usb_devices);
|
||||
libusb_device_descriptor usb_descriptor{};
|
||||
|
||||
#ifdef ANDROID_COMPILATION
|
||||
// Fix issue with first look at USB bcdDevice.
|
||||
for(ssize_t i = 0; i < num_devices; i++) {
|
||||
int result = libusb_get_device_descriptor(usb_devices[i], &usb_descriptor);
|
||||
if(result < 0)
|
||||
continue;
|
||||
cypress_libusb_fix_device_intial_check(usb_device_desc, usb_devices[i], &usb_descriptor);
|
||||
}
|
||||
#endif
|
||||
|
||||
for(ssize_t i = 0; i < num_devices; i++) {
|
||||
cy_device_device_handlers handlers;
|
||||
int result = libusb_get_device_descriptor(usb_devices[i], &usb_descriptor);
|
||||
|
|
@ -225,10 +251,25 @@ void cypress_libusb_find_used_serial(const cy_device_usb_device* usb_device_desc
|
|||
void cypress_libusb_list_devices(std::vector<CaptureDevice> &devices_list, bool* no_access_elems, bool* not_supported_elems, int *curr_serial_extra_id_cypress, std::vector<const cy_device_usb_device*> &device_descriptions) {
|
||||
if(!usb_is_initialized())
|
||||
return;
|
||||
if(device_descriptions.size() <= 0)
|
||||
return;
|
||||
|
||||
libusb_device **usb_devices;
|
||||
ssize_t num_devices = libusb_get_device_list(get_usb_ctx(), &usb_devices);
|
||||
libusb_device_descriptor usb_descriptor{};
|
||||
|
||||
#ifdef ANDROID_COMPILATION
|
||||
// Fix issue with first look at USB bcdDevice.
|
||||
for(ssize_t i = 0; i < num_devices; i++) {
|
||||
int result = libusb_get_device_descriptor(usb_devices[i], &usb_descriptor);
|
||||
if(result < 0)
|
||||
continue;
|
||||
for(size_t j = 0; j < device_descriptions.size(); j++) {
|
||||
cypress_libusb_fix_device_intial_check(device_descriptions[j], usb_devices[i], &usb_descriptor);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
for(ssize_t i = 0; i < num_devices; i++) {
|
||||
int result = libusb_get_device_descriptor(usb_devices[i], &usb_descriptor);
|
||||
if(result < 0)
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ void list_devices_cyni_device(std::vector<CaptureDevice> &devices_list, std::vec
|
|||
delete[] not_supported_elems;
|
||||
}
|
||||
|
||||
bool cyni_device_connect_usb(bool print_failed, CaptureData* capture_data, CaptureDevice* device) {
|
||||
bool cyni_device_connect_usb(bool print_failed, CaptureData* capture_data, CaptureDevice* device, void* info) {
|
||||
const cyni_device_usb_device* usb_device_info = (const cyni_device_usb_device*)device->descriptor;
|
||||
cy_device_device_handlers* handlers = usb_reconnect(usb_device_info, device);
|
||||
if(handlers == NULL) {
|
||||
|
|
@ -174,12 +174,17 @@ bool cyni_device_connect_usb(bool print_failed, CaptureData* capture_data, Captu
|
|||
cypress_nisetro_connection_end(handlers, usb_device_info);
|
||||
std::string new_serial_number = process_serial_string(next_usb_device_info, std::to_string(free_fw_id));
|
||||
CaptureDevice new_device;
|
||||
for(int i = 0; i < 20; i++) {
|
||||
default_sleep(500);
|
||||
setup_reconnection_device(info);
|
||||
for(int i = 0; i < 100; i++) {
|
||||
default_sleep(100);
|
||||
handlers = usb_find_by_serial_number(next_usb_device_info, new_serial_number, &new_device);
|
||||
if(handlers != NULL)
|
||||
break;
|
||||
// Do periodic polling so OSs don't think the software is locked up
|
||||
if(!wait_reconnection_device(info))
|
||||
break;
|
||||
}
|
||||
end_reconnection_device(info);
|
||||
if(handlers == NULL) {
|
||||
capture_error_print(true, capture_data, "Device reconnection error");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#define PIO_RESET 0x10
|
||||
#define PIO_DIR 0x08
|
||||
|
||||
#define NISETRO_DS_WANTED_VALUE_BASE 0xFF00
|
||||
#define NISETRO_DS_WANTED_VALUE_BASE 0xFC00
|
||||
|
||||
static const cyni_device_usb_device cypress_fx2_generic_device = {
|
||||
.name = "FX2LP->NiseTro DS", .long_name = "EZ-USB FX2LP -> NiseTro DS(i)",
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ void list_devices_cyop_device(std::vector<CaptureDevice> &devices_list, std::vec
|
|||
delete[] not_supported_elems;
|
||||
}
|
||||
|
||||
bool cyop_device_connect_usb(bool print_failed, CaptureData* capture_data, CaptureDevice* device) {
|
||||
bool cyop_device_connect_usb(bool print_failed, CaptureData* capture_data, CaptureDevice* device, void* info) {
|
||||
const cyop_device_usb_device* usb_device_info = (const cyop_device_usb_device*)device->descriptor;
|
||||
cy_device_device_handlers* handlers = usb_reconnect(usb_device_info, device);
|
||||
if(handlers == NULL) {
|
||||
|
|
@ -196,12 +196,17 @@ bool cyop_device_connect_usb(bool print_failed, CaptureData* capture_data, Captu
|
|||
cypress_optimize_3ds_connection_end(handlers, usb_device_info);
|
||||
std::string new_serial_number = process_serial_string(next_usb_device_info, std::to_string(free_fw_id));
|
||||
CaptureDevice new_device;
|
||||
for(int i = 0; i < 20; i++) {
|
||||
default_sleep(500);
|
||||
setup_reconnection_device(info);
|
||||
for(int i = 0; i < 100; i++) {
|
||||
default_sleep(100);
|
||||
handlers = usb_find_by_serial_number(next_usb_device_info, new_serial_number, &new_device);
|
||||
if(handlers != NULL)
|
||||
break;
|
||||
// Do periodic polling so OSs don't think the software is locked up
|
||||
if(!wait_reconnection_device(info))
|
||||
break;
|
||||
}
|
||||
end_reconnection_device(info);
|
||||
if(handlers == NULL) {
|
||||
capture_error_print(true, capture_data, "Device reconnection error");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -912,6 +912,11 @@ void WindowScreen::setup_connection_menu(std::vector<CaptureDevice> *devices_lis
|
|||
this->connection_menu->insert_data(devices_list);
|
||||
}
|
||||
|
||||
void WindowScreen::setup_reconnection_menu(bool reset_data) {
|
||||
// Skip the check here. It's special.
|
||||
this->switch_to_menu(RECONNECT_MENU_TYPE, NULL, reset_data);
|
||||
}
|
||||
|
||||
void WindowScreen::setup_main_menu(bool reset_data, bool skip_setup_check) {
|
||||
if((!skip_setup_check) && (!this->can_setup_menu()))
|
||||
return;
|
||||
|
|
@ -1515,12 +1520,13 @@ void WindowScreen::poll(bool do_everything) {
|
|||
done = true;
|
||||
continue;
|
||||
}
|
||||
if(this->loaded_menu != CONNECT_MENU_TYPE) {
|
||||
if((this->loaded_menu != CONNECT_MENU_TYPE) && (this->loaded_menu != RECONNECT_MENU_TYPE)) {
|
||||
if(this->main_poll(event_data))
|
||||
continue;
|
||||
}
|
||||
if((this->loaded_menu == DEFAULT_MENU_TYPE) || (this->loaded_menu_ptr == NULL)) {
|
||||
this->no_menu_poll(event_data);
|
||||
if(this->loaded_menu != RECONNECT_MENU_TYPE)
|
||||
this->no_menu_poll(event_data);
|
||||
continue;
|
||||
}
|
||||
if(!this->loaded_menu_ptr->poll(event_data))
|
||||
|
|
@ -1533,6 +1539,8 @@ void WindowScreen::poll(bool do_everything) {
|
|||
if(this->check_connection_menu_result() != CONNECTION_MENU_NO_ACTION)
|
||||
done = true;
|
||||
break;
|
||||
case RECONNECT_MENU_TYPE:
|
||||
break;
|
||||
case MAIN_MENU_TYPE:
|
||||
switch(this->main_menu->selected_index) {
|
||||
case MAIN_MENU_OPEN:
|
||||
|
|
@ -2425,6 +2433,10 @@ void WindowScreen::end_connection_menu() {
|
|||
this->setup_no_menu();
|
||||
}
|
||||
|
||||
void WindowScreen::end_reconnection_menu() {
|
||||
this->setup_no_menu();
|
||||
}
|
||||
|
||||
void WindowScreen::update_ds_3ds_connection(bool changed_type) {
|
||||
if(changed_type && (this->curr_menu == CROP_MENU_TYPE))
|
||||
this->setup_no_menu();
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
#define NO_DATA_CONSECUTIVE_THRESHOLD 4
|
||||
#define TIME_AUDIO_DEVICE_CHECK 0.25
|
||||
|
||||
#define ANDROID_FIRST_CONNECTION_TIMEOUT 0.5
|
||||
|
||||
struct override_all_data {
|
||||
override_win_data override_top_bot_data;
|
||||
override_win_data override_top_data;
|
||||
|
|
@ -561,6 +563,26 @@ static void populate_force_disable_ccs(bool* force_cc_disables, override_all_dat
|
|||
force_cc_disables[CC_OPTIMIZE_O3DS] = override_data.force_disable_optimize_old_3ds;
|
||||
}
|
||||
|
||||
static void check_for_first_connection(bool &did_first_connection, std::chrono::time_point<std::chrono::high_resolution_clock> &start_time, CaptureData* capture_data, FrontendData *frontend_data, bool* force_cc_disables, override_all_data &override_data, OutTextData &out_text_data, int &ret_val) {
|
||||
if(did_first_connection)
|
||||
return;
|
||||
|
||||
#ifdef ANDROID_COMPILATION
|
||||
auto curr_time = std::chrono::high_resolution_clock::now();
|
||||
const std::chrono::duration<double> diff = curr_time - start_time;
|
||||
if(diff.count() < ANDROID_FIRST_CONNECTION_TIMEOUT)
|
||||
return;
|
||||
#endif
|
||||
|
||||
capture_data->status.connected = connect(true, capture_data, frontend_data, force_cc_disables, override_data.auto_connect_to_first);
|
||||
if((override_data.quit_on_first_connection_failure || override_data.auto_close) && (!capture_data->status.connected)) {
|
||||
capture_data->status.running = false;
|
||||
ret_val = -3;
|
||||
}
|
||||
SuccessConnectionOutTextGenerator(out_text_data, capture_data);
|
||||
did_first_connection = true;
|
||||
}
|
||||
|
||||
static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data, override_all_data &override_data, volatile bool* can_do_output) {
|
||||
VideoOutputData *out_buf;
|
||||
double last_frame_time = 0.0;
|
||||
|
|
@ -572,8 +594,10 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
frontend_data.display_data.force_disable_mouse = override_data.always_prevent_mouse_showing;
|
||||
frontend_data.reload = true;
|
||||
bool skip_io = false;
|
||||
bool did_first_connection = false;
|
||||
const double max_time_no_frames_allowed = MAX_ALLOWED_NO_FRAME_TIME;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> last_valid_frame_time = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> start_time = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> last_valid_frame_time = start_time;
|
||||
OutTextData out_text_data;
|
||||
int ret_val = 0;
|
||||
int poll_timeout = 0;
|
||||
|
|
@ -613,19 +637,16 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
std::thread bot_thread(screen_display_thread, bot_screen);
|
||||
std::thread joint_thread(screen_display_thread, joint_screen);
|
||||
|
||||
capture_data->status.connected = connect(true, capture_data, &frontend_data, force_cc_disables, override_data.auto_connect_to_first);
|
||||
if((override_data.quit_on_first_connection_failure || override_data.auto_close) && (!capture_data->status.connected)) {
|
||||
capture_data->status.running = false;
|
||||
ret_val = -3;
|
||||
}
|
||||
bool last_connected = capture_data->status.connected;
|
||||
SuccessConnectionOutTextGenerator(out_text_data, capture_data);
|
||||
bool last_connected = false;
|
||||
int no_data_consecutive = 0;
|
||||
|
||||
if(override_data.print_controller_list)
|
||||
joystick_print_all();
|
||||
|
||||
while(capture_data->status.running) {
|
||||
check_for_first_connection(did_first_connection, start_time, capture_data, &frontend_data, force_cc_disables, override_data, out_text_data, ret_val);
|
||||
if(!capture_data->status.running)
|
||||
break;
|
||||
|
||||
bool polled = false;
|
||||
bool poll_everything = true;
|
||||
|
|
@ -717,8 +738,10 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
}
|
||||
|
||||
if(top_screen->open_capture() || bot_screen->open_capture() || joint_screen->open_capture()) {
|
||||
capture_data->status.connected = connect(true, capture_data, &frontend_data, force_cc_disables);
|
||||
SuccessConnectionOutTextGenerator(out_text_data, capture_data);
|
||||
if(did_first_connection) {
|
||||
capture_data->status.connected = connect(true, capture_data, &frontend_data, force_cc_disables);
|
||||
SuccessConnectionOutTextGenerator(out_text_data, capture_data);
|
||||
}
|
||||
}
|
||||
|
||||
check_close_application(top_screen, capture_data, ret_val);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,35 @@ static int choose_device(std::vector<CaptureDevice> *devices_list, FrontendData*
|
|||
return chosen_index;
|
||||
}
|
||||
|
||||
void setup_reconnection_device(void* info) {
|
||||
FrontendData* frontend_data = static_cast<FrontendData*>(info);
|
||||
frontend_data->top_screen->setup_reconnection_menu();
|
||||
frontend_data->bot_screen->setup_reconnection_menu();
|
||||
frontend_data->joint_screen->setup_reconnection_menu();
|
||||
}
|
||||
|
||||
bool wait_reconnection_device(void* info) {
|
||||
FrontendData* frontend_data = static_cast<FrontendData*>(info);
|
||||
update_output(frontend_data);
|
||||
frontend_data->top_screen->poll();
|
||||
frontend_data->bot_screen->poll();
|
||||
frontend_data->joint_screen->poll();
|
||||
if(frontend_data->top_screen->close_capture())
|
||||
return false;
|
||||
if(frontend_data->bot_screen->close_capture())
|
||||
return false;
|
||||
if(frontend_data->joint_screen->close_capture())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void end_reconnection_device(void* info) {
|
||||
FrontendData* frontend_data = static_cast<FrontendData*>(info);
|
||||
frontend_data->top_screen->end_reconnection_menu();
|
||||
frontend_data->bot_screen->end_reconnection_menu();
|
||||
frontend_data->joint_screen->end_reconnection_menu();
|
||||
}
|
||||
|
||||
void capture_error_print(bool print_failed, CaptureData* capture_data, std::string error_string) {
|
||||
capture_error_print(print_failed, capture_data, error_string, error_string);
|
||||
}
|
||||
|
|
@ -144,11 +173,11 @@ bool connect(bool print_failed, CaptureData* capture_data, FrontendData* fronten
|
|||
|
||||
// Actual connection
|
||||
#ifdef USE_CYNI_USB
|
||||
if((devices_list[chosen_device].cc_type == CAPTURE_CONN_CYPRESS_NISETRO) && (!cyni_device_connect_usb(print_failed, capture_data, &devices_list[chosen_device])))
|
||||
if((devices_list[chosen_device].cc_type == CAPTURE_CONN_CYPRESS_NISETRO) && (!cyni_device_connect_usb(print_failed, capture_data, &devices_list[chosen_device], frontend_data)))
|
||||
return false;
|
||||
#endif
|
||||
#ifdef USE_CYPRESS_OPTIMIZE
|
||||
if((devices_list[chosen_device].cc_type == CAPTURE_CONN_CYPRESS_OPTIMIZE) && (!cyop_device_connect_usb(print_failed, capture_data, &devices_list[chosen_device])))
|
||||
if((devices_list[chosen_device].cc_type == CAPTURE_CONN_CYPRESS_OPTIMIZE) && (!cyop_device_connect_usb(print_failed, capture_data, &devices_list[chosen_device], frontend_data)))
|
||||
return false;
|
||||
#endif
|
||||
#ifdef USE_FTD3
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#define str(a) #a
|
||||
|
||||
#define APP_VERSION_MAJOR 1
|
||||
#define APP_VERSION_MINOR 2
|
||||
#define APP_VERSION_MINOR 3
|
||||
#define APP_VERSION_REVISION 0
|
||||
#ifdef RASPI
|
||||
#define APP_VERSION_LETTER R
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user