From 335fe5ca9da2956b4bd8b48b7914c2c773af2a37 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 9 Apr 2016 04:17:15 -0700 Subject: [PATCH] add rom fixing to command-line --- z64dump.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/z64dump.py b/z64dump.py index bd6413b..05ee24b 100755 --- a/z64dump.py +++ b/z64dump.py @@ -264,7 +264,6 @@ def create_rom(d, compress=False): pe = 0xFFFFFFFF ve = vs - assert(start_v <= rom_size) assert(start_v + size_v <= rom_size) assert(vs < rom_size) @@ -284,10 +283,18 @@ def create_rom(d, compress=False): def run(args): compress = False + fix = False for path in args: if path == '-c': compress = not compress continue + if path == '-f': + fix = not fix + continue + if fix: + with open(path, 'r+b') as f: + fix_rom(f) + continue # directories are technically files, so check this first if os.path.isdir(path): create_rom(path, compress)