clear screen after zoom/scroll
This commit is contained in:
parent
c152c4346b
commit
201d9bf15c
1 changed files with 36 additions and 23 deletions
59
mandel.s
59
mandel.s
|
@ -890,6 +890,37 @@ done:
|
|||
|
||||
.endproc
|
||||
|
||||
.proc clear_screen
|
||||
; zero the range from framebuffer_top to display_list
|
||||
lda #.lobyte(framebuffer_top)
|
||||
sta temp
|
||||
lda #.hibyte(framebuffer_top)
|
||||
sta temp + 1
|
||||
|
||||
zero_page_loop:
|
||||
lda #0
|
||||
ldy #0
|
||||
zero_byte_loop:
|
||||
sta (temp),y
|
||||
iny
|
||||
bne zero_byte_loop
|
||||
|
||||
inc temp + 1
|
||||
lda temp + 1
|
||||
cmp #.hibyte(display_list)
|
||||
bne zero_page_loop
|
||||
|
||||
rts
|
||||
.endproc
|
||||
|
||||
.proc status_bar
|
||||
; Status bar
|
||||
draw_text 0, str_self_len, str_self
|
||||
draw_text 40 - str_run_len, str_run_len, str_run
|
||||
|
||||
rts
|
||||
.endproc
|
||||
|
||||
.proc start
|
||||
|
||||
; ox = 0; oy = 0; zoom = 0
|
||||
|
@ -916,24 +947,7 @@ done:
|
|||
lda #0
|
||||
sta DMACTL
|
||||
|
||||
; zero the range from framebuffer_top to framebuffer_end
|
||||
lda #.lobyte(framebuffer_top)
|
||||
sta temp
|
||||
lda #.hibyte(framebuffer_top)
|
||||
sta temp + 1
|
||||
|
||||
zero_page_loop:
|
||||
lda #0
|
||||
ldy #0
|
||||
zero_byte_loop:
|
||||
sta (temp),y
|
||||
iny
|
||||
bne zero_byte_loop
|
||||
|
||||
inc temp + 1
|
||||
lda temp + 1
|
||||
cmp #.hibyte(framebuffer_end)
|
||||
bne zero_page_loop
|
||||
jsr clear_screen
|
||||
|
||||
; Copy the display list into properly aligned memory
|
||||
; Can't cross 1024-byte boundaries :D
|
||||
|
@ -953,10 +967,6 @@ copy_byte_loop:
|
|||
sta DLISTH ; actual register
|
||||
sta SDLSTH ; shadow register the OS will copy in
|
||||
|
||||
; Status bar
|
||||
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
|
||||
|
@ -968,6 +978,9 @@ copy_byte_loop:
|
|||
jsr SETVBV
|
||||
|
||||
main_loop:
|
||||
jsr clear_screen
|
||||
jsr status_bar
|
||||
|
||||
lda #0
|
||||
sta fill_level
|
||||
|
||||
|
@ -1031,7 +1044,7 @@ not_skipped_mask:
|
|||
jsr keycheck
|
||||
beq no_key
|
||||
; @fixme clear the pixel stats
|
||||
jmp fill_loop
|
||||
jmp main_loop
|
||||
|
||||
no_key:
|
||||
; check if we should update the counters
|
||||
|
|
Loading…
Reference in a new issue