diff --git a/Main.py b/Main.py index fe62cbb5a3..42e5af512b 100644 --- a/Main.py +++ b/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() diff --git a/Rom.py b/Rom.py index 4ea5eb5fa0..f8a020bcc8 100644 --- a/Rom.py +++ b/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)