Work towards #75

Currently only handles the settings and features required.

Co-Authored-By: Robin Jones <networkfusion@users.noreply.github.com>
This commit is contained in:
Robin Jones 2025-01-26 16:07:07 +00:00
parent 8a1f054aae
commit 15cbd1b69d
7 changed files with 18 additions and 5 deletions

View File

@ -78,6 +78,7 @@ static bool d64_has_feature (flashcart_features_t feature) {
case FLASHCART_FEATURE_AUTO_CIC: return true;
case FLASHCART_FEATURE_AUTO_REGION: return true;
case FLASHCART_FEATURE_SAVE_WRITEBACK: return true;
case FLASHCART_FEATURE_ROM_REBOOT_FAST: return true;
default: return false;
}
}

View File

@ -33,7 +33,8 @@ typedef enum {
FLASHCART_FEATURE_AUTO_REGION,
FLASHCART_FEATURE_DIAGNOSTIC_DATA,
FLASHCART_FEATURE_BIOS_UPDATE_FROM_MENU,
FLASHCART_FEATURE_SAVE_WRITEBACK
FLASHCART_FEATURE_SAVE_WRITEBACK,
FLASHCART_FEATURE_ROM_REBOOT_FAST
} flashcart_features_t;
/** @brief Flashcart save type enumeration */

View File

@ -266,6 +266,7 @@ static bool sc64_has_feature (flashcart_features_t feature) {
case FLASHCART_FEATURE_AUTO_REGION: return true;
case FLASHCART_FEATURE_DIAGNOSTIC_DATA: return true;
case FLASHCART_FEATURE_SAVE_WRITEBACK: return true;
case FLASHCART_FEATURE_ROM_REBOOT_FAST: return true;
default: return false;
}
}

View File

@ -18,6 +18,7 @@ static settings_t init = {
.soundfx_enabled = false,
.loading_progress_bar_enabled = true,
.rom_autoload_enabled = false,
.rom_fast_reboot_enabled = false,
.rom_autoload_path = "",
.rom_autoload_filename = "",
@ -51,6 +52,7 @@ void settings_load (settings_t *settings) {
settings->loading_progress_bar_enabled = mini_get_bool(ini, "menu", "loading_progress_bar_enabled", init.loading_progress_bar_enabled);
settings->rom_autoload_enabled = mini_get_bool(ini, "menu", "autoload_rom_enabled", init.rom_autoload_enabled);
settings->rom_autoload_enabled = mini_get_bool(ini, "menu", "reboot_rom_enabled", init.rom_fast_reboot_enabled);
settings->rom_autoload_path = strdup(mini_get_string(ini, "autoload", "rom_path", init.rom_autoload_path));
settings->rom_autoload_filename = strdup(mini_get_string(ini, "autoload", "rom_filename", init.rom_autoload_filename));
@ -73,6 +75,7 @@ void settings_save (settings_t *settings) {
mini_set_bool(ini, "menu", "soundfx_enabled", settings->soundfx_enabled);
mini_set_bool(ini, "menu", "loading_progress_bar_enabled", settings->loading_progress_bar_enabled);
mini_set_bool(ini, "menu", "autoload_rom_enabled", settings->rom_autoload_enabled);
mini_set_bool(ini, "menu", "reboot_rom_enabled", settings->rom_fast_reboot_enabled);
mini_set_string(ini, "autoload", "rom_path", settings->rom_autoload_path);
mini_set_string(ini, "autoload", "rom_filename", settings->rom_autoload_filename);

View File

@ -31,18 +31,21 @@ typedef struct {
/** @brief Enable Background music */
bool bgm_enabled;
/** @brief Enable Sounds */
/** @brief Enable Sound effects within the menu */
bool soundfx_enabled;
/** @brief Enable rumble feedback */
/** @brief Enable rumble feedback within the menu */
bool rumble_enabled;
/** @brief Show progress bar when loading a ROM */
bool loading_progress_bar_enabled;
/** @brief Enable the ability to bypass the menu and instantly load a ROM */
/** @brief Enable the ability to bypass the menu and instantly load a ROM on power and reset button */
bool rom_autoload_enabled;
/** @brief Enable the ability to bypass the menu and instantly load a ROM on reset button */
bool rom_fast_reboot_enabled;
/** @brief A path to the autoloaded ROM */
char *rom_autoload_path;

View File

@ -70,6 +70,7 @@ static void draw (menu_t *menu, surface_t *d) {
" Region Detection: %s.\n"
" Save Writeback: %s.\n"
" Auto F/W Updates: %s.\n"
" Fast ROM Reboots: %s.\n"
"\n\n",
format_cart_type(),
format_cart_version(),
@ -79,7 +80,8 @@ static void draw (menu_t *menu, surface_t *d) {
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_AUTO_CIC)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_AUTO_REGION)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_SAVE_WRITEBACK)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_BIOS_UPDATE_FROM_MENU))
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_BIOS_UPDATE_FROM_MENU)),
format_boolean_type(flashcart_has_feature(FLASHCART_FEATURE_ROM_REBOOT_FAST))
//TODO: display the battery and temperature information (if available).
//format_diagnostic_data(flashcart_has_feature(FLASHCART_FEATURE_DIAGNOSTIC_DATA))

View File

@ -137,6 +137,7 @@ static void draw (menu_t *menu, surface_t *d) {
"\n\n"
" Default Directory : %s\n\n"
" Autoload ROM : %s\n"
" Fast Reboot ROM : %s\n"
" ROM Loading Bar : %s\n\n"
"To change the following menu settings, press 'A':\n"
" Show Hidden Files : %s\n"
@ -153,6 +154,7 @@ static void draw (menu_t *menu, surface_t *d) {
,
menu->settings.default_directory,
format_switch(menu->settings.rom_autoload_enabled),
format_switch(menu->settings.rom_fast_reboot_enabled),
format_switch(menu->settings.loading_progress_bar_enabled),
format_switch(menu->settings.show_protected_entries),
format_switch(menu->settings.use_saves_folder),