menu housekeeping
This commit is contained in:
@@ -172,7 +172,7 @@ MirrorGFX:
|
|||||||
dw $2C62, $2C63, $2C72, $2C73 ; Mirror
|
dw $2C62, $2C63, $2C72, $2C73 ; Mirror
|
||||||
|
|
||||||
|
|
||||||
; =============================================================================
|
; =========================================================
|
||||||
; Collectibles
|
; Collectibles
|
||||||
; ---------------------------------------------------------
|
; ---------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -324,36 +324,35 @@ HUD_UpdateHearts:
|
|||||||
; Draws hearts in a painfully slow loop
|
; Draws hearts in a painfully slow loop
|
||||||
LDX.w #$0000
|
LDX.w #$0000
|
||||||
|
|
||||||
.next_heart
|
.next_heart
|
||||||
LDA.b $00 : CMP.w #$0008 : BCC .less_than_one_heart
|
LDA.b $00 : CMP.w #$0008 : BCC .less_than_one_heart
|
||||||
; Notice no SEC was needed since carry is assumedly set.
|
; Notice no SEC was needed since carry is assumedly set.
|
||||||
SBC.w #$0008 : STA.b $00
|
SBC.w #$0008 : STA.b $00
|
||||||
LDY.w #$0004
|
LDY.w #$0004
|
||||||
JSR .draw_heart
|
JSR .draw_heart
|
||||||
INX #2
|
INX #2
|
||||||
BRA .next_heart
|
BRA .next_heart
|
||||||
|
.less_than_one_heart
|
||||||
|
|
||||||
.less_than_one_heart
|
|
||||||
CMP.w #$0005 : BCC .half_heart_or_less
|
CMP.w #$0005 : BCC .half_heart_or_less
|
||||||
LDY.w #$0004
|
LDY.w #$0004
|
||||||
BRA .draw_heart
|
BRA .draw_heart
|
||||||
|
.half_heart_or_less
|
||||||
|
|
||||||
.half_heart_or_less
|
|
||||||
CMP.w #$0001 : BCC .empty_heart
|
CMP.w #$0001 : BCC .empty_heart
|
||||||
LDY.w #$0002
|
LDY.w #$0002
|
||||||
BRA .draw_heart
|
BRA .draw_heart
|
||||||
|
.empty_heart
|
||||||
.empty_heart
|
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.draw_heart
|
.draw_heart
|
||||||
; Compare number of hearts so far on current line to 10
|
; Compare number of hearts so far on current line to 10
|
||||||
CPX.w #$0014 : BCC .no_line_change
|
CPX.w #$0014 : BCC .no_line_change
|
||||||
; if not, we have to move down one tile in the tilemap
|
; if not, we have to move down one tile in the tilemap
|
||||||
LDX.w #$0000
|
LDX.w #$0000
|
||||||
LDA.b $07 : CLC : ADC.w #$0040 : STA.b $07
|
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
|
LDA.b [$0A], Y : TXY : STA.b [$07], Y
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -362,26 +361,26 @@ HUD_UpdateHearts:
|
|||||||
|
|
||||||
HexToDecimal:
|
HexToDecimal:
|
||||||
{
|
{
|
||||||
REP #$30
|
REP #$30
|
||||||
STZ $0003
|
STZ $0003
|
||||||
LDX.w #$0000
|
LDX.w #$0000
|
||||||
LDY.w #$0002
|
LDY.w #$0002
|
||||||
.next_digit
|
.next_digit
|
||||||
CMP $F9F9, Y : BCC .next_lowest_10s_place
|
CMP $F9F9, Y : BCC .next_lowest_10s_place
|
||||||
SEC : SBC $F9F9, Y
|
SEC : SBC $F9F9, Y
|
||||||
INC $03, X
|
INC $03, X
|
||||||
BRA .next_digit
|
BRA .next_digit
|
||||||
.next_lowest_10s_place
|
.next_lowest_10s_place
|
||||||
INX : DEY #2
|
INX : DEY #2
|
||||||
BPL .next_digit
|
BPL .next_digit
|
||||||
STA $05
|
STA $05
|
||||||
SEP #$30
|
SEP #$30
|
||||||
LDX.b #$02
|
LDX.b #$02
|
||||||
.set_next_digit_tile
|
.set_next_digit_tile
|
||||||
LDA $03, X : CMP.b #$7F
|
LDA $03, X : CMP.b #$7F
|
||||||
BEQ .blank_digit
|
BEQ .blank_digit
|
||||||
ORA.b #$90
|
ORA.b #$90
|
||||||
.blank_digit
|
.blank_digit
|
||||||
STA $03, X
|
STA $03, X
|
||||||
DEX : BPL .set_next_digit_tile
|
DEX : BPL .set_next_digit_tile
|
||||||
RTS
|
RTS
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ DrawMushroomName:
|
|||||||
DrawLocationName:
|
DrawLocationName:
|
||||||
{
|
{
|
||||||
REP #$30
|
REP #$30
|
||||||
LDA $1B ; check if indoors or outdoors
|
LDA $1B ; check if indoors or outdoors
|
||||||
AND.w #$00FF ; isolate bit
|
AND.w #$00FF ; isolate bit
|
||||||
CMP.w #$01 ; if 1, then indoors
|
CMP.w #$01 ; if 1, then indoors
|
||||||
BEQ .indoors
|
BEQ .indoors
|
||||||
@@ -505,7 +505,7 @@ Menu_DrawCharacterName:
|
|||||||
REP #$30
|
REP #$30
|
||||||
LDX.w #$C
|
LDX.w #$C
|
||||||
|
|
||||||
.draw_name_loop
|
.draw_name_loop
|
||||||
; Player's Name in memory, indexed by X
|
; Player's Name in memory, indexed by X
|
||||||
LDA.l $7EF3D9, X
|
LDA.l $7EF3D9, X
|
||||||
|
|
||||||
@@ -518,16 +518,16 @@ Menu_DrawCharacterName:
|
|||||||
CLC
|
CLC
|
||||||
CMP.w #$2A : BCS .fix_lowercase
|
CMP.w #$2A : BCS .fix_lowercase
|
||||||
|
|
||||||
.write_to_screen
|
.write_to_screen
|
||||||
CLC : ADC #$2550 : STA.w $134C, X
|
CLC : ADC #$2550 : STA.w $134C, X
|
||||||
DEX : DEX : BPL .draw_name_loop
|
DEX : DEX : BPL .draw_name_loop
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.fix_i
|
.fix_i
|
||||||
LDA.w #$08 : BRA .write_to_screen
|
LDA.w #$08 : BRA .write_to_screen
|
||||||
|
|
||||||
.fix_lowercase
|
.fix_lowercase
|
||||||
; TODO: Convert the lowercase value of 2A or greater inside of the
|
; TODO: Convert the lowercase value of 2A or greater inside of the
|
||||||
; accumulator and convert it to an uppercase value.
|
; accumulator and convert it to an uppercase value.
|
||||||
LDA.w #$1D : BRA .write_to_screen
|
LDA.w #$1D : BRA .write_to_screen
|
||||||
|
|||||||
Reference in New Issue
Block a user