From 6980d36d27eff8dae2eac1fdb856573a36e94e22 Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Sat, 26 Aug 2023 00:52:13 +0200 Subject: [PATCH] Fix issue with rooms $0124-$0127 at Tavern Back --- doorframefixes.asm | 15 ++++++++++++++- hooks.asm | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doorframefixes.asm b/doorframefixes.asm index c233c26..a5ecb3d 100644 --- a/doorframefixes.asm +++ b/doorframefixes.asm @@ -74,4 +74,17 @@ WalkUpOnOverworld: RTL .normal LDA #$0002 : STA $2F ; what we overwrote -RTL \ No newline at end of file +RTL + +;-------------------------------------------------------------------------------- +; CheckStairsAdjustment +;-------------------------------------------------------------------------------- +CheckStairsAdjustment: + LDA.b $A0 + CMP.w #$0124 ; vanilla check, rooms $0124 to $0127 have a lower exit position (currently ER ignores the entrance location) + BCC .done + LDA.w #$FFFF-1 + CMP.w $0696 ; tavern back ($0696 == #$FFFF) should always have carry cleared +.done +RTL +; if carry cleared, shift position up \ No newline at end of file diff --git a/hooks.asm b/hooks.asm index 9e1c1e1..7291a0a 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2923,5 +2923,9 @@ org $02E297 ; LDA.w #$0002 : STA.b $2F JSL WalkUpOnOverworld NOP +org $02E36F +JSL CheckStairsAdjustment +NOP + org $02D7D2 ; BEQ .face_up NOP #2 ; this fixes Link's direction after mirroring and falling after entering through back of tavern \ No newline at end of file