diff --git a/darkworldspawn.asm b/darkworldspawn.asm index 63b0584..26cef6a 100644 --- a/darkworldspawn.asm +++ b/darkworldspawn.asm @@ -39,7 +39,6 @@ RTL ;-------------------------------------------------------------------------------- SetDeathWorldChecked: - PHA LDA $1B : BEQ + ; skip this for indoors LDA $040C : CMP #$FF : BNE .done ; unless it's a cave @@ -52,12 +51,10 @@ SetDeathWorldChecked: LDA.b #$00 : STA $7EF3CA : STA $7E0FFF ; set the world to the light world if he's still alive LDA $7EF3CC : CMP #$07 : BNE .done : LDA.b #$08 : STA $7EF3CC ; convert frog to dwarf .done - PLA RTL .pyramid LDA #$40 : STA $7EF3CA ; set flag to dark world LDA $7EF3CC : CMP #$08 : BNE + : LDA.b #$07 : STA $7EF3CC : + ; convert dwarf to frog - PLA RTL ;-------------------------------------------------------------------------------- FakeWorldFix: @@ -80,4 +77,11 @@ FixAgahnimFollowers: LDA.b #$00 : STA $7EF3CC ; clear follower JSL PrepDungeonExit ; thing we wrote over RTL +;-------------------------------------------------------------------------------- +SetSilverBowMode: + LDA SilverArrowsUseRestriction : BEQ + ; fix bow type for restricted arrow mode + LDA $7EF340 : CMP.b #$3 : !BLT + + !SUB.b #$02 : STA $7EF340 + + +RTL ;================================================================================ diff --git a/events.asm b/events.asm index ddbad22..960abb5 100644 --- a/events.asm +++ b/events.asm @@ -17,12 +17,20 @@ RTL ; STA $7EC172 ; thing we wrote over ;RTL ;-------------------------------------------------------------------------------- +OnPlayerDead: + PHA + JSL.l SetDeathWorldChecked + JSL.l SetSilverBowMode + PLA +RTL +;-------------------------------------------------------------------------------- OnDungeonExit: STA $040C : STZ $04AC ; thing we wrote over PHA : PHP JSL.l HUD_RebuildLong JSL.l FloodGateResetInner + JSL.l SetSilverBowMode PLP : PLA RTL ;-------------------------------------------------------------------------------- @@ -67,10 +75,7 @@ OnFileLoad: LDA $7EF38B : STA $7EF36F ; copy generic keys to key counter + - LDA SilverArrowsUseRestriction : BEQ + ; fix bow type for restricted arrow mode - LDA $7EF340 : CMP.b #$3 : !BLT + - !SUB.b #$02 : STA $7EF340 - + + JSL.l SetSilverBowMode LDA $7EF3C5 : CMP.b #$01 : BNE .notrain ; check if we're in rain state .rain diff --git a/hooks.asm b/hooks.asm index 39cbef9..a468590 100644 --- a/hooks.asm +++ b/hooks.asm @@ -1747,7 +1747,7 @@ JSL.l DarkWorldLoadFix NOP #7 ;-------------------------------------------------------------------------------- org $09F520 ; <- 4F520 - module_death.asm : 401 (LDA $7EF3C5 : CMP.b #$03 : BCS BRANCH_THETA) -JSL.l SetDeathWorldChecked +JSL.l OnPlayerDead JSL.l IncrementDeathCounter NOP #6 ;--------------------------------------------------------------------------------