From b52404469b5ffa908220e50835086c3ed83d97c9 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Fri, 1 Sep 2023 16:32:39 -0500 Subject: [PATCH] Fix gold bugnet mothula, bugnet on B --- LTTP_RND_GeneralBugfixes.asm | 3 +++ hooks.asm | 7 +++---- special_weapons.asm | 32 ++++++++++++++++++++------------ 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 1850433..7d86090 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -660,6 +660,9 @@ Link_ReceiveItem: org $079F82 Link_UseHammer: +org $07AFEE +Link_UseBugNet: + org $07A985 SetGameModeLikeMirror: diff --git a/hooks.asm b/hooks.asm index c6cf485..82557c6 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2968,9 +2968,6 @@ db $B2, $28, $B3, $28, $C2, $28, $C2, $68 org $079CE6 ; Bank07.asm@4632 (LDA #$80 : TSB $3A) JSL CheckDetonateBomb ;-------------------------------------------------------------------------------- -org $079D08 ; bank_07.asm@6068 (INC $3C : LDA $3C : CMP #$09) -JSL NoSwingHammerB : NOP #2 -;-------------------------------------------------------------------------------- org $1EDCF8 ; bank_1E.asm@16086 (LDX $0202 : ...) JSL SetBeeType BRA + : NOP #15 : + @@ -2987,7 +2984,9 @@ NOP #48 skip 11 .bee_valid_target ;-------------------------------------------------------------------------------- -org $07F88C ; free rom from F877 - F88F; the starting part of this is used in quadrant glitch fix below, however. +org $07F888 ; free rom from F877 - F88F; the starting part of this is used in quadrant glitch fix in overworld fork, however. +Link_UseBugNetLong: +JSR Link_UseBugNet : RTL Link_UseHammerLong: JSR Link_UseHammer : RTL warnpc $07F890 diff --git a/special_weapons.asm b/special_weapons.asm index 54da1e2..4982537 100644 --- a/special_weapons.asm +++ b/special_weapons.asm @@ -470,13 +470,20 @@ CheckDetonateBomb: .not_bomb_mode LDA.l SpecialWeapons : CMP.b #$06 : BEQ .release_bee CMP.b #$07 : BEQ .hammer + CMP.b #$08 : BEQ .net BRA .done .hammer LDA.l HammerEquipment : BEQ .done LDA.b $3A : ORA.b #$40 : STA.b $3A LDA.b #$04 : STA.w $0304 JSL Link_UseHammerLong - BRA .done + RTL +.net + LDA.l BugNetEquipment : BEQ .done + LDA.b $3A : ORA.b #$40 : STA.b $3A + LDA.b #$07 : STA.w $0304 + JSL Link_UseBugNetLong + RTL .release_bee LDX.w $0202 LDA.l BeeDamageClass, X : CMP.b #$FF : BEQ .nope @@ -603,16 +610,6 @@ SEP #$10 PLP : PLX RTS ;-------------------------------------------------------------------------------- -NoSwingHammerB: -LDA.l SpecialWeapons : CMP.b #$07 : BNE .normal -LDA.l HammerEquipment : BEQ .normal -SEC : RTL -.normal ; what we wrote over -INC.b $3C -LDA.b $3C -CMP.b #$09 -RTL -;-------------------------------------------------------------------------------- CheckBugNet: LDA.w $037A : AND.b #$10 : BEQ .done ; normal behavior if not bugnet LDA.l SpecialWeapons : CMP.b #$08 : BNE .return_10 ; normal behavior if not bugnet mode @@ -629,7 +626,18 @@ RTL SetHammerClass: LDA.l SpecialWeapons : CMP.b #$08 : BNE .normal ; normal behavior if not bugnet mode LDA.w $037A : AND.b #$10 : BEQ .normal ; normal behavior if not bugnet -LDA.l SpecialWeaponLevel : STA.w $0CF2 +LDA 4, S : TAX ; get sprite index off of stack +LDA.w $0E20, X : CMP.b #$88 : BNE .not_mothula +LDA.l SpecialWeaponLevel +CMP #$04 : !BGE .fix_mothula +BRA .done +.fix_mothula +LDA #$03 +BRA .done +.not_mothula +LDA.l SpecialWeaponLevel +.done +STA.w $0CF2 RTL .normal LDA.w $0301