Compare commits
3 commits
89b4e45901
...
5cf64970c8
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cf64970c8 | |||
|
|
f7082ab371 | ||
|
|
689363d083 |
1 changed files with 86 additions and 1 deletions
87
mandel.s
87
mandel.s
|
|
@ -162,12 +162,28 @@ str_padding:
|
||||||
str_padding_end:
|
str_padding_end:
|
||||||
.byte 0
|
.byte 0
|
||||||
|
|
||||||
|
str_space:
|
||||||
|
.byte " "
|
||||||
|
.byte 0
|
||||||
|
|
||||||
|
str_h:
|
||||||
|
.byte "h"
|
||||||
|
.byte 0
|
||||||
|
str_m:
|
||||||
|
.byte "m"
|
||||||
|
.byte 0
|
||||||
|
str_s:
|
||||||
|
.byte "s"
|
||||||
|
.byte 0
|
||||||
|
|
||||||
str_speed_len = str_speed_end - str_speed
|
str_speed_len = str_speed_end - str_speed
|
||||||
str_run_len = str_run_end - str_run
|
str_run_len = str_run_end - str_run
|
||||||
str_done_len = str_done_end - str_done
|
str_done_len = str_done_end - str_done
|
||||||
str_padding_len = str_padding_end - str_padding
|
str_padding_len = str_padding_end - str_padding
|
||||||
|
|
||||||
speed_start = 40 - str_done_len - str_speed_len - str_padding_len - 1
|
; "3h59m59s"
|
||||||
|
str_elapsed_spacer = 8
|
||||||
|
speed_start = 40 - str_done_len - str_speed_len - str_padding_len - str_elapsed_spacer - 1
|
||||||
|
|
||||||
col_x = 1
|
col_x = 1
|
||||||
str_x:
|
str_x:
|
||||||
|
|
@ -205,8 +221,12 @@ char_map:
|
||||||
.endrepeat
|
.endrepeat
|
||||||
|
|
||||||
hex_chars:
|
hex_chars:
|
||||||
|
digits_zero:
|
||||||
.byte "0123456789abcdef"
|
.byte "0123456789abcdef"
|
||||||
|
|
||||||
|
digits_space:
|
||||||
|
.byte " 123456789abcdef"
|
||||||
|
|
||||||
aspect:
|
aspect:
|
||||||
; aspect ratio!
|
; aspect ratio!
|
||||||
; pixels at 320w are 5:6 (narrow)
|
; pixels at 320w are 5:6 (narrow)
|
||||||
|
|
@ -378,6 +398,11 @@ viewport_oy:
|
||||||
.dword ($fffe0000 & $3fffffff) << 2
|
.dword ($fffe0000 & $3fffffff) << 2
|
||||||
.dword $ff000000
|
.dword $ff000000
|
||||||
|
|
||||||
|
elapsed_work:
|
||||||
|
.dword 0
|
||||||
|
elapsed_digit:
|
||||||
|
.byte 0
|
||||||
|
|
||||||
; 2 + 9 * byte cycles
|
; 2 + 9 * byte cycles
|
||||||
.macro add bytes, dest, arg1, arg2
|
.macro add bytes, dest, arg1, arg2
|
||||||
clc ; 2 cyc
|
clc ; 2 cyc
|
||||||
|
|
@ -1953,6 +1978,66 @@ update_status:
|
||||||
; convert to ASCII in INBUFF and print
|
; convert to ASCII in INBUFF and print
|
||||||
jsr FASC
|
jsr FASC
|
||||||
jsr draw_string
|
jsr draw_string
|
||||||
|
|
||||||
|
; elapsed time
|
||||||
|
; FR0 = total_sec
|
||||||
|
ldx #.lobyte(total_sec)
|
||||||
|
ldy #.hibyte(total_sec)
|
||||||
|
jsr FLD0R
|
||||||
|
; FR0 -> integer -> elapsed_work
|
||||||
|
jsr FPI
|
||||||
|
lda FR0
|
||||||
|
sta elapsed_work
|
||||||
|
lda FR0 + 1
|
||||||
|
sta elapsed_work + 1
|
||||||
|
|
||||||
|
;jsr IFP
|
||||||
|
;jsr FASC
|
||||||
|
;jsr draw_string
|
||||||
|
|
||||||
|
.macro countdown divisor, digits
|
||||||
|
.scope
|
||||||
|
; count the hours
|
||||||
|
ldx #0
|
||||||
|
countdown_loop:
|
||||||
|
lda elapsed_work + 1
|
||||||
|
cmp #.hibyte(divisor)
|
||||||
|
bcc countdown_done
|
||||||
|
lda elapsed_work
|
||||||
|
cmp #.lobyte(divisor)
|
||||||
|
bcc countdown_done
|
||||||
|
sec
|
||||||
|
lda elapsed_work
|
||||||
|
sbc #.lobyte(divisor)
|
||||||
|
sta elapsed_work
|
||||||
|
lda elapsed_work + 1
|
||||||
|
sbc #.hibyte(divisor)
|
||||||
|
sta elapsed_work + 1
|
||||||
|
inx
|
||||||
|
jmp countdown_loop
|
||||||
|
countdown_done:
|
||||||
|
lda digits,x
|
||||||
|
eor #$80
|
||||||
|
sta elapsed_digit
|
||||||
|
lda #.lobyte(elapsed_digit)
|
||||||
|
sta INBUFF
|
||||||
|
lda #.hibyte(elapsed_digit)
|
||||||
|
sta INBUFF + 1
|
||||||
|
jsr draw_string
|
||||||
|
.endscope
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
draw_string_const str_space
|
||||||
|
countdown 36000, digits_space
|
||||||
|
countdown 3600, digits_zero
|
||||||
|
draw_string_const str_h
|
||||||
|
countdown 600, digits_zero
|
||||||
|
countdown 60, digits_zero
|
||||||
|
draw_string_const str_m
|
||||||
|
countdown 10, digits_zero
|
||||||
|
countdown 1, digits_zero
|
||||||
|
draw_string_const str_s
|
||||||
|
|
||||||
skipped:
|
skipped:
|
||||||
|
|
||||||
; sx += fill_level[fill_masks] + 1
|
; sx += fill_level[fill_masks] + 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue