allow BPS to be encoded into the jsonout

This commit is contained in:
S
2024-04-13 10:44:18 -04:00
committed by aerinon
parent ebd86e80d7
commit 2cf2383c16

View File

@@ -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: