From e9322870fce6f0324bf9a047839c334e6bc591b9 Mon Sep 17 00:00:00 2001 From: chaoskagami Date: Fri, 15 Jul 2016 06:55:48 -0400 Subject: [PATCH] Fix up the pager mode and actually have a more manpage-like help menu --- README.md | 5 ++++- source/display.c | 7 ++++++- source/menu.c | 34 ++++++++++++++++++++++++---------- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4006a4d..8f7655d 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ Credits * General inspiration from Cakes, FIRM decryption code, reboot assembly code, some code for text display. https://github.com/mid-kid/CakesForeveryWan @Wolfvak - * Code segment dumping + loading + * Code segment dumping + loading, ideas, and a lot of miscellaneous code. @AuroraWright * RE work, patches, EmuNAND, and Reboot/Firmlaunch C code. https://github.com/AuroraWright/Luma3ds @@ -219,6 +219,9 @@ Credits @TiniVi * RE work, screen deinit. +@gemarcano + * For general help and libctr9_io (which is a submodule here.) Made life much easier. + Temptress Cerise (GBATemp) * A LOT of testing which was really helpful. diff --git a/source/display.c b/source/display.c index 6197b64..34cae21 100644 --- a/source/display.c +++ b/source/display.c @@ -201,11 +201,16 @@ show_menu(struct options_s *options, uint8_t *toggles) else if (cursor_y > cursor_max - 1) cursor_y = cursor_min; + if (less_mode) { + window_top = cursor_y; + window_bottom = window_top + window_size; + clear_disp(TOP_SCREEN); + } + if (cursor_y < window_top + cursor_min) { window_top = cursor_y - cursor_min; window_bottom = window_top + window_size; clear_disp(TOP_SCREEN); - } else if (cursor_y > window_bottom - cursor_min) { window_bottom = cursor_y + cursor_min; window_top = window_bottom - window_size; diff --git a/source/menu.c b/source/menu.c index 6e8adc5..61adc31 100644 --- a/source/menu.c +++ b/source/menu.c @@ -216,19 +216,33 @@ menu_info() } #define ln(s) { 0, s, "", not_option, 0, 0 } +#define lnh(s) { 0, s, "", not_option, 1, 0 } static struct options_s help_d[] = { - ln(FW_NAME " is another 3DS CFW for power users."), + lnh("About"), + ln(" This is another 3DS CFW for power users."), ln(" It seeks to address some faults in other"), ln(" CFWs and is generally just another choice"), ln(" for users - but primarily is intended for"), - ln(" developers and is not for the faint of heart."), + ln(" developers. It is not for the faint of heart."), ln(""), - ln("Credits to people who've helped me put this"), - ln(" together by code, documentation, or help:"), + lnh("Usage"), + ln(" A -> Select/Toggle/Increment"), + ln(" B -> Back/Boot"), + ln(" X -> Decrement"), + ln(" Select -> Help/Information"), + ln(" Down -> Down"), + ln(" Right -> Down five"), + ln(" Up -> Up"), + ln(" Left -> Up five"), + ln(" L+R+Start -> Menu Screenshot"), + ln(""), + lnh("Credits"), ln(" @mid-kid, @Wolfvak, @Reisyukaku, @AuroraWright"), ln(" @d0k3, @TuxSH, @Steveice10, @delebile,"), - ln(" @Normmatt, @b1l1s, @dark-samus, @TiniVi, etc"), + ln(" @Normmatt, @b1l1s, @dark-samus, @TiniVi,"), + ln(" @gemarcano, and anyone else I may have"), + ln(" forgotten (yell at me, please!)"), ln(""), ln(" "), { -1, "", "", not_option, 0, 0 } @@ -271,17 +285,17 @@ void chainload_menu(); #endif static struct options_s main_s[] = { - { 0, "Options", "Internal options for the CFW. These are part of " FW_NAME " itself.", call_fun, (uint32_t)menu_options, 0 }, - { 0, "Patches", "External bytecode patches found in `" PATH_PATCHES "`. You can choose which to enable.", call_fun, (uint32_t)menu_patches, 0 }, + { 0, "Options", "Internal options for the CFW.\nThese are part of " FW_NAME " itself.", call_fun, (uint32_t)menu_options, 0 }, + { 0, "Patches", "External bytecode patches found in `" PATH_PATCHES "`.\nYou can choose which to enable.", call_fun, (uint32_t)menu_patches, 0 }, { 0, "Info", "Shows the current FIRM versions (and loads them, if needed)", call_fun, (uint32_t)menu_info, 0 }, - { 0, "Help/Readme", "Displays info. Why are you opening help on help? That's kind of silly.", call_fun, (uint32_t)menu_help, 0 }, + { 0, "Readme", "Mini-readme.\nWhy are you opening help on this, though?\nThat's kind of silly.", call_fun, (uint32_t)menu_help, 0 }, { 0, "Reboot", "Reboots the console.", call_fun, (uint32_t)reset, 0 }, { 0, "Power off", "Powers off the console.", call_fun, (uint32_t)poweroff, 0 }, - { 0, "Save Configuration", "Save the configuration. You must do this prior to booting, otherwise nothing is done.", call_fun, (uint32_t)save_config, 0 }, + { 0, "Save Configuration", "Save the configuration.\nYou must do this prior to booting,\notherwise the cache will not be (re)generated..", call_fun, (uint32_t)save_config, 0 }, #if defined(CHAINLOADER) && CHAINLOADER == 1 { 0, "Chainload", "Boot another ARM9 payload file.", call_fun, (uint32_t)chainload_menu, 0 }, #endif - { 0, "Boot Firmware", "Generates caches, patches the firmware, and boots it.", break_menu, 0, 0 }, + { 0, "Boot Firmware", "Generates caches, patches the firmware, and boots it.\nMake sure to 'Save Configuration' first if any options changed.", break_menu, 0, 0 }, // Sentinel. { -1, "", "", 0, -1, -1 }, // cursor_min and cursor_max are stored in the last two. -- 2.39.5