From fb977da30e6fbebb8beb43269ac564b701dd19cf Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 15 Jan 2023 17:12:58 -0600 Subject: [PATCH] Add Music cursor routines --- Menu/menu.asm | 22 ++++----- Menu/menu_select_item.asm | 98 +++++++++++++++++++++++++-------------- 2 files changed, 74 insertions(+), 46 deletions(-) diff --git a/Menu/menu.asm b/Menu/menu.asm index 8d2f597..c4d56d3 100644 --- a/Menu/menu.asm +++ b/Menu/menu.asm @@ -287,13 +287,13 @@ Menu_StatsScreen: BRA .no_inputs .move_right - JSR Menu_DeleteCursor - JSR Menu_FindNextItem + JSR Menu_DeleteSongCursor + JSR Menu_FindNextSong BRA .draw_cursor .move_left - JSR Menu_DeleteCursor - JSR Menu_FindPrevItem + JSR Menu_DeleteSongCursor + JSR Menu_FindPrevSong BRA .draw_cursor .draw_cursor @@ -304,7 +304,7 @@ Menu_StatsScreen: LDA.w $02D5 ASL : TAY REP #$10 - LDX.w Menu_OcarinaSongPositions-2, Y + LDX.w Menu_OcarinaSongPositions, Y LDA.b #$20 : BIT.w $0207 @@ -315,16 +315,16 @@ Menu_StatsScreen: LDA.w #$20F5 STA.w $1108, X STA.w $1148, X - STA.w $114E, X - STA.w $110E, X - STA.w $11C8, X + STA.w $114E, X + STA.w $110E, X + STA.w $11C8, X STA.w $1188, X - STA.w $118E, X - STA.w $11CE, X + STA.w $118E, X + STA.w $11CE, X BRA .done .no_delete - + LDA.w #$3060 : STA.w $1108, X ; corner LDA.w #$3070 : STA.w $1148, X diff --git a/Menu/menu_select_item.asm b/Menu/menu_select_item.asm index 95bb684..1f4ba20 100644 --- a/Menu/menu_select_item.asm +++ b/Menu/menu_select_item.asm @@ -77,13 +77,6 @@ Menu_ItemCursorPositions: ; ----------------------------------------------------------------------------- -Menu_OcarinaSongPositions: - dw menu_offset(15,12) ; song of - dw menu_offset(15,15) ; song of - dw menu_offset(15,18) ; song of - -; ----------------------------------------------------------------------------- - Menu_FindNextItem: { @@ -190,34 +183,69 @@ Menu_InitItemScreen: RTS } +; ============================================================================= +; Song Selection Code + ; ----------------------------------------------------------------------------- -; $0303[0x01] - (Player) +Menu_SongAddressIndex: + db $01 + db $02 + db $03 -; In conjunction with the above variable when set to 0x13, matching the above -; variable, the cape transformation is complete. - -; This indicates which secondary item is equipped (aka Y-button -; item). - -; 0x00 - Nothing -; 0x01 - Bombs -; 0x02 - Boomerang -; 0x03 - Arrows -; 0x04 - Hammer -; 0x05 - Fire Rod -; 0x06 - Ice Rod -; 0x07 - Bug catching net -; 0x08 - Flute -; 0x09 - Lamp -; 0x0A - Magic Powder -; 0x0B - Bottle -; 0x0C - Book of Mudora -; 0x0D - Cane of Byrna -; 0x0E - Hookshot -; 0x0F - Bombos Medallion -; 0x10 - Ether Medallion -; 0x11 - Quake Medallion -; 0x12 - Cane of Somaria -; 0x13 - Cape -; 0x14 - Magic Mirror \ No newline at end of file +; ----------------------------------------------------------------------------- + +Menu_OcarinaSongPositions: + dw menu_offset(16,12) ; song of + dw menu_offset(16,15) ; song of + dw menu_offset(16,18) ; song of + +; ----------------------------------------------------------------------------- + +Menu_FindNextSong: +{ + LDY.w $02D5 : INY + CPY.b #$03 : BCC .no_reset + LDY.b #$01 +.no_reset + STY.w $02D5 + LDX.w Menu_SongAddressIndex-1, Y + LDA.l $7EF407, X + BEQ Menu_FindNextSong + RTS +} + +; ----------------------------------------------------------------------------- + +Menu_FindPrevSong: +{ + LDY.w $02D5 : DEY : BNE .no_reset + LDY.b #$02 +.no_reset + STY.w $02D5 + LDX.w Menu_SongAddressIndex-1, Y + LDA.l $7EF407, X + BEQ Menu_FindPrevSong + RTS +} + +; ----------------------------------------------------------------------------- + +Menu_DeleteSongCursor: +{ + REP #$30 + LDX.w Menu_OcarinaSongPositions-2, Y + + LDA.w #$20F5 + STA.w $1422, X + STA.w $1462, X + STA.w $14A2, X + STA.w $14E2, X + STA.w $11C8, X + STA.w $1188, X + STA.w $118E, X + STA.w $11CE, X + SEP #$30 + STZ $0207 + RTS +}