mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Make all final roms 4 MiB to hide enemizer
This commit is contained in:
2
Main.py
2
Main.py
@@ -235,7 +235,7 @@ def main(args, seed=None):
|
||||
"-nohints" if not world.hints[
|
||||
player] else "")) if not args.outputname else ''
|
||||
rompath = output_path(f'{outfilebase}{outfilepname}{outfilesuffix}.sfc')
|
||||
rom.write_to_file(rompath)
|
||||
rom.write_to_file(rompath, hide_enemizer=True)
|
||||
if args.create_diff:
|
||||
Patch.create_patch_file(rompath)
|
||||
return player, team, bytes(rom.name).decode()
|
||||
|
11
Rom.py
11
Rom.py
@@ -44,7 +44,16 @@ class LocalRom(object):
|
||||
def write_bytes(self, startaddress: int, values):
|
||||
self.buffer[startaddress:startaddress + len(values)] = values
|
||||
|
||||
def write_to_file(self, file):
|
||||
def write_to_file(self, file, hide_enemizer=False):
|
||||
|
||||
if hide_enemizer:
|
||||
extra_zeroes = 0x400000 - len(self.buffer)
|
||||
logging.info(extra_zeroes)
|
||||
if extra_zeroes > 0:
|
||||
buffer = self.buffer + bytes([0x00] * extra_zeroes)
|
||||
with open(file, 'wb') as outfile:
|
||||
outfile.write(buffer)
|
||||
return
|
||||
with open(file, 'wb') as outfile:
|
||||
outfile.write(self.buffer)
|
||||
|
||||
|
Reference in New Issue
Block a user