fix for getting arrow item

This commit is contained in:
sporchia
2018-02-14 18:02:48 -05:00
parent 6a6b22c3d5
commit c0a088dffa

View File

@@ -1,9 +1,12 @@
CheckEnoughRupeeArrows: CheckEnoughRupeeArrows:
{ {
LDA $0B99 : BNE .minigame_arrow LDA $0B99 : BNE .minigame_arrow
PHX ;save X value which is ancilla of the arrow LDA $7EF340 : CMP #$03 : BCS .skip_arrow_check ;03 is the silver bow without arrows
LDA $7EF377 : BEQ .no_arrows
.skip_arrow_check
PHX
REP #$30 ;Set 16bit mode REP #$30 ;Set 16bit mode
LDA $7EF340 : AND #$00FF : TAX ;check what bow we have LDA $7EF340 : AND #$00FF : TAX
LDA $7EF360 : CMP.l .rupees_cost, X : BCC .not_enough_rupees ;Load Rupees count LDA $7EF360 : CMP.l .rupees_cost, X : BCC .not_enough_rupees ;Load Rupees count
SBC.l .rupees_cost, X : STA $7EF360 ;decrease rupee by 5 SBC.l .rupees_cost, X : STA $7EF360 ;decrease rupee by 5
@@ -19,6 +22,7 @@ CheckEnoughRupeeArrows:
.not_enough_rupees .not_enough_rupees
SEP #$30 SEP #$30
PLX PLX
.no_arrows
LDA #$00 ;Return 00 if we don't have enough rupee so it despawn the arrow LDA #$00 ;Return 00 if we don't have enough rupee so it despawn the arrow
RTL RTL