From 4aeec9819763cbdff137ed2db6bf7e00f33b29b0 Mon Sep 17 00:00:00 2001 From: Kevin Cathcart Date: Mon, 17 Sep 2018 23:00:57 -0400 Subject: [PATCH] Prevent mirroring into entrances in inverted --- entrances.asm | 13 +++++++++++++ hooks.asm | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/entrances.asm b/entrances.asm index 8064930..1af2514 100644 --- a/entrances.asm +++ b/entrances.asm @@ -141,3 +141,16 @@ CheckHole: LDA.l ExtraHole_Entrance, X : STA.w $010E : STZ.w $010F JML Overworld_Hole_End ;-------------------------------------------------------------------------------- +PreventEnterOnBonk: + STA $00 ; part of what we wrote over + LDA.l InvertedMode : AND.w #$00FF : BEQ .done + LDA.l $5D : AND.w #$00FF : CMP.w #$0014 : BNE .done ;in mirror mode? + LDA.b $8A : AND.w #$0040 : CMP $7B : BEQ .done ; Are we bonking, or doing the superbunny glitch? + + ; If in inverted, are in mirror mode, and are bonking then do not enter + JML.l PreventEnterOnBonk_BRANCH_IX + + .done + LDX.w #$0102 ; rest of what we wrote over +JML.l PreventEnterOnBonk_return +;-------------------------------------------------------------------------------- diff --git a/hooks.asm b/hooks.asm index f9b871f..9411175 100755 --- a/hooks.asm +++ b/hooks.asm @@ -269,6 +269,13 @@ NOP #19 ;23 bytes removed with the JSL org $04E7AE ; <- bank0E.asm : 4230 (LDA $7EF287 : AND.w #$0020) JSL.l TurtleRockPegSolved ;-------------------------------------------------------------------------------- +org $1BBD05 ; <- bank1B.asm : 261 (TYA : STA $00) ; hook starts at the STA +JML.l PreventEnterOnBonk +NOP +PreventEnterOnBonk_return: +org $1BBD77 ; <- bank1B.asm : 308 (SEP #$30) +PreventEnterOnBonk_BRANCH_IX: +;-------------------------------------------------------------------------------- ;================================================================================