fixed a bug that cased item text to draw even when no items were available

This commit is contained in:
Jared_Brian_
2024-03-16 20:41:47 -06:00
parent 4c1bd60cf3
commit b13c5e5d28
2 changed files with 47 additions and 37 deletions

View File

@@ -1,8 +1,7 @@
; =========================================================
; Tilemap Menu background
; This function is bled into via the previous menu.asm function.
; This function is bled into via the previous menu.asm file.
Menu_DrawBackground:
{
REP #$30

View File

@@ -119,6 +119,17 @@ Menu_SongNames:
Menu_DrawItemName:
{
SEP #$30
; Double check that we have the item.
LDY.w $0202
LDX.w Menu_AddressIndex-1, Y
LDA.l $7EF300, X
CMP.b #$01 : BCS .haveItem
REP #$30
RTS
.haveItem
LDA.w $0202 : CMP.b #$03 : BEQ .goldstar
LDA.w $0202 : CMP.b #$0D : BEQ .ocarina
; Check if it's a bottle
@@ -150,6 +161,7 @@ Menu_DrawItemName:
REP #$30 : LDX #$0002 : JMP .draw_bottle
.bottle_4
REP #$30 : LDX #$0003
.draw_bottle
JSR DrawBottleNames
RTS
@@ -164,15 +176,14 @@ Menu_DrawItemName:
; Check the timer and see if we should draw the item name
LDA $1A : AND.w #$00FF : CMP #$0080 : BCC .draw_item
LDA $030F : BEQ .draw_item
LDA $030F : AND.w #$00FF : DEC : ASL #5 : TAX
LDY.w #$0000
.draw_ocarina_loop
LDA.w Menu_SongNames, X : STA.w $1692, Y
INX #2 : INY #2 : CPY #$001C : BCC .draw_ocarina_loop
RTS
}
DrawBottleNames: