1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-11-04 22:49:03 -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
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)