From 2cf2383c16ed764dfd7e091c3911b7f978bfd76f Mon Sep 17 00:00:00 2001 From: S Date: Sat, 13 Apr 2024 10:44:18 -0400 Subject: [PATCH] allow BPS to be encoded into the jsonout --- Main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Main.py b/Main.py index 2ebc4611..8e49e3f0 100644 --- a/Main.py +++ b/Main.py @@ -7,6 +7,7 @@ import RaceRandom as random import string import time import zlib +import base64 from BaseClasses import World, CollectionState, Item, Region, Location, Shop, Entrance, Settings from Bosses import place_bosses @@ -369,6 +370,10 @@ def main(args, seed=None, fish=None): if args.jsonout: jsonout[f'patch_t{team}_p{player}'] = rom.patches + if args.bps: + localRom = LocalRom.fromJsonRom(rom, args.rom) + patch = create_bps_from_data(LocalRom(args.rom, patch=False).buffer, localRom.buffer) + jsonout[f'bps_t{team}_p{player}'] = base64.b64encode(patch.binary_ba).decode() else: outfilepname = f'_T{team+1}' if world.teams > 1 else '' if world.players > 1: