Skip to content

Commit

Permalink
Fix titledb entry manual detection
Browse files Browse the repository at this point in the history
  • Loading branch information
d0k3 committed Aug 2, 2020
1 parent 8298809 commit 521fb25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions arm9/source/game/tie.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

u32 BuildTitleInfoEntryTmd(TitleInfoEntry* tie, TitleMetaData* tmd, bool sd) {
u64 title_id = getbe64(tmd->title_id);
u32 has_id1 = false;
u32 has_idx1 = false;

// set basic values
memset(tie, 0x00, sizeof(TitleInfoEntry));
Expand All @@ -25,14 +25,14 @@ u32 BuildTitleInfoEntryTmd(TitleInfoEntry* tie, TitleMetaData* tmd, bool sd) {
tie->title_size =
(align_size * 3) + // base folder + 'content' + 'cmd'
align(TMD_SIZE_N(content_count), align_size) + // TMD
align_size; // CMD, placeholder
align_size; // CMD, placeholder (!!!)
for (u32 i = 0; (i < content_count) && (i < TMD_MAX_CONTENTS); i++, chunk++) {
if (getbe32(chunk->id) == 1) has_id1 = true; // will be useful later
if (getbe16(chunk->index) == 1) has_idx1 = true; // will be useful later
tie->title_size += align(getbe64(chunk->size), align_size);
}

// manual? (we need to properly check this later)
if (has_id1 && (((title_id >> 32) == 0x00040000) || ((title_id >> 32) == 0x00040010))) {
if (has_idx1 && (((title_id >> 32) == 0x00040000) || ((title_id >> 32) == 0x00040010))) {
tie->flags_0[0] = 0x1; // this may have a manual
}

Expand Down
1 change: 0 additions & 1 deletion arm9/source/utils/nandcmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ u32 CheckFixCmdCmac(const char* path, bool fix, bool check_perms) {
return 1;
}


// we abuse the unknown u32 to mark custom, unfinished CMDs
bool fix_missing = false;
if (cmd->unknown == 0xFFFFFFFE) {
Expand Down

0 comments on commit 521fb25

Please sign in to comment.