Files
alttpr-baserom/lampmantlecone.asm
cassidoxa 788cceaab9 Continue labeling and documentation in ram.asm, main rando block
Deleted several unused modules and some commented code
Reorganized some routines to clean up modules
Moved some memory into mirrored WRAM
Refactored NMI hook aux routine
Removed old fake flipper fix
2022-11-16 21:38:28 -05:00

41 lines
1.5 KiB
NASM

;================================================================================
; 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 .done ; skip if we already have lantern
LDA.l CurrentWorld : BNE +
.lightWorld
LDA.w $040C : BNE ++ ; check if we're in sewers
LDA.l LampConeSewers : BRA .done
++
LDA.l LampConeLightWorld : BRA .done
+
.darkWorld
LDA.l LampConeDarkWorld
.done
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 $1D ; write it directly to the overlay, this isn't a terrible idea at all
RTL
;================================================================================