Adapted changes to pre-set overworld flags to new initial sram system

This commit is contained in:
codemann8
2022-07-08 12:13:34 -05:00
parent df86503941
commit aec7b7077d
3 changed files with 5 additions and 8 deletions

View File

@@ -63,7 +63,6 @@ class World(object):
self.lock_aga_door_in_escape = False
self.save_and_quit_from_boss = True
self.accessibility = accessibility.copy()
self.initial_overworld_flags = {}
self.fix_skullwoods_exit = {}
self.fix_palaceofdarkness_exit = {}
self.fix_trock_exit = {}
@@ -122,7 +121,6 @@ class World(object):
set_player_attr('ganon_at_pyramid', True)
set_player_attr('ganonstower_vanilla', True)
set_player_attr('sewer_light_cone', self.mode[player] == 'standard')
set_player_attr('initial_overworld_flags', [0] * 0x80)
set_player_attr('fix_trock_doors', self.shuffle[player] != 'vanilla' or self.is_tile_swapped(0x05, player))
set_player_attr('fix_skullwoods_exit', self.shuffle[player] not in ['vanilla', 'simple', 'restricted', 'dungeonssimple'] or self.doorShuffle[player] not in ['vanilla'])
set_player_attr('fix_palaceofdarkness_exit', self.shuffle[player] not in ['vanilla', 'simple', 'restricted', 'dungeonssimple'])

View File

@@ -53,6 +53,9 @@ class InitialSram:
def pre_open_pyramid_hole(self):
self._or_value(OVERWORLD_DATA+0x5B, 0x20)
def pre_set_overworld_flag(self, owid, bitmask)
self._or_value(OVERWORLD_DATA+owid, bitmask)
def set_starting_equipment(self, world: object, player: int):
equip = [0] * (0x340 + 0x4F)
equip[0x36C] = 0x18

8
Rom.py
View File

@@ -1403,10 +1403,6 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
rom.write_byte(0x180174, 0x01 if world.fix_fake_world[player] else 0x00)
rom.write_byte(0x18017E, 0x01) # Fairy fountains only trade in bottles
# starting overworld flags
assert len(world.initial_overworld_flags[player]) == 0x80 and all([i < 0x100 for i in world.initial_overworld_flags[player]])
rom.write_bytes(0x183280, world.initial_overworld_flags[player])
# Starting equipment
if world.pseudoboots[player]:
rom.write_byte(0x18008E, 0x01)
@@ -2765,7 +2761,7 @@ def patch_shuffled_dark_sanc(world, rom, player):
dark_sanc_entrance = str([i for i in dark_sanc.entrances if i.parent_region.name != 'Menu'][0].name)
room_id, ow_area, vram_loc, scroll_y, scroll_x, link_y, link_x, camera_y, camera_x, unknown_1, unknown_2, door_1, door_2 = door_addresses[dark_sanc_entrance][1]
door_index = door_addresses[str(dark_sanc_entrance)][0]
world.initial_overworld_flags[player][ow_area] |= door_addresses[dark_sanc_entrance][2]
rom.initial_sram.pre_set_overworld_flag(ow_area, door_addresses[dark_sanc_entrance][2])
rom.write_byte(0x180241, 0x01)
rom.write_byte(0x180248, door_index + 1)
@@ -2780,7 +2776,7 @@ def patch_shuffled_bomb_shop(world, rom, player):
bomb_shop_entrance = str([i for i in bomb_shop.entrances if i.parent_region.name != 'Menu'][0].name)
room_id, ow_area, vram_loc, scroll_y, scroll_x, link_y, link_x, camera_y, camera_x, unknown_1, unknown_2, door_1, door_2 = door_addresses[bomb_shop_entrance][1]
door_index = door_addresses[str(bomb_shop_entrance)][0]
world.initial_overworld_flags[player][ow_area] |= door_addresses[bomb_shop_entrance][2]
rom.initial_sram.pre_set_overworld_flag(ow_area, door_addresses[bomb_shop_entrance][2])
rom.write_byte(0x180240, 0x02)
rom.write_byte(0x180247, door_index + 1)