diff --git a/hooks.asm b/hooks.asm index 0f5af4e..d33ff4a 100755 --- a/hooks.asm +++ b/hooks.asm @@ -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 ;================================================================================ ;================================================================================ @@ -2736,4 +2739,4 @@ NOP #2 ; this fixes Link's direction after mirroring and falling after entering ; Enable new room header table ;-------------------------------------------------------------------------------- org $81B5E6 -LDA.b #$30 \ No newline at end of file +LDA.b #$30 diff --git a/lampmantlecone.asm b/lampmantlecone.asm index b0f00e8..7d1de70 100644 --- a/lampmantlecone.asm +++ b/lampmantlecone.asm @@ -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 ;-------------------------------------------------------------------------------- diff --git a/tables.asm b/tables.asm index d381a17..c3feb2d 100644 --- a/tables.asm +++ b/tables.asm @@ -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: