From 842f6bf1ac7d5b0c978687db4f85acf28048f48f Mon Sep 17 00:00:00 2001 From: Bonta-kun <40473493+Bonta0@users.noreply.github.com> Date: Sun, 15 Dec 2019 10:54:49 +0100 Subject: [PATCH] rom: correct gametype flag --- Main.py | 3 +-- Rom.py | 9 +++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Main.py b/Main.py index 32a43246..fb9f122f 100644 --- a/Main.py +++ b/Main.py @@ -159,8 +159,7 @@ def main(args, seed=None): rom = JsonRom() else: rom = LocalRom(args.rom) - - patch_rom(world, player, rom) + patch_rom(world, player, rom, use_enemizer) enemizer_patch = [] if use_enemizer: diff --git a/Rom.py b/Rom.py index 76cc1cce..da5574df 100644 --- a/Rom.py +++ b/Rom.py @@ -420,7 +420,7 @@ class Sprite(object): # split into palettes of 15 colors return array_chunk(palette_as_colors, 15) -def patch_rom(world, player, rom): +def patch_rom(world, player, rom, enemized): random.seed(world.rom_seeds[player]) # progressive bow silver arrow hint hack @@ -855,7 +855,12 @@ def patch_rom(world, player, rom): # TODO: a proper race rom mode should be implemented, that changes the following flag, and rummages the table (or uses the future encryption feature, etc) rom.write_bytes(0x180213, [0x00, 0x01]) # Not a Tournament Seed - rom.write_byte(0x180211, 0x06) #Game type, we set the Entrance and item randomization flags + gametype = 0x04 # item + if world.shuffle != 'vanilla': + gametype |= 0x02 # entrance + if enemized: + gametype |= 0x01 # enemizer + rom.write_byte(0x180211, gametype) # Game type # assorted fixes rom.write_byte(0x1800A2, 0x01) # remain in real dark world when dying in dark world dungeon before killing aga1