diff --git a/events.asm b/events.asm index 913818f..cad6942 100644 --- a/events.asm +++ b/events.asm @@ -185,7 +185,7 @@ RTL ;-------------------------------------------------------------------------------- OnLinkDamaged: JSL.l IncrementDamageTakenCounter_Arb - JSL.l FlipperKill + ;JSL.l FlipperKill JML.l OHKOTimer ;-------------------------------------------------------------------------------- diff --git a/flipperkill.asm b/flipperkill.asm index ac782c2..6f8c420 100644 --- a/flipperkill.asm +++ b/flipperkill.asm @@ -68,3 +68,70 @@ MysteryWaterFunction: ; *$3AE54 ALTERNATE ENTRY POINT STZ $0360 RTL ;-------------------------------------------------------------------------------- + + +;=================================================================================================== +; More elegant solution +;=================================================================================================== + +protectff: + LDA.l AllowAccidentalMajorGlitch + BEQ .yes_protect + + RTL + +.yes_protect + REP #$30 + + LDA.b $20 + AND.w #$1E00 + ASL + ASL + ASL + STA.b $06 + + LDA.b $22 + AND.w #$1E00 + ORA.b $06 + + XBA + LSR + TAX + + SEP #$30 + + ; Remove dark world bit + ; in game table that converts coordinates to actual screen ID + ; special case for other areas + LDA.b $8A + BMI .special_overworld + + AND.b #$3F + CMP.l $02A4E3,X + BEQ ++ + +.protect + LDA.b #$15 + STA.b $5D + + STZ.b $2E + STZ.b $67 + + LDA.b #$02 + STA.b $2F + + STZ.w $0112 + STZ.w $02E4 + STZ.w $0FFC + +++ RTL + +.special_overworld + CMP.l .spow,X + BNE .protect + + RTL + +.spow + db $80, $81, $81, $FF, $FF, $FF, $FF, $FF + db $FF, $81, $81, $FF, $FF, $FF, $FF, $FF \ No newline at end of file diff --git a/hooks.asm b/hooks.asm index 11950d5..7155833 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2319,8 +2319,17 @@ JSL.l OnLinkDamagedFromPit org $01FFE7 ; <- FFE7 - Bank01.asm:16375 (LDA $7EF36D) JSL.l OnLinkDamagedFromPitOutdoors ;-------------------------------------------------------------------------------- -org $078F27 ; <- 38F27 -JSL.l FlipperReset +org $02B468 +dw FakeFlipperProtection + +org $02FFC7 +FakeFlipperProtection: + JSR.w $029485 + JSL protectff + RTS +;-------------------------------------------------------------------------------- +;org $078F27 ; <- 38F27 +;JSL.l FlipperReset ;-------------------------------------------------------------------------------- org $09F40B ; <- 4F40B - module_death.asm:222 (LDX.b #$00) JSL.l IgnoreFairyCheck