diff --git a/common.py b/common.py index 14df4b33..433322cd 100644 --- a/common.py +++ b/common.py @@ -197,6 +197,7 @@ ORDERSTRINGS = f"{PYTHON} {PPCDIS}/orderstrings.py" ORDERFLOATS = f"{PYTHON} {PPCDIS}/orderfloats.py" ASSETRIP = f"{PYTHON} {PPCDIS}/assetrip.py" ASSETINC = f"{PYTHON} {PPCDIS}/assetinc.py" +BATCHASSETRIP = f"{PYTHON} {PPCDIS}/batchassetrip.py" FORCEACTIVEGEN = f"{PYTHON} {PPCDIS}/forceactivegen.py" ELF2DOL = f"{PYTHON} {PPCDIS}/elf2dol.py" ELF2REL = f"{PYTHON} {PPCDIS}/elf2rel.py" diff --git a/configure.py b/configure.py index c56be844..3cd53d4b 100644 --- a/configure.py +++ b/configure.py @@ -10,6 +10,7 @@ import os import pickle import re import subprocess +import yaml from io import StringIO from sys import executable as PYTHON, platform @@ -102,6 +103,7 @@ n.variable("vtxdis", c.VTXDIS) n.variable("pal16dis", c.PAL16DIS) n.variable("arctool", c.ARC_TOOL) n.variable("sjiswrap", c.SJISWRAP) +n.variable("batchassetrip", c.BATCHASSETRIP) n.newline() ############## @@ -184,6 +186,12 @@ n.rule( description = "Asset include generation $out" ) +n.rule( + "batchassetrip", + command = "$batchassetrip $in $asset_yml", + description="Batch asset rip $asset_yml" +) + n.rule( "forceactivegen", command = "$forceactivegen $in $out", @@ -498,16 +506,29 @@ class AssetInclude(GeneratedInclude): return # Build + binary = None + asset_entries = {} + expected_files = [] for inc in includes: - n.build( - inc.asset_path, - rule="assetrip", - inputs=inc.asset.binary, - variables={ - "addrs" : f"{inc.asset.start:x} {inc.asset.end:x}" - } - ) + if binary == None: + binary = inc.asset.binary + asset_entries[inc.asset_path] = [inc.asset.start, inc.asset.end] + expected_files.append(inc.asset_path) + with open(f"{c.BUILDDIR}/{binary[7:10]}_assetrip.yml", 'w') as asset_yml: + yaml.dump(asset_entries, asset_yml) + + n.build( + outputs=expected_files, + rule = "batchassetrip", + inputs = binary, + variables = { + "asset_yml": f"{c.BUILDDIR}/{binary[7:10]}_assetrip.yml" + } + ) + + # Include + for inc in includes: if inc.asset.convtype == "vtx": n.build( inc.path, diff --git a/tools/ppcdis b/tools/ppcdis index ef416a97..14790bd5 160000 --- a/tools/ppcdis +++ b/tools/ppcdis @@ -1 +1 @@ -Subproject commit ef416a97fd2bc8ebc93f85abad928bc1f3ba52de +Subproject commit 14790bd56419e2c1912aa0bec969e210fe7a1765