mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-09-08 08:35:28 -05:00
Add Reset Hardware option for IS Nitro Capture
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[flags:-A ARM64 name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[flags:-A Win32 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[flags:-A x64 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[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[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[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[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[name:macOS Apple Silicon os:macos-14]) (push) Waiting to run
CD / Create Pi Mono Setup (push) Blocked by required conditions
CD / Publishing (push) Blocked by required conditions
Some checks are pending
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[flags:-A ARM64 name:Windows VS2022 ARM os:windows-2022]) (push) Waiting to run
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[flags:-A Win32 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[flags:-A x64 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[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[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[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[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[name:macOS Apple Silicon os:macos-14]) (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:
@@ -1,4 +1,5 @@
|
||||
#include "ISNitroMenu.hpp"
|
||||
#include "usb_is_nitro_acquisition.hpp"
|
||||
|
||||
#define NUM_TOTAL_MENU_OPTIONS (sizeof(pollable_options)/sizeof(pollable_options[0]))
|
||||
|
||||
@@ -6,6 +7,8 @@ struct ISNitroMenuOptionInfo {
|
||||
const std::string base_name;
|
||||
const std::string false_name;
|
||||
const bool is_selectable;
|
||||
const bool is_capture_valid;
|
||||
const bool is_emulator_valid;
|
||||
const bool is_inc;
|
||||
const std::string dec_str;
|
||||
const std::string inc_str;
|
||||
@@ -15,17 +18,26 @@ struct ISNitroMenuOptionInfo {
|
||||
|
||||
static const ISNitroMenuOptionInfo is_nitro_delay_option = {
|
||||
.base_name = "Delay", .false_name = "", .is_selectable = false,
|
||||
.is_capture_valid = false, .is_emulator_valid = true,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = ISN_MENU_NO_ACTION,
|
||||
.out_action = ISN_MENU_DELAY};
|
||||
|
||||
static const ISNitroMenuOptionInfo is_nitro_type_option = {
|
||||
.base_name = "Capture", .false_name = "", .is_selectable = true,
|
||||
.is_capture_valid = true, .is_emulator_valid = true,
|
||||
.is_inc = true, .dec_str = "<", .inc_str = ">", .inc_out_action = ISN_MENU_TYPE_INC,
|
||||
.out_action = ISN_MENU_TYPE_DEC};
|
||||
|
||||
static const ISNitroMenuOptionInfo is_nitro_reset_option = {
|
||||
.base_name = "Reset Hardware", .false_name = "", .is_selectable = true,
|
||||
.is_capture_valid = true, .is_emulator_valid = false,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = ISN_MENU_NO_ACTION,
|
||||
.out_action = ISN_MENU_RESET};
|
||||
|
||||
static const ISNitroMenuOptionInfo* pollable_options[] = {
|
||||
&is_nitro_delay_option,
|
||||
&is_nitro_type_option,
|
||||
&is_nitro_reset_option,
|
||||
};
|
||||
|
||||
ISNitroMenu::ISNitroMenu(bool font_load_success, sf::Font &text_font) : OptionSelectionMenu(){
|
||||
@@ -54,11 +66,22 @@ void ISNitroMenu::class_setup() {
|
||||
this->show_title = true;
|
||||
}
|
||||
|
||||
void ISNitroMenu::insert_data() {
|
||||
void ISNitroMenu::insert_data(CaptureDevice* device) {
|
||||
bool is_capture = false;
|
||||
#ifdef USE_IS_NITRO_USB
|
||||
is_capture = is_nitro_is_capture(device);
|
||||
#endif
|
||||
this->num_enabled_options = 0;
|
||||
for(int i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
this->options_indexes[this->num_enabled_options] = i;
|
||||
this->num_enabled_options++;
|
||||
bool valid = true;
|
||||
if(is_capture)
|
||||
valid = valid && pollable_options[i]->is_capture_valid;
|
||||
else
|
||||
valid = valid && pollable_options[i]->is_emulator_valid;
|
||||
if(valid) {
|
||||
this->options_indexes[this->num_enabled_options] = i;
|
||||
this->num_enabled_options++;
|
||||
}
|
||||
}
|
||||
this->prepare_options();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user