Add fw dumping

- also fatfs is stupid
- also close files properly on a failed copy
- also check for errors during folder readouts
- also make sure holding vol- doesn't dump the keys anyway
This commit is contained in:
suchmememanyskill
2020-12-28 02:29:58 +01:00
parent 859ad2cc4c
commit 513bd804b1
18 changed files with 222 additions and 29 deletions

View File

@@ -271,6 +271,7 @@ void ipl_main()
emu_cfg.enabled = !h_cfg.emummc_force_disable;
h_cfg.emummc_force_disable = 1;
TConf.pkg1ID = "Unk";
hidInit();
@@ -290,7 +291,7 @@ void ipl_main()
int res = -1;
if (DumpKeys() || btn_read() & BTN_VOL_DOWN)
if (btn_read() & BTN_VOL_DOWN || DumpKeys())
res = GetKeysFromFile("sd:/switch/prod.keys");
TConf.keysDumped = (res > 0) ? 0 : 1;