Implement Menu for adding Optimize serial keys
Some checks are pending
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) Waiting to run
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) Waiting to run
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) Waiting to run
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) Waiting to run
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) Waiting to run
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) Waiting to run
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) Waiting to run
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) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions

This commit is contained in:
Lorenzooone
2025-11-07 02:27:23 +01:00
parent a6e4348066
commit 4ce35770ac
37 changed files with 1847 additions and 112 deletions

View File

@@ -12,6 +12,7 @@
#include <iostream>
#define CONNECTION_NO_DEVICE_SELECTED (-1)
#define NO_SERIAL_KEY_STR "No Serial Key"
static bool poll_connection_window_screen(WindowScreen *screen, int &chosen_index) {
screen->poll();
@@ -308,6 +309,37 @@ std::string get_device_id_string(CaptureStatus* capture_status) {
return "";
}
std::string get_device_serial_key_string(CaptureStatus* capture_status) {
if(!capture_status->connected)
return NO_SERIAL_KEY_STR;
if(capture_status->device.device_id == 0)
return NO_SERIAL_KEY_STR;
if(capture_status->device.key == "")
return NO_SERIAL_KEY_STR;
return capture_status->device.key;
}
void check_device_serial_key_update(CaptureStatus* capture_status, bool differentiator, std::string key) {
if(get_device_serial_key_string(capture_status) != NO_SERIAL_KEY_STR)
return;
if(capture_status->key_updated)
return;
switch(capture_status->device.cc_type) {
case CAPTURE_CONN_CYPRESS_OPTIMIZE:
#ifdef USE_CYPRESS_OPTIMIZE
if(differentiator != is_device_optimize_n3ds(&capture_status->device))
break;
if(cyop_is_key_for_device_id(&capture_status->device, key))
capture_status->key_updated = true;
#endif
break;
default:
break;
}
}
std::string get_name_of_device(CaptureStatus* capture_status, bool use_long, bool want_real_serial) {
if(!capture_status->connected)
return "Not connected";
@@ -397,6 +429,22 @@ float get_framerate_multiplier(CaptureStatus* capture_status) {
return 0.5;
}
KeySaveError save_cc_key(std::string key, CaptureConnectionType conn_type, bool differentiator) {
KeySaveError error = KEY_SAVE_METHOD_NOT_FOUND;
switch(conn_type) {
case CAPTURE_CONN_CYPRESS_OPTIMIZE:
#ifdef USE_CYPRESS_OPTIMIZE
error = add_key_to_file(key, differentiator);
#endif
break;
default:
break;
}
return error;
}
void capture_init() {
#ifdef USE_DS_3DS_USB
usb_ds_3ds_init();