-
Notifications
You must be signed in to change notification settings - Fork 53
/
doorframefixes.asm
39 lines (36 loc) · 1.52 KB
/
doorframefixes.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
;================================================================================
; Door Frame Fixes
;================================================================================
;--------------------------------------------------------------------------------
; StoreLastOverworldDoorID
;--------------------------------------------------------------------------------
StoreLastOverworldDoorID:
TXA : INC
STA.l PreviousOverworldDoor
LDA.l $9BBB73, X : STA.w EntranceIndex
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; CacheDoorFrameData
;--------------------------------------------------------------------------------
CacheDoorFrameData:
LDA.l PreviousOverworldDoor : BEQ .originalBehaviour
DEC : ASL : TAX
LDA.l EntranceDoorFrameTable, X : STA.w TileMapEntranceDoors
LDA.l EntranceAltDoorFrameTable, X : STA.w TileMapTile32
BRA .done
.originalBehaviour
LDA.w $D724, X : STA.w TileMapEntranceDoors
STZ.w TileMapTile32
.done
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; WalkDownIntoTavern
;--------------------------------------------------------------------------------
WalkDownIntoTavern:
LDA.l PreviousOverworldDoor
; tavern door has index 0x42 (saved off value is incremented by one)
CMP.b #$43
RTL
;--------------------------------------------------------------------------------