diff --git a/include/arm11/menu.h b/include/arm11/menu.h index 04b2bc9..791976a 100644 --- a/include/arm11/menu.h +++ b/include/arm11/menu.h @@ -21,10 +21,12 @@ #include "types.h" #include "arm11/console.h" -#define MENU_MAX_ENTRIES 12 +#define MENU_MAX_ENTRIES 8 #define MENU_MAX_DEPTH 4 #define MENU_DISP_Y -2 +#define MENU_OFFSET_TITLE 5 +#define MENU_OFFSET_BUTTONS 18 #define MENU_WIDTH 28 #define WORDWRAP_WIDTH 58 diff --git a/include/arm11/menu_fb3ds.h b/include/arm11/menu_fb3ds.h index 72abfb2..f3eea50 100644 --- a/include/arm11/menu_fb3ds.h +++ b/include/arm11/menu_fb3ds.h @@ -24,7 +24,7 @@ #define LOREM "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata" -#define DESC_CONTINUE "Continue booting the first available boot slot.\nNo function if boot slots are not set up or firmware not found." +#define DESC_CONTINUE "Continue booting the first available boot slot.\nNo function if boot slots are not set up." #define DESC_BOOT_MENU "Display a boot menu, allowing you to select which boot slot to boot from." #define DESC_NAND_TOOLS "Enter NAND tools submenu, including tools for NAND backup, NAND restore and firmware flash." #define DESC_OPTIONS "Enter fastboot3ds options submenu." @@ -61,7 +61,7 @@ MenuInfo menu_fb3ds[] = { { - "fastboot3ds Main Menu", 5, + "Main Menu", 5, { { "Continue boot", DESC_CONTINUE, &DummyFunc, 0 }, { "Boot menu..", DESC_BOOT_MENU, NULL, 6 }, @@ -71,7 +71,7 @@ } }, { - "fastboot3ds NAND tools", 5, + "NAND Tools", 5, { { "Backup NAND", DESC_NAND_BACKUP, &DummyFunc, 3 }, { "Restore NAND", DESC_NAND_RESTORE, &DummyFunc, 4 }, @@ -81,16 +81,16 @@ } }, { - "fastboot3ds options", 4, + "Options", 4, { { "Change boot mode", DESC_CHANGE_BOOT, NULL, 3 }, { "Setup boot slot", DESC_CHANGE_SLOT, NULL, 4 }, { "Change brightness", DESC_CHANGE_BRIGHT, &DummyFunc, 6 }, - { "Force contiguous backups", DESC_SET_CONTIG, NULL, 5 } + { "Set contiguous backups", DESC_SET_CONTIG, NULL, 5 } } }, { - "fastboot3ds boot mode", 3, + "Boot Mode Setup", 3, { { "Set normal boot", DESC_BOOT_NORMAL, &DummyFunc, 0 }, { "Set quick boot", DESC_BOOT_QUICK, &DummyFunc, 1 }, @@ -98,7 +98,7 @@ } }, { - "fastboot3ds boot slots", 3, + "Boot Slot Setup", 3, { { "Setup [slot 1]...", DESC_SET_SLOT_1, &DummyFunc, 0 }, { "Setup [slot 2]...", DESC_SET_SLOT_2, &DummyFunc, 1 }, @@ -106,14 +106,14 @@ } }, { - "fastboot3ds backup setting", 2, + "Backup Setup", 2, { { "Enable contiguous backups", DESC_ENABLE_CONTIG, &DummyFunc, 1 }, { "Disable contiguous backups", DESC_DISABLE_CONTIG, &DummyFunc, 0 } } }, { - "fastboot3ds boot menu", 4, + "Boot Menu", 4, { { "Boot [slot 1]", DESC_BOOT_SLOT_1, &DummyFunc, 0 }, { "Boot [slot 2]", DESC_BOOT_SLOT_2, &DummyFunc, 1 }, diff --git a/source/arm11/menu.c b/source/arm11/menu.c index 1806a88..3b90a7b 100644 --- a/source/arm11/menu.c +++ b/source/arm11/menu.c @@ -106,7 +106,7 @@ int desc_y = (desc_con->consoleHeight - 2 - desc_height); consoleSetCursor(desc_con, desc_x, desc_y++); - ee_printf("[%s]", name); + ee_printf("%s:", name); for (char* str = strtok(desc_ww, "\n"); str != NULL; str = strtok(NULL, "\n")) { consoleSetCursor(desc_con, desc_x, desc_y++); @@ -123,9 +123,10 @@ */ void menuDraw(MenuInfo* curr_menu, PrintConsole* menu_con, u32 index, bool is_sub_menu) { - const u32 menu_block_height = curr_menu->n_entries + 2; // +2 for title and separator + // const u32 menu_block_height = curr_menu->n_entries + 5; // +5 for title and button instructions int menu_x = (menu_con->consoleWidth - MENU_WIDTH) >> 1; - int menu_y = MENU_DISP_Y + ((menu_con->consoleHeight - menu_block_height) >> 1); + // int menu_y = MENU_DISP_Y + ((menu_con->consoleHeight - menu_block_height) >> 1); + int menu_y = MENU_OFFSET_TITLE; // select menu console consoleSelect(menu_con); @@ -134,10 +135,11 @@ // menu title consoleSetCursor(menu_con, menu_x, menu_y++); ee_printf(curr_menu->name); + menu_y++; // first separator - consoleSetCursor(menu_con, menu_x, menu_y++); - ee_printf("%*.*s", MENU_WIDTH, MENU_WIDTH, "============================================================"); + // consoleSetCursor(menu_con, menu_x, menu_y++); + // ee_printf("%*.*s", MENU_WIDTH, MENU_WIDTH, "============================================================"); // menu entries for (u32 i = 0; i < curr_menu->n_entries; i++) @@ -147,11 +149,16 @@ bool is_selected = (i == index); consoleSetCursor(menu_con, menu_x, menu_y++); - ee_printf(is_selected ? "[%s]" : " %s ", name); + ee_printf(is_selected ? "\x1b[47;30m%2lu.%-*.*s\x1b[0m" : "%2lu.%-*.*s", i+1, MENU_WIDTH-3, MENU_WIDTH-3, name); } - // second separator + // button instructions + menu_y = MENU_OFFSET_BUTTONS; consoleSetCursor(menu_con, menu_x, menu_y++); + ee_printf("%-*.*s", MENU_WIDTH, MENU_WIDTH, "[A]:Choose [B]:Back"); + + // second separator + // consoleSetCursor(menu_con, menu_x, menu_y++); // ee_printf("%*.*s", MENU_WIDTH, MENU_WIDTH, "============================================================");