Minor ASM reorg

Fix for bonking across the TR chest gap
This commit is contained in:
aerinon
2020-09-09 16:03:43 -06:00
parent 1339bd4bc5
commit 309dc40f08
3 changed files with 17 additions and 19 deletions

10
Rom.py
View File

@@ -602,7 +602,7 @@ def patch_rom(world, rom, player, team, enemized):
# patch doors
if world.doorShuffle[player] == 'crossed':
rom.write_byte(0x139004, 2)
rom.write_byte(0x138002, 2)
for name, layout in world.key_layout[player].items():
offset = compass_data[name][4]//2
rom.write_byte(0x13f01c+offset, layout.max_chests + layout.max_drops)
@@ -621,7 +621,7 @@ def patch_rom(world, rom, player, team, enemized):
else:
logging.getLogger('').warning('Randomizer rom update! Compasses in crossed are borken')
if world.doorShuffle[player] == 'basic':
rom.write_byte(0x139004, 1)
rom.write_byte(0x138002, 1)
for door in world.doors:
if door.dest is not None and door.player == player and door.type in [DoorType.Normal, DoorType.SpiralStairs,
DoorType.Open, DoorType.StraightStairs]:
@@ -644,9 +644,11 @@ def patch_rom(world, rom, player, team, enemized):
dungeon_name = opposite_door.entrance.parent_region.dungeon.name
dungeon_id = boss_indicator[dungeon_name][0]
rom.write_byte(0x13f000+dungeon_id, opposite_door.roomIndex)
rom.write_byte(0x139006, dr_flags.value)
elif not opposite_door:
rom.write_byte(0x13f000+dungeon_id, 0) # no supertile preceeding boss
rom.write_byte(0x138004, dr_flags.value)
if dr_flags & DROptions.Town_Portal and world.mode[player] == 'inverted':
rom.write_byte(0x139008, 1)
rom.write_byte(0x138006, 1)
# fix skull woods exit, if not fixed during exit patching
if world.fix_skullwoods_exit[player] and world.shuffle[player] == 'vanilla':

View File

@@ -274,7 +274,7 @@ def global_rules(world, player):
set_rule(world.get_entrance('TR Hub NE', player), lambda state: state.has('Cane of Somaria', player))
set_rule(world.get_entrance('TR Torches NW', player), lambda state: state.has('Cane of Somaria', player) and state.has('Fire Rod', player))
set_rule(world.get_entrance('TR Big Chest Entrance Gap', player), lambda state: state.has('Cane of Somaria', player) or state.has('Hookshot', player))
set_rule(world.get_entrance('TR Big Chest Gap', player), lambda state: state.has('Cane of Somaria', player) or state.has('Hookshot', player))
set_rule(world.get_entrance('TR Big Chest Gap', player), lambda state: state.has('Cane of Somaria', player) or state.has_Boots(player))
set_rule(world.get_entrance('TR Dark Ride Up Stairs', player), lambda state: state.has('Cane of Somaria', player))
set_rule(world.get_entrance('TR Dark Ride SW', player), lambda state: state.has('Cane of Somaria', player))
set_rule(world.get_entrance('TR Crystal Maze Cane Path', player), lambda state: state.has('Cane of Somaria', player))

View File

@@ -14,6 +14,16 @@ incsrc drhooks.asm
;Main Code
org $278000 ;138000
db $44, $52 ;DR
DRMode:
dw 0
DRFlags:
dw 0
DRScroll:
db 0
OffsetTable:
dw -8, 8
incsrc normal.asm
incsrc scroll.asm
incsrc spiral.asm
@@ -22,20 +32,6 @@ incsrc keydoors.asm
incsrc overrides.asm
incsrc edges.asm
incsrc math.asm
warnpc $279000
; Data Section
org $279000
OffsetTable:
dw -8, 8
DRMode:
dw 0
DRFlags:
dw 0
DRScroll:
db 0
org $279030
incsrc hudadditions.asm
warnpc $279700