From e2d230f29396f9a7e8523426ceef4fbc4bd432bb Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Sun, 2 Jun 2019 19:56:15 +0800 Subject: [PATCH] SuperMario: respect 68K segmented code rsrc name --- tbxi/supermario_dump.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tbxi/supermario_dump.py b/tbxi/supermario_dump.py index c337f07..70a8581 100644 --- a/tbxi/supermario_dump.py +++ b/tbxi/supermario_dump.py @@ -114,6 +114,7 @@ def dump(binary, dest_dir): # now for the tricky bit: resources :( unavail_filenames = set(['', '.pef']) + types_where_Main_should_be_in_filename = set() for i, offset in enumerate(extract_resource_offsets(binary)): rsrc_dir = path.join(dest_dir, 'Rsrc') @@ -129,9 +130,12 @@ def dump(binary, dest_dir): data = binary[entry.offsetToData:][:mmhead.dataSizePlus12 - 12] report_combo_field = COMBO_FIELDS.get(entry.combo, '0b' + bin(entry.combo >> 56)[2:].zfill(8)) + if entry.rsrcName == b'%A5Init': + types_where_Main_should_be_in_filename.add(entry.rsrcType) + # create a friendly ascii filename for the resource filename = '%s_%d' % (sanitize_macroman(entry.rsrcType), entry.rsrcID) - if len(entry.rsrcName) > 0 and entry.rsrcName != b'Main': # uninformative artifact of rom build + if entry.rsrcName != b'Main' or entry.rsrcType in types_where_Main_should_be_in_filename: filename += '_' + sanitize_macroman(entry.rsrcName) if report_combo_field != 'AllCombos': filename += '_' + report_combo_field.replace('AppleTalk', 'AT')