Compare commits
2 commits
7cb879d110
...
9cbcf1cb5a
Author | SHA1 | Date | |
---|---|---|---|
9cbcf1cb5a | |||
0c04e7ddc8 |
1 changed files with 53 additions and 0 deletions
53
mandel.s
53
mandel.s
|
@ -46,6 +46,38 @@ SDLSTH = $231
|
|||
|
||||
.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 ratio!
|
||||
; pixels at 320w are 5:6 (narrow)
|
||||
|
@ -467,6 +499,22 @@ enough:
|
|||
rts
|
||||
.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
|
||||
|
||||
; ox = 0; oy = 0; zoom = 0
|
||||
|
@ -507,6 +555,9 @@ zero_byte_loop:
|
|||
cmp #.hibyte(framebuffer_end)
|
||||
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
|
||||
lda #$22
|
||||
sta DMACTL
|
||||
|
@ -562,6 +613,8 @@ loop_sx_done:
|
|||
|
||||
loop_sy_done:
|
||||
|
||||
draw_text 40 - str_done_len, str_done_len, str_done
|
||||
|
||||
loop:
|
||||
; finished
|
||||
jmp loop
|
||||
|
|
Loading…
Reference in a new issue