Dark room modes

This commit is contained in:
2025-03-09 13:25:22 -05:00
parent 0bb4d6579e
commit bc966c0f99
3 changed files with 25 additions and 4 deletions

View File

@@ -2182,6 +2182,9 @@ JSL LampCheck
;--------------------------------------------------------------------------------
org $81F503 ; <- F503 - Bank01.asm:14994 (LDA.b #$01 : STA $1D)
JSL SetOverlayIfLamp
;--------------------------------------------------------------------------------
org $81B610 ; <- loading whether room is dark
JSL DarkRoomCheck
;================================================================================
;================================================================================

View File

@@ -6,12 +6,30 @@
LampCheck:
LDA.l LightConeModifier : BNE .lamp
LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern
LDA.l LampCone : AND.b #$10 : BNE .lamp
LDA.w DungeonID : CMP.b #$04 : BCS + ; are we en HC?
LDA.l LampConeSewers : RTL
LDA.l LampCone : AND.b #$01 : RTL
+ : TDC
.lamp
RTL
;================================================================================
; Dark Room checks
;--------------------------------------------------------------------------------
; Output: 0 for normal room, 1 for darkness
;--------------------------------------------------------------------------------
DarkRoomCheck:
LDA.l LampCone : AND.b #$20 : BNE .no_dark
LDA.b [$0D], Y
AND.b #$01
RTL
.no_dark
LDA.b $A0 : ORA.b $A1 : BNE .not_dark
LDA.b #$01 ; ganon's room
RTL
.not_dark
LDA.b #$00 ; not ganon's room, so no darkness
RTL
;================================================================================
;--------------------------------------------------------------------------------
; Output: 0 locked, 1 open
;--------------------------------------------------------------------------------

View File

@@ -110,8 +110,8 @@ RupoorDeduction:
dw $000A ; #$0A - Default (10 decimal)
;--------------------------------------------------------------------------------
org $B08038 ; PC 0x180038
LampConeSewers:
db $01 ; #$00 = Off - #$01 = On (default)
LampCone:
db $01 ; #$00 = Off - #$01 = On in Sewers (default) - #$10 = On Always - #$20 = No Dark Rooms
;--------------------------------------------------------------------------------
org $B08039 ; PC 0x180039
ItemCounterHUD: