clean up speed display now uses ms/px msg

This commit is contained in:
Brooke Vibber 2023-03-05 13:48:39 -08:00
parent 0501a364c7
commit 9926ec28e7

View file

@ -94,7 +94,7 @@ str_self:
.byte "MANDEL-6502" .byte "MANDEL-6502"
str_self_end: str_self_end:
str_speed: str_speed:
.byte "ms/px" .byte " ms/px"
str_speed_end: str_speed_end:
str_run: str_run:
.byte " RUN" .byte " RUN"
@ -740,6 +740,25 @@ shift_done:
rts rts
.endproc .endproc
.macro draw_text_indirect col, len, strptr
; clobbers A, X
.local loop
.local done
ldx #0
loop:
cpx #len
beq done
txa
tay
lda (strptr),y
tay
lda char_map,y
sta textbuffer + col,x
inx
jmp loop
done:
.endmacro
.macro draw_text col, len, cstr .macro draw_text col, len, cstr
; clobbers A, X ; clobbers A, X
.local loop .local loop
@ -940,33 +959,9 @@ update_status:
; convert to ASCII in INBUFF ; convert to ASCII in INBUFF
jsr FASC jsr FASC
; find the last byte ; print the first 6 digits
ldy #0 draw_text_indirect speed_start, 6, INBUFF
number_loop: draw_text speed_start + 6, str_speed_len, str_speed
lda (INBUFF),y
bmi lastchar
tax
lda char_map,x
sta textbuffer + speed_start,y
iny
bpl number_loop
lastchar:
; Y is last char
; trim that high bit
and #$7f
tax
lda char_map,x
sta textbuffer + speed_start,y
; Fill out any remaining spaces
lda #0
space_loop:
iny
sta textbuffer + speed_start,y
cpy #(20)
bmi space_loop
skip_status: skip_status: