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.
This commit is contained in:
Kevin Cathcart
2018-01-21 14:48:16 -05:00
parent 7e8be73077
commit b3d8c23d89
3 changed files with 42 additions and 20 deletions

View File

@@ -3,17 +3,12 @@
;================================================================================
;--------------------------------------------------------------------------------
; StoreLastEntranceID
; StoreLastOverworldDoorID
;--------------------------------------------------------------------------------
StoreLastEntranceID:
CPX #$003a : BCC .noStore
TXA : SBC #$3a
BRA .done
.noStore
LDA #$00
.done
STA $7F5099
LDA $1BBB73, X : STA $010E
StoreLastOverworldDoorID:
TXA : INC
STA $7F5099
LDA $1BBB73, X : STA $010E
RTL
;--------------------------------------------------------------------------------
@@ -24,13 +19,12 @@ 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
.done
STZ $0698
LDA #$00
STA $7F5099
.done
RTL
;--------------------------------------------------------------------------------
@@ -39,6 +33,7 @@ RTL
;--------------------------------------------------------------------------------
WalkDownIntoTavern:
LDA $7F5099
CMP #$08
; tavern door has index 0x42 (saved off value is incremented by one)
CMP #$43
RTL
;--------------------------------------------------------------------------------