Compare commits

..

2 commits

View file

@ -46,6 +46,38 @@ SDLSTH = $231
.data .data
strings:
str_self:
.byte "MANDEL-6502"
str_self_end:
str_speed:
.byte "ms/px"
str_speed_end:
str_run:
.byte "RUN "
str_run_end:
str_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!
; pixels at 320w are 5:6 (narrow) ; pixels at 320w are 5:6 (narrow)
@ -467,6 +499,22 @@ enough:
rts rts
.endproc .endproc
.macro draw_text col, len, cstr
; clobbers A, X
.local loop
.local done
ldx #0
loop:
cpx #len
beq done
ldy cstr,x
lda char_map,y
sta textbuffer + col,x
inx
jmp loop
done:
.endmacro
.proc start .proc start
; ox = 0; oy = 0; zoom = 0 ; ox = 0; oy = 0; zoom = 0
@ -507,6 +555,9 @@ zero_byte_loop:
cmp #.hibyte(framebuffer_end) cmp #.hibyte(framebuffer_end)
bne zero_page_loop bne zero_page_loop
draw_text 0, str_self_len, str_self
draw_text 40 - str_run_len, str_run_len, str_run
; Re-enable display DMA ; Re-enable display DMA
lda #$22 lda #$22
sta DMACTL sta DMACTL
@ -562,6 +613,8 @@ loop_sx_done:
loop_sy_done: loop_sy_done:
draw_text 40 - str_done_len, str_done_len, str_done
loop: loop:
; finished ; finished
jmp loop jmp loop