From efcd0f0ac3305ccc1baa2a3107c98cffea8efc66 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 8 Dec 2024 20:12:12 -0500 Subject: [PATCH] menu housekeeping --- Menu/menu_gfx_table.asm | 30 +++++++++---------- Menu/menu_hud.asm | 57 +++++++++++++++++------------------ Menu/menu_text.asm | 66 ++++++++++++++++++++--------------------- 3 files changed, 76 insertions(+), 77 deletions(-) diff --git a/Menu/menu_gfx_table.asm b/Menu/menu_gfx_table.asm index b30ce9e..ff38ca0 100644 --- a/Menu/menu_gfx_table.asm +++ b/Menu/menu_gfx_table.asm @@ -7,7 +7,7 @@ NothingGFX: dw $20F5, $20F5, $20F5, $20F5 - + ; --------------------------------------------------------- BowsGFX: @@ -97,7 +97,7 @@ BigChestKeyGFX: ; --------------------------------------------------------- MapGFX: - dw $2936, $2937, $2946, $2947 + dw $2936, $2937, $2946, $2947 ; --------------------------------------------------------- @@ -113,7 +113,7 @@ JumpFeatherGFX: ; --------------------------------------------------------- BookGFX: - dw $3CA5, $3CA6, $3CD8, $3CD9 + dw $3CA5, $3CA6, $3CD8, $3CD9 ; --------------------------------------------------------- @@ -132,7 +132,7 @@ BottlesGFX: ; --------------------------------------------------------- SomariaGFX: - dw $24DC, $24DD, $24EC, $24ED + dw $24DC, $24DD, $24EC, $24ED ; --------------------------------------------------------- @@ -140,7 +140,7 @@ ByrnaGFX: dw $2CDC, $2CDD, $2CEC, $2CED FishingRodGFX: - dw $2C82, $2C83, $2C8B, $2C8C + dw $2C82, $2C83, $2C8B, $2C8C PortalRodGFX: dw $2CF0, $24F1, $30EC, $E4F0 @@ -149,7 +149,7 @@ PortalRodGFX: ; formerly Magic Cape StoneMaskGFX: - dw $30B4, $30B5, $30C4, $30C5 + dw $30B4, $30B5, $30C4, $30C5 ; --------------------------------------------------------- @@ -172,7 +172,7 @@ MirrorGFX: dw $2C62, $2C63, $2C72, $2C73 ; Mirror -; ============================================================================= +; ========================================================= ; Collectibles ; --------------------------------------------------------- @@ -218,7 +218,7 @@ DekuStickGFX: ; Equipped Items PegasusBootsGFX: - dw $2429, $242A, $242B, $242C ; Pegasus Boots + dw $2429, $242A, $242B, $242C ; Pegasus Boots ; --------------------------------------------------------- @@ -229,18 +229,18 @@ PowerGloveGFX: ; --------------------------------------------------------- FlippersGFX: - dw $2C9A, $2C9B, $2C9D, $2C9E + dw $2C9A, $2C9B, $2C9D, $2C9E ; --------------------------------------------------------- MoonPearlGFX: - dw $2433, $2434, $2435, $2436 + dw $2433, $2434, $2435, $2436 ; --------------------------------------------------------- SwordGFX: - dw $2C64, $2CCE, $2C75, $EC64 ; level one - dw $2C64, $2C65, $2C74, $2D26 ; level two + dw $2C64, $2CCE, $2C75, $EC64 ; level one + dw $2C64, $2C65, $2C74, $2D26 ; level two dw $248A, $2465, $3C74, $2D48 ; level three dw $288A, $2865, $2C74, $2D39 ; level four @@ -259,7 +259,7 @@ TunicGFX: dw $2468, $6468, $2478, $6478 ; red tunic ; ============================================================================= -; Static Text on the Menu +; Static Text on the Menu SelectItemTXT: dw $2562, $2554, $255B, $2554 @@ -269,11 +269,11 @@ SelectItemTXT: QuestStatusTXT: dw $2560, $2564, $2554, $2562 dw $2563, $2417, $2562, $2563 - dw $2550, $2563, $2564, $2562 + dw $2550, $2563, $2564, $2562 AreaNameTXT: dw $243F, $2550, $2561, $2554 dw $2550, $2417, $255D, $2550 dw $255C, $2554, $241C, $2430 dw $2430, $2430, $2430, $2430 - dw $2430, $2430, $2430, $2430 \ No newline at end of file + dw $2430, $2430, $2430, $2430 diff --git a/Menu/menu_hud.asm b/Menu/menu_hud.asm index 92bc1d7..c55f1a9 100644 --- a/Menu/menu_hud.asm +++ b/Menu/menu_hud.asm @@ -324,36 +324,35 @@ HUD_UpdateHearts: ; Draws hearts in a painfully slow loop LDX.w #$0000 -.next_heart + .next_heart LDA.b $00 : CMP.w #$0008 : BCC .less_than_one_heart - ; Notice no SEC was needed since carry is assumedly set. - SBC.w #$0008 : STA.b $00 - LDY.w #$0004 - JSR .draw_heart - INX #2 - BRA .next_heart + ; Notice no SEC was needed since carry is assumedly set. + SBC.w #$0008 : STA.b $00 + LDY.w #$0004 + JSR .draw_heart + INX #2 + BRA .next_heart + .less_than_one_heart -.less_than_one_heart CMP.w #$0005 : BCC .half_heart_or_less - LDY.w #$0004 - BRA .draw_heart + LDY.w #$0004 + BRA .draw_heart + .half_heart_or_less -.half_heart_or_less CMP.w #$0001 : BCC .empty_heart - LDY.w #$0002 - BRA .draw_heart - -.empty_heart + LDY.w #$0002 + BRA .draw_heart + .empty_heart RTS -.draw_heart + .draw_heart ; Compare number of hearts so far on current line to 10 CPX.w #$0014 : BCC .no_line_change - ; if not, we have to move down one tile in the tilemap - LDX.w #$0000 - LDA.b $07 : CLC : ADC.w #$0040 : STA.b $07 + ; if not, we have to move down one tile in the tilemap + LDX.w #$0000 + LDA.b $07 : CLC : ADC.w #$0040 : STA.b $07 + .no_line_change -.no_line_change LDA.b [$0A], Y : TXY : STA.b [$07], Y RTS } @@ -362,26 +361,26 @@ HUD_UpdateHearts: HexToDecimal: { - REP #$30 - STZ $0003 - LDX.w #$0000 - LDY.w #$0002 -.next_digit - CMP $F9F9, Y : BCC .next_lowest_10s_place + REP #$30 + STZ $0003 + LDX.w #$0000 + LDY.w #$0002 + .next_digit + CMP $F9F9, Y : BCC .next_lowest_10s_place SEC : SBC $F9F9, Y INC $03, X BRA .next_digit -.next_lowest_10s_place + .next_lowest_10s_place INX : DEY #2 BPL .next_digit STA $05 SEP #$30 LDX.b #$02 -.set_next_digit_tile + .set_next_digit_tile LDA $03, X : CMP.b #$7F BEQ .blank_digit ORA.b #$90 -.blank_digit + .blank_digit STA $03, X DEX : BPL .set_next_digit_tile RTS diff --git a/Menu/menu_text.asm b/Menu/menu_text.asm index 953c4b0..bd6bd1d 100644 --- a/Menu/menu_text.asm +++ b/Menu/menu_text.asm @@ -358,7 +358,7 @@ DrawCollectibleNamesAndCount: RTS } -DrawGoldstarName: +DrawGoldstarName: { REP #$30 LDX.w #$0000 @@ -370,7 +370,7 @@ DrawGoldstarName: RTS } -DrawMushroomName: +DrawMushroomName: { REP #$30 LDX.w #$0000 @@ -387,15 +387,15 @@ DrawMushroomName: DrawLocationName: { REP #$30 - LDA $1B ; check if indoors or outdoors - AND.w #$00FF ; isolate bit - CMP.w #$01 ; if 1, then indoors + LDA $1B ; check if indoors or outdoors + AND.w #$00FF ; isolate bit + CMP.w #$01 ; if 1, then indoors BEQ .indoors - + LDA.b $8A ASL #5 LDY.w #$000 - TAX + TAX .draw_overworld_loop LDA.w OverworldLocationNames, X ; Load your text character @@ -412,8 +412,8 @@ DrawLocationName: .draw_indoors_loop LDA.w DungeonLocationNames, Y : STA.w $12CC, X - - INY : INY + + INY : INY INX : INX : CPX #$0020 : BCC .draw_indoors_loop RTS } @@ -467,23 +467,23 @@ Menu_DrawAreaNameTXT: ; ========================================================= ; Player's Name -; $3D9-$3E4: See appendix for listing of character codes. +; $3D9-$3E4: See appendix for listing of character codes. ; Note each of the six letters is represented by a 16-bit number. ; -; 00-A 01-B 02-C 03-D 04-E 05-F 06=G 07-H -; 08-I^ 09-J 0A-K 0B-L 0C-M 0D-N OE-O OF-P -; 10-?? 20-Q 21-R 22-S 23-T 24-U 25-V -; 26-W 27-X 28-Y 29-Z +; 00-A 01-B 02-C 03-D 04-E 05-F 06=G 07-H +; 08-I^ 09-J 0A-K 0B-L 0C-M 0D-N OE-O OF-P +; 10-?? 20-Q 21-R 22-S 23-T 24-U 25-V +; 26-W 27-X 28-Y 29-Z ; -; 2A-a 2B-b-2C-c 2D-d 2E-e 2F-f 40-g 41-h -; 42-k 43-j 44-i 45-l 46-m 47-n 48-o 49-p +; 2A-a 2B-b-2C-c 2D-d 2E-e 2F-f 40-g 41-h +; 42-k 43-j 44-i 45-l 46-m 47-n 48-o 49-p ; 4A-q 4B-r 4C-s 4D-t 4E-u 4F-v 60-w 61-x 62-y 63-z ; ; 64-0 65-1 66-2 67-3 68-4 69-5 6A-6 6B-7 6C-8 6D-9 6E-"?" 6F-"!" ; 80-"-" -; 81-"." -; 82-"," -; 85-"(" 86-")" +; 81-"." +; 82-"," +; 85-"(" 86-")" ; ; B1-blank^ ; @@ -505,30 +505,30 @@ Menu_DrawCharacterName: REP #$30 LDX.w #$C -.draw_name_loop - ; Player's Name in memory, indexed by X + .draw_name_loop + ; Player's Name in memory, indexed by X LDA.l $7EF3D9, X - - ; Check if the character is the special encoding for "I" first. - CMP.w #$AF : BEQ .fix_i - ; Check if it is the gap between the P and Q characters + ; Check if the character is the special encoding for "I" first. + CMP.w #$AF : BEQ .fix_i + + ; Check if it is the gap between the P and Q characters CMP.w #$10 : BCC .write_to_screen ; handle P, Q gap SBC.b #$10 CLC - CMP.w #$2A : BCS .fix_lowercase - -.write_to_screen + CMP.w #$2A : BCS .fix_lowercase + + .write_to_screen CLC : ADC #$2550 : STA.w $134C, X DEX : DEX : BPL .draw_name_loop RTS -.fix_i - LDA.w #$08 : BRA .write_to_screen + .fix_i + LDA.w #$08 : BRA .write_to_screen -.fix_lowercase - ; TODO: Convert the lowercase value of 2A or greater inside of the - ; accumulator and convert it to an uppercase value. + .fix_lowercase + ; TODO: Convert the lowercase value of 2A or greater inside of the + ; accumulator and convert it to an uppercase value. LDA.w #$1D : BRA .write_to_screen }