1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2025-02-05 13:23:23 -08:00

add rom fixing to command-line

This commit is contained in:
Connor Olding 2016-04-09 04:17:15 -07:00
parent 25cbd24a2e
commit 335fe5ca9d

View file

@ -264,7 +264,6 @@ def create_rom(d, compress=False):
pe = 0xFFFFFFFF pe = 0xFFFFFFFF
ve = vs ve = vs
assert(start_v <= rom_size) assert(start_v <= rom_size)
assert(start_v + size_v <= rom_size) assert(start_v + size_v <= rom_size)
assert(vs < rom_size) assert(vs < rom_size)
@ -284,10 +283,18 @@ def create_rom(d, compress=False):
def run(args): def run(args):
compress = False compress = False
fix = False
for path in args: for path in args:
if path == '-c': if path == '-c':
compress = not compress compress = not compress
continue 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 # directories are technically files, so check this first
if os.path.isdir(path): if os.path.isdir(path):
create_rom(path, compress) create_rom(path, compress)