mirror of
https://github.com/notwa/mm
synced 2024-11-05 01:19:02 -08:00
add rom fixing to command-line
This commit is contained in:
parent
25cbd24a2e
commit
335fe5ca9d
1 changed files with 8 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue