update current ring selection logic and draw

This commit is contained in:
scawful
2024-07-10 22:03:04 -04:00
parent 5030d5aec6
commit c554991500
2 changed files with 38 additions and 4 deletions

View File

@@ -652,7 +652,7 @@ Menu_RingBox:
REP #$10
LDX.w Menu_RingIconCursorPositions, Y
JSR Menu_DrawCursor
JSR Submenu_Return
JSR RingMenu_Controls
SEP #$20
LDA.b #$22 : STA.w $0116
@@ -669,6 +669,40 @@ Menu_RingIconCursorPositions:
dw menu_offset(12,10)
dw menu_offset(12,14)
RingMenu_Controls:
{
; Load the current ring selected (0-5) into A
REP #$30
LDA.w $020B
AND.w #$00FF
SEP #$30
; Set the current ring to the cursor position
TAY ; Transfer A to Y for indexing
LDA.b $F6 : BIT.b #$80 : BEQ + ; Check if the confirm button is pressed
print pc
LDA .rings, Y ; Load the ring bitmask
AND.l MAGICRINGS ; Check if the ring is owned
BEQ + ; If not, skip setting the ring
INY #2
TYA ; Transfer Y to A
STA.l RingSlot1 ; Set RingSlot1 to the selected ring bitmask
+
; Return to item menu if player presses X
LDA.b $F6 : BIT.b #$40 : BEQ +
LDA.b #$01 : STA.w $0200
+
; Close the menu if the player presses start
LDA.b $F4 : BIT.b #$10 : BEQ +
LDA.b #$08 : STA.w $0200
+
RTS
.rings
db $20, $10, $08, $04, $02, $01
}
Submenu_Return:
{
; Return to the item menu if they press A

View File

@@ -764,7 +764,7 @@ Menu_DrawRingBox:
Menu_DrawMagicRings:
{
LDA.l RingSlot1 : AND.w #$00FF : CMP.w #$0001 : BCC .no_attack
LDA.w #$0002 : BRA .draw_storms
BRA .draw_storms
.no_attack
LDA.w #$0001
.draw_storms
@@ -774,7 +774,7 @@ Menu_DrawMagicRings:
JSR DrawMenuItem
LDA.l RingSlot2 : AND.w #$00FF : CMP.w #$0001 : BCC .no_defense
LDA.w #$0003 : BRA .draw_defense
BRA .draw_defense
.no_defense
LDA.w #$0001
.draw_defense
@@ -784,7 +784,7 @@ Menu_DrawMagicRings:
JSR DrawMenuItem
LDA.l RingSlot3 : AND.w #$00FF : CMP.w #$0001 : BCC .no_luck
LDA.w #$0004 : BRA .draw_luck
BRA .draw_luck
.no_luck
LDA.w #$0001
.draw_luck