strings fixed but .... something's corrupt in display

This commit is contained in:
Brooke Vibber 2023-01-22 06:35:41 -08:00
parent 0c04e7ddc8
commit 9cbcf1cb5a

View file

@ -48,13 +48,35 @@ SDLSTH = $231
strings: strings:
str_self: str_self:
.asciiz "MANDEL-6502" .byte "MANDEL-6502"
str_self_end:
str_speed: str_speed:
.asciiz "ms/px" .byte "ms/px"
str_running: str_speed_end:
.asciiz "RUN " str_run:
.byte "RUN "
str_run_end:
str_done: str_done:
.asciiz "DONE" .byte "DONE"
str_done_end:
str_self_len = str_self_end - str_self
str_speed_len = str_speed_end - str_speed
str_run_len = str_run_end - str_run
str_done_len = str_done_end - str_done
char_map:
; Map ATASCII string values to framebuffer font entries
; Sighhhhh
.repeat 32, i
.byte i + 64
.endrepeat
.repeat 64, i
.byte i
.endrepeat
.repeat 32, i
.byte 96 + i
.endrepeat
aspect: aspect:
; aspect ratio! ; aspect ratio!
@ -477,14 +499,16 @@ enough:
rts rts
.endproc .endproc
.macro draw_text col, cstr .macro draw_text col, len, cstr
; clobbers A, X ; clobbers A, X
.local loop .local loop
.local done .local done
ldx #0 ldx #0
loop: loop:
lda cstr,x cpx #len
beq done beq done
ldy cstr,x
lda char_map,y
sta textbuffer + col,x sta textbuffer + col,x
inx inx
jmp loop jmp loop
@ -531,8 +555,8 @@ zero_byte_loop:
cmp #.hibyte(framebuffer_end) cmp #.hibyte(framebuffer_end)
bne zero_page_loop bne zero_page_loop
draw_text 0, str_self draw_text 0, str_self_len, str_self
draw_text 36, str_running draw_text 40 - str_run_len, str_run_len, str_run
; Re-enable display DMA ; Re-enable display DMA
lda #$22 lda #$22
@ -589,7 +613,7 @@ loop_sx_done:
loop_sy_done: loop_sy_done:
draw_text 36, str_done draw_text 40 - str_done_len, str_done_len, str_done
loop: loop:
; finished ; finished