From d583386d0b1ec1ae40cae78bde9fca437fb00039 Mon Sep 17 00:00:00 2001 From: Myramong Date: Sat, 2 Feb 2019 02:00:07 -0400 Subject: [PATCH] retro.asm: make rupee bow work properly in archery minigame. tables.asm: set ArrowMode default back to 0. --- retro.asm | 21 ++++++++++++++------- tables.asm | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/retro.asm b/retro.asm index c96e1b7..50276d2 100644 --- a/retro.asm +++ b/retro.asm @@ -38,14 +38,21 @@ DecrementArrows: DEC : STA $7EF377 : INC BRA .done .rupees - LDA $7EF377 : BEQ .done ; don't have arrows, we're done - LDA $7EF340 : AND.b #$01 : BEQ + - LDA.b $0B99 : BNE + ; Arrow Game active and has credits left - LDA.b $0B9A : BNE + ; Arrow Game active and on last arrow - LDA.b #$00 : RTL - + + REP #$20 + LDA.b $A0 : CMP #$0111 : BNE .not_archery_game + LDA.b $A2 : BNE .not_archery_game ; in overworld + SEP #$20 + LDA.w $0B9A : BEQ .shoot_arrow ; arrow game active + LDA.b #$00 : BRA .done + + .not_archery_game + SEP #$20 + LDA.l $7EF377 : BNE .shoot_arrow ; check if we have arrows + BRA .done + + .shoot_arrow PHX - REP #$20 ; set 16-bit accumulator + REP #$20 LDA $7EF360 : BEQ + PHA : LDA $7EF340 : DEC : AND #$0002 : TAX : PLA !SUB.l ArrowModeWoodArrowCost, X ; CMP.w #$0000 diff --git a/tables.asm b/tables.asm index a547b26..365ccbe 100644 --- a/tables.asm +++ b/tables.asm @@ -795,7 +795,7 @@ db #$01 ; #00 = Fix Off (Default) - #$01 = Fix On ;================================================================================ org $308175 ; PC 0x180175 - 0x180179 ArrowMode: -db #$01 ; #00 = Normal (Default) - #$01 = Rupees +db #$00 ; #00 = Normal (Default) - #$01 = Rupees ArrowModeWoodArrowCost: ; keep these together dw #$000A ; #$000A = 10 (Default) ArrowModeSilverArrowCost: ; keep these together