menu housekeeping

This commit is contained in:
scawful
2024-12-08 20:12:12 -05:00
parent 70f13ff1c0
commit efcd0f0ac3
3 changed files with 76 additions and 77 deletions

View File

@@ -172,7 +172,7 @@ MirrorGFX:
dw $2C62, $2C63, $2C72, $2C73 ; Mirror
; =============================================================================
; =========================================================
; Collectibles
; ---------------------------------------------------------

View File

@@ -324,7 +324,7 @@ 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
@@ -332,28 +332,27 @@ HUD_UpdateHearts:
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
.half_heart_or_less
.half_heart_or_less
CMP.w #$0001 : BCC .empty_heart
LDY.w #$0002
BRA .draw_heart
.empty_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
.no_line_change
.no_line_change
LDA.b [$0A], Y : TXY : STA.b [$07], Y
RTS
}
@@ -366,22 +365,22 @@ HexToDecimal:
STZ $0003
LDX.w #$0000
LDY.w #$0002
.next_digit
.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

View File

@@ -505,7 +505,7 @@ Menu_DrawCharacterName:
REP #$30
LDX.w #$C
.draw_name_loop
.draw_name_loop
; Player's Name in memory, indexed by X
LDA.l $7EF3D9, X
@@ -518,16 +518,16 @@ Menu_DrawCharacterName:
CLC
CMP.w #$2A : BCS .fix_lowercase
.write_to_screen
.write_to_screen
CLC : ADC #$2550 : STA.w $134C, X
DEX : DEX : BPL .draw_name_loop
RTS
.fix_i
.fix_i
LDA.w #$08 : BRA .write_to_screen
.fix_lowercase
.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