From 24e5d6662e8a1feb5f375f6aa7ca4f7c9668ceec Mon Sep 17 00:00:00 2001 From: chaoskagami Date: Tue, 7 Jun 2016 22:10:09 -0400 Subject: [PATCH] Expose system title dumping as optional (warning - super slow boot) --- external/loader/source/patcher.c | 5 ++--- source/config.h | 3 +++ source/menu.c | 8 ++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/external/loader/source/patcher.c b/external/loader/source/patcher.c index 0b33a4a..8eeb5e8 100644 --- a/external/loader/source/patcher.c +++ b/external/loader/source/patcher.c @@ -319,9 +319,8 @@ dump_code(u64 progId, u8 *code_loc, u32 code_len) u32 highTid = progId >> 0x20; - // Only regular titles and demos will get dumped - // Otherwise it's insanely slow - if (highTid != 0x00040000 && highTid != 0x00040002) + // Only dump user titles unless the user is prepared for pain. + if (highTid != 0x00040000 && highTid != 0x00040002 && !config.options[OPTION_LOADER_DUMPCODE_ALL]) return; char code_path[] = CODE_PATH; diff --git a/source/config.h b/source/config.h index f89a2c2..426b519 100644 --- a/source/config.h +++ b/source/config.h @@ -109,6 +109,9 @@ struct options_s // Hook firmlaunches. #define OPTION_REBOOT 19 +// Dump *all* code, from system applications, modules, etc. You'll be sitting around for about five minutes. +#define OPTION_LOADER_DUMPCODE_ALL 20 + // Save log files during boot and from loader. // This will slow things down a bit. #define OPTION_SAVE_LOGS 253 diff --git a/source/menu.c b/source/menu.c index f0dd19d..806f25d 100644 --- a/source/menu.c +++ b/source/menu.c @@ -43,8 +43,12 @@ static struct options_s options[] = { { OPTION_LOADER_CPU_800MHZ, " CPU - 800Mhz (n3ds)", "Forces the system to run in 800Mhz mode. Ignored if not a N3DS.", boolean_val_n3ds, 0, 0 }, { OPTION_LOADER_LANGEMU, " Language Emulation", "Reads language emulation configuration and imitates the region/language.", boolean_val, 0, 0 }, - { OPTION_LOADER_DUMPCODE, " Dump Code Sections (dev)", - "Dumps code sections for titles to SD card the first time they're loaded. This doesn't dump system titles. Slows things down considerably.", boolean_val, + { OPTION_LOADER_DUMPCODE, " Dump Title Code Sections", + "Dumps code sections for titles to SD card the first time they're loaded. Slows things down considerably.", boolean_val, + 0, 0 }, + + { OPTION_LOADER_DUMPCODE_ALL, " + System Titles", + "Dumps code sections for system titles, too. Expect to sit at a black screen for >3mins on the first time.", boolean_val, 0, 0 }, // space -- 2.39.5