fix #729 - building titlekeys.bin files

* fix #729

* Improved code layout & show NAND type when building support files
This commit is contained in:
TimmSkiller 2021-10-23 14:14:53 +03:00 committed by GitHub
parent 7feeb51a65
commit 0dbe70928f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View File

@ -2166,8 +2166,9 @@ u32 HomeMoreMenu(char* current_path) {
bool tik_enc_sys = false; bool tik_enc_sys = false;
bool tik_enc_emu = false; bool tik_enc_emu = false;
if (BuildTitleKeyInfo(NULL, false, false) == 0) { if (BuildTitleKeyInfo(NULL, false, false) == 0) {
ShowString("Building " TIKDB_NAME_ENC "..."); ShowString("Building " TIKDB_NAME_ENC " (SysNAND)...");
tik_enc_sys = (BuildTitleKeyInfo("1:/dbs/ticket.db", false, false) == 0); tik_enc_sys = (BuildTitleKeyInfo("1:/dbs/ticket.db", false, false) == 0);
ShowString("Building " TIKDB_NAME_ENC " (EmuNAND)...");
tik_enc_emu = (BuildTitleKeyInfo("4:/dbs/ticket.db", false, false) == 0); tik_enc_emu = (BuildTitleKeyInfo("4:/dbs/ticket.db", false, false) == 0);
if (!tik_enc_sys || BuildTitleKeyInfo(NULL, false, true) != 0) if (!tik_enc_sys || BuildTitleKeyInfo(NULL, false, true) != 0)
tik_enc_sys = tik_enc_emu = false; tik_enc_sys = tik_enc_emu = false;
@ -2175,8 +2176,9 @@ u32 HomeMoreMenu(char* current_path) {
bool tik_dec_sys = false; bool tik_dec_sys = false;
bool tik_dec_emu = false; bool tik_dec_emu = false;
if (BuildTitleKeyInfo(NULL, true, false) == 0) { if (BuildTitleKeyInfo(NULL, true, false) == 0) {
ShowString("Building " TIKDB_NAME_DEC "..."); ShowString("Building " TIKDB_NAME_DEC " (SysNAND)...");
tik_dec_sys = (BuildTitleKeyInfo("1:/dbs/ticket.db", true, false) == 0); tik_dec_sys = (BuildTitleKeyInfo("1:/dbs/ticket.db", true, false) == 0);
ShowString("Building " TIKDB_NAME_DEC " (EmuNAND)...");
tik_dec_emu = (BuildTitleKeyInfo("4:/dbs/ticket.db", true, false) == 0); tik_dec_emu = (BuildTitleKeyInfo("4:/dbs/ticket.db", true, false) == 0);
if (!tik_dec_sys || BuildTitleKeyInfo(NULL, true, true) != 0) if (!tik_dec_sys || BuildTitleKeyInfo(NULL, true, true) != 0)
tik_dec_sys = tik_dec_emu = false; tik_dec_sys = tik_dec_emu = false;
@ -2184,8 +2186,9 @@ u32 HomeMoreMenu(char* current_path) {
bool seed_sys = false; bool seed_sys = false;
bool seed_emu = false; bool seed_emu = false;
if (BuildSeedInfo(NULL, false) == 0) { if (BuildSeedInfo(NULL, false) == 0) {
ShowString("Building " SEEDINFO_NAME "..."); ShowString("Building " SEEDINFO_NAME " (SysNAND)...");
seed_sys = (BuildSeedInfo("1:", false) == 0); seed_sys = (BuildSeedInfo("1:", false) == 0);
ShowString("Building " SEEDINFO_NAME " (EmuNAND)...");
seed_emu = (BuildSeedInfo("4:", false) == 0); seed_emu = (BuildSeedInfo("4:", false) == 0);
if (!seed_sys || BuildSeedInfo(NULL, true) != 0) if (!seed_sys || BuildSeedInfo(NULL, true) != 0)
seed_sys = seed_emu = false; seed_sys = seed_emu = false;

View File

@ -3741,12 +3741,13 @@ u32 BuildTitleKeyInfo(const char* path, bool dec, bool dump) {
return 1; return 1;
} }
} else if (filetype & SYS_TICKDB) { } else if (filetype & SYS_TICKDB) {
u32 num_entries = GetNumTickets(PART_PATH); u32 num_entries = 0;
if (!num_entries) return 1; u8* title_ids = NULL;
u8* title_ids = (u8*) malloc(num_entries * 8);
if (!title_ids) return 1;
if (!InitImgFS(path_in) || (ListTicketTitleIDs(PART_PATH, title_ids, num_entries) != 0)) { if (!InitImgFS(path_in) ||
!(num_entries = GetNumTickets(PART_PATH)) ||
!(title_ids = (u8*) malloc(num_entries * 8)) ||
(ListTicketTitleIDs(PART_PATH, title_ids, num_entries) != 0)) {
free(title_ids); free(title_ids);
InitImgFS(NULL); InitImgFS(NULL);
return 1; return 1;