Skip to content

Commit

Permalink
Merge branch 'develop' into rom-autoload-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
networkfusion authored Oct 25, 2024
2 parents d991481 + 004f182 commit 8a80c97
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 25 deletions.
36 changes: 28 additions & 8 deletions src/menu/views/flashcart_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#include "../sound.h"


static inline const char *format_boolean_type (bool bool_value) {
return bool_value ? "Supported" : "Unsupported";
}

static void process (menu_t *menu) {
if (menu->actions.back) {
menu->next_mode = MENU_MODE_BROWSER;
Expand All @@ -18,24 +22,40 @@ static void draw (menu_t *menu, surface_t *d) {

component_main_text_draw(
ALIGN_CENTER, VALIGN_TOP,
"FLASHCART INFORMATION\n"
"FLASHCART INFORMATION"
"\n"
"\n"
"This feature is not yet supported.\n\n"
);

// FIXME: Display:
// * cart_type
// * Firmware version
// * supported features (flashcart_features_t)


component_main_text_draw(
ALIGN_LEFT, VALIGN_TOP,
"\n"
"\n"
"Type:\n"
" %s\n\n"
"Firmware:\n"
" %s\n\n"
"Features:\n"
" Virtual 64DD: %s.\n"
" Real Time Clock: %s.\n"
" USB Debugging: %s.\n"
" CIC Detection: %s.\n"
" Region Detection: %s.\n"
"\n\n",
"SummerCart64",
"V?.?.?",
format_boolean_type(true),
format_boolean_type(true),
format_boolean_type(true),
format_boolean_type(true),
format_boolean_type(true)
);

// FIXME: Display:
// * cart_type
// * Firmware version
// * supported features (flashcart_features_t)


component_actions_bar_text_draw(
ALIGN_LEFT, VALIGN_TOP,
Expand Down
34 changes: 17 additions & 17 deletions src/menu/views/settings_editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@ static const char *format_switch (bool state) {
}

static void set_pal60_type (menu_t *menu, void *arg) {
menu->settings.pal60_enabled = (bool) (arg);
menu->settings.pal60_enabled = (bool)(uintptr_t)(arg);
settings_save(&menu->settings);
}

static void set_protected_entries_type (menu_t *menu, void *arg) {
menu->settings.show_protected_entries = (bool) (arg);
menu->settings.show_protected_entries = (bool)(uintptr_t)(arg);
settings_save(&menu->settings);

menu->browser.reload = true;
}

static void set_use_saves_folder_type (menu_t *menu, void *arg) {
menu->settings.use_saves_folder = (bool) (arg);
menu->settings.use_saves_folder = (bool)(uintptr_t)(arg);
settings_save(&menu->settings);
}

static void set_sound_enabled_type (menu_t *menu, void *arg) {
menu->settings.sound_enabled = (bool) (arg);
menu->settings.sound_enabled = (bool)(uintptr_t)(arg);
sound_use_sfx(menu->settings.sound_enabled);
settings_save(&menu->settings);
}

#ifdef BETA_SETTINGS
static void set_bgm_enabled_type (menu_t *menu, void *arg) {
menu->settings.bgm_enabled = (bool) (arg);
menu->settings.bgm_enabled = (bool)(uintptr_t)(arg);
settings_save(&menu->settings);
}

static void set_rumble_enabled_type (menu_t *menu, void *arg) {
menu->settings.rumble_enabled = (bool) (arg);
menu->settings.rumble_enabled = (bool)(uintptr_t)(arg);
settings_save(&menu->settings);
}

Expand All @@ -53,39 +53,39 @@ static void set_rumble_enabled_type (menu_t *menu, void *arg) {


static component_context_menu_t set_pal60_type_context_menu = { .list = {
{.text = "On", .action = set_pal60_type, .arg = (void *) (true) },
{.text = "On", .action = set_pal60_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_pal60_type, .arg = (void *) (false) },
COMPONENT_CONTEXT_MENU_LIST_END,
}};

static component_context_menu_t set_protected_entries_type_context_menu = { .list = {
{.text = "On", .action = set_protected_entries_type, .arg = (void *) (true) },
{.text = "Off", .action = set_protected_entries_type, .arg = (void *) (false) },
{.text = "On", .action = set_protected_entries_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_protected_entries_type, .arg = (void *)(uintptr_t)(false) },
COMPONENT_CONTEXT_MENU_LIST_END,
}};

static component_context_menu_t set_sound_enabled_type_context_menu = { .list = {
{.text = "On", .action = set_sound_enabled_type, .arg = (void *) (true) },
{.text = "Off", .action = set_sound_enabled_type, .arg = (void *) (false) },
{.text = "On", .action = set_sound_enabled_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_sound_enabled_type, .arg = (void *)(uintptr_t)(false) },
COMPONENT_CONTEXT_MENU_LIST_END,
}};

static component_context_menu_t set_use_saves_folder_type_context_menu = { .list = {
{.text = "On", .action = set_use_saves_folder_type, .arg = (void *) (true) },
{.text = "Off", .action = set_use_saves_folder_type, .arg = (void *) (false) },
{.text = "On", .action = set_use_saves_folder_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_use_saves_folder_type, .arg = (void *)(uintptr_t)(false) },
COMPONENT_CONTEXT_MENU_LIST_END,
}};

#ifdef BETA_SETTINGS
static component_context_menu_t set_bgm_enabled_type_context_menu = { .list = {
{.text = "On", .action = set_bgm_enabled_type, .arg = (void *) (true) },
{.text = "Off", .action = set_bgm_enabled_type, .arg = (void *) (false) },
{.text = "On", .action = set_bgm_enabled_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_bgm_enabled_type, .arg = (void *)(uintptr_t)(false) },
COMPONENT_CONTEXT_MENU_LIST_END,
}};

static component_context_menu_t set_rumble_enabled_type_context_menu = { .list = {
{.text = "On", .action = set_rumble_enabled_type, .arg = (void *) (true) },
{.text = "Off", .action = set_rumble_enabled_type, .arg = (void *) (false) },
{.text = "On", .action = set_rumble_enabled_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_rumble_enabled_type, .arg = (void *)(uintptr_t)(false) },
COMPONENT_CONTEXT_MENU_LIST_END,
}};
#endif
Expand Down

0 comments on commit 8a80c97

Please sign in to comment.