Code:
# since we will only have three possible results to these, these are
# hardcoded variables for convenience
# these could be generated but given this, I'm not doing that
# this is still ugly even after the rewrite, but it works
tmd_padding = b'\0' * 12 # padding to add at the end of the tmd
content_count = b'\x01'
tmd_size = b'\x34\x0B\0\0\0\0\0\0'
content_index = b'\x80' # one extra bit in binary for each content
# this is assuming that a game has a manual if it also has a dlp child
# I've not seen a case of the opposite yet
if manual_cfa_offset != 0:
tmd_padding = b'\0' * 28
one extra bit in binary for each content,
this is assuming that a game has a manual if it also has a dlp child
I've not seen a case of the opposite yet
I know of one game that has a 'DLP child' but no 'manual':
Cooking_Mama_4_Kitchen_Magic_USA_3DS-VENOM (No-Intro #0090)
I remember trying to convert and install this but the CIA install failed,
I never looked into why, I assume its to do with the code above.