-
Notifications
You must be signed in to change notification settings - Fork 53
/
lampmantlecone.asm
42 lines (42 loc) · 1.91 KB
/
lampmantlecone.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
40
41
42
;================================================================================
; Lamp Mantle & Light Cone Fix
;--------------------------------------------------------------------------------
; Output: 0 for darkness, 1 for lamp cone
;--------------------------------------------------------------------------------
LampCheck:
LDA.l LightConeModifier : CMP.b #$01 : BNE + : RTL : +
CMP.b #$FF : BNE + : INC : RTL : +
LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern
LDA.w DungeonID : BNE + ; check if we're in sewers
LDA.l LampConeSewers : RTL
+ : TDC
.lamp
RTL
;================================================================================
;--------------------------------------------------------------------------------
; Output: 0 locked, 1 open
;--------------------------------------------------------------------------------
CheckForZelda:
LDA.l ProgressIndicator : CMP.b #$02 : !BLT + ; Skip if rain is falling
LDA.b #$01 ; pretend we have zelda anyway
RTL
+
LDA.l FollowerIndicator
RTL
;================================================================================
SetOverlayIfLamp:
JSL.l LampCheck
STA.b SUBDESQ ; write it directly to the overlay, this isn't a terrible idea at all
RTL
;================================================================================
; Mantle Object Changes
;--------------------------------------------------------------------------------
Mantle_CorrectPosition:
LDA.l ProgressFlags : AND.b #$04 : BEQ +
LDA.b #$0A : STA.w SpritePosXLow, X ; just spawn it off to the side where we know it should be
LDA.b #$03 : STA.w SpritePosXHigh, X
LDA.b #$90 : STA.w SpriteSpawnStep, X
+
LDA.w SpritePosYLow, X : !ADD.b #$03 ; thing we did originally
RTL
;--------------------------------------------------------------------------------