summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAltoXorg <56553686+Alto1772@users.noreply.github.com>2023-08-16 08:26:23 +0800
committerGitHub <noreply@github.com>2023-08-15 19:26:23 -0500
commit9c01bfa5b2e6d0e6b7f7048a90699ace2eda3bd7 (patch)
tree2e485332f72c580f4c078d2f97af1d8590d1f8f7
parentac6820ee4360f397fc5344f37336d6b2548c341b (diff)
Opt-in for an easy-way CMake target to create soh.otr file (#3057)
* use a convenient cmake target for gen soh otr * Update generate-builds.yml * Apply for all conditions * grandma change
-rwxr-xr-xextract_assets.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/extract_assets.py b/extract_assets.py
index 53553da..c6d5282 100755
--- a/extract_assets.py
+++ b/extract_assets.py
@@ -33,6 +33,22 @@ def BuildOTR(xmlPath, rom, zapd_exe=None, genHeaders=None):
print("Aborting...", file=os.sys.stderr)
print("\n")
+def BuildSohOtr(zapd_exe=None):
+ shutil.copytree("assets", "Extract/assets")
+
+ if not zapd_exe:
+ zapd_exe = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
+
+ exec_cmd = [zapd_exe, "botr", "-se", "OTR", "--norom"]
+
+ print(exec_cmd)
+ exitValue = subprocess.call(exec_cmd)
+ if exitValue != 0:
+ print("\n")
+ print("Error when building soh.otr file...", file=os.sys.stderr)
+ print("Aborting...", file=os.sys.stderr)
+ print("\n")
+
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-z", "--zapd", help="Path to ZAPD executable", dest="zapd_exe", type=str)
@@ -40,9 +56,17 @@ def main():
parser.add_argument("--non-interactive", help="Runs the script non-interactively for use in build scripts.", dest="non_interactive", action="store_true")
parser.add_argument("-v", "--verbose", help="Display rom's header checksums and their corresponding xml folder", dest="verbose", action="store_true")
parser.add_argument("--gen-headers", help="Generate source headers to be checked in", dest="gen_headers", action="store_true")
+ parser.add_argument("--norom", help="Generate only soh.otr to be bundled to the game", dest="norom", action="store_true")
args = parser.parse_args()
+ if args.norom:
+ if (os.path.exists("Extract")):
+ shutil.rmtree("Extract")
+
+ BuildSohOtr(args.zapd_exe)
+ return
+
roms = [ Z64Rom(args.rom) ] if args.rom else rom_chooser.chooseROM(args.verbose, args.non_interactive)
for rom in roms:
if (os.path.exists("Extract")):