Files
alttpr-baserom/doorframefixes.asm
Kevin Cathcart b3d8c23d89 Add door frame data for the multi-entrance caves. This will support
mixing single and multi-entrance caves.

I also added the alternate door frame table, which is needed for having
single entrance caves at
Sanctuary and Hyrule castle. (Added as a table rather than hard coding
the ids in order to be more friendly to level editors).

Updated the comments and function name to be clear that we are tracking
the overworld door
id, not the entrance id.

Remove the code that attempts to clear the entrance because the code is
broken (it lacked a needed ".w" suffix, so xkas miscompiled it) meaning
the value was never cleared, which has not caused any issues. Also
having the entrance ID around is generally useful.
2018-01-21 15:31:16 -05:00

40 lines
1.4 KiB
NASM

;================================================================================
; Door Frame Fixes
;================================================================================
;--------------------------------------------------------------------------------
; StoreLastOverworldDoorID
;--------------------------------------------------------------------------------
StoreLastOverworldDoorID:
TXA : INC
STA $7F5099
LDA $1BBB73, X : STA $010E
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; CacheDoorFrameData
;--------------------------------------------------------------------------------
CacheDoorFrameData:
LDA $7F5099 : BEQ .originalBehaviour
DEC : ASL : TAX
LDA EntranceDoorFrameTable, X : STA $0696
LDA EntranceAltDoorFrameTable, X : STA $0698
BRA .done
.originalBehaviour
LDA $D724, X : STA $0696
STZ $0698
.done
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; WalkDownIntoTavern
;--------------------------------------------------------------------------------
WalkDownIntoTavern:
LDA $7F5099
; tavern door has index 0x42 (saved off value is incremented by one)
CMP #$43
RTL
;--------------------------------------------------------------------------------