Compare commits
2 commits
fab2760394
...
f2a6af0995
| Author | SHA1 | Date | |
|---|---|---|---|
| f2a6af0995 | |||
| 96e0356e57 |
1 changed files with 57 additions and 8 deletions
65
mandel.s
65
mandel.s
|
|
@ -126,6 +126,10 @@ KEY_7 = 51
|
||||||
KEY_8 = 53
|
KEY_8 = 53
|
||||||
KEY_9 = 48
|
KEY_9 = 48
|
||||||
KEY_0 = 50
|
KEY_0 = 50
|
||||||
|
KEY_PERIOD = 34
|
||||||
|
KEY_E = 42
|
||||||
|
KEY_X = 22
|
||||||
|
KEY_Y = 43
|
||||||
|
|
||||||
.struct float48
|
.struct float48
|
||||||
exponent .byte
|
exponent .byte
|
||||||
|
|
@ -403,6 +407,13 @@ elapsed_work:
|
||||||
elapsed_digit:
|
elapsed_digit:
|
||||||
.byte 0
|
.byte 0
|
||||||
|
|
||||||
|
input_col:
|
||||||
|
.byte 0
|
||||||
|
input_row:
|
||||||
|
.byte 0
|
||||||
|
input_max:
|
||||||
|
.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
|
||||||
|
|
@ -983,6 +994,17 @@ common:
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
; rounds to 16-bit first!
|
||||||
|
; input in FR0, 32 bits signed 6.26 fixed
|
||||||
|
; output in FR0, Atari float
|
||||||
|
; clobbers a, x, y, FR0, FR1
|
||||||
|
.proc fixed6_26_to_float
|
||||||
|
shift_round_16 FR0, 3
|
||||||
|
copy16 FR0, FR0 + 2
|
||||||
|
jsr fixed3_13_to_float
|
||||||
|
rts
|
||||||
|
.endproc
|
||||||
|
|
||||||
; input in FR0, Atari float
|
; input in FR0, Atari float
|
||||||
; output in FR0, 16 bits signed 3.13 fixed
|
; output in FR0, 16 bits signed 3.13 fixed
|
||||||
; clobbers a, x, y, FR0, FR1
|
; clobbers a, x, y, FR0, FR1
|
||||||
|
|
@ -1603,7 +1625,7 @@ number_keys:
|
||||||
beq five
|
beq five
|
||||||
cpy #KEY_6
|
cpy #KEY_6
|
||||||
beq six
|
beq six
|
||||||
jmp skip_char
|
jmp letter_keys
|
||||||
|
|
||||||
one:
|
one:
|
||||||
ldx #0
|
ldx #0
|
||||||
|
|
@ -1622,7 +1644,21 @@ five:
|
||||||
jmp load_key_viewport
|
jmp load_key_viewport
|
||||||
six:
|
six:
|
||||||
ldx #5
|
ldx #5
|
||||||
; fall through
|
jmp load_key_viewport
|
||||||
|
|
||||||
|
letter_keys:
|
||||||
|
cpy #KEY_X
|
||||||
|
bne not_x
|
||||||
|
jsr input_x
|
||||||
|
jmp load_key_viewport
|
||||||
|
not_x:
|
||||||
|
cpy #KEY_Y
|
||||||
|
bne not_y
|
||||||
|
jsr input_y
|
||||||
|
jmp load_key_viewport
|
||||||
|
not_y:
|
||||||
|
jmp skip_char
|
||||||
|
|
||||||
load_key_viewport:
|
load_key_viewport:
|
||||||
jsr load_viewport
|
jsr load_viewport
|
||||||
; fall through
|
; fall through
|
||||||
|
|
@ -1632,6 +1668,23 @@ done:
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
.proc input_x
|
||||||
|
ldx #col_x
|
||||||
|
ldy #1
|
||||||
|
jsr input_number
|
||||||
|
|
||||||
|
|
||||||
|
rts
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
.proc input_y
|
||||||
|
rts
|
||||||
|
.endproc
|
||||||
|
|
||||||
|
.proc input_number
|
||||||
|
rts
|
||||||
|
.endproc
|
||||||
|
|
||||||
.proc clear_screen
|
.proc clear_screen
|
||||||
; zero the range from framebuffer_top to display_list
|
; zero the range from framebuffer_top to display_list
|
||||||
lda #.lobyte(framebuffer_top)
|
lda #.lobyte(framebuffer_top)
|
||||||
|
|
@ -1679,9 +1732,7 @@ zero_byte_loop:
|
||||||
draw_string_const str_x
|
draw_string_const str_x
|
||||||
|
|
||||||
copy32 FR0, ox
|
copy32 FR0, ox
|
||||||
shift_round_16 FR0, 3
|
jsr fixed6_26_to_float
|
||||||
copy16 FR0, FR0 + 2
|
|
||||||
jsr fixed3_13_to_float
|
|
||||||
jsr FASC
|
jsr FASC
|
||||||
jsr draw_string
|
jsr draw_string
|
||||||
|
|
||||||
|
|
@ -1690,9 +1741,7 @@ zero_byte_loop:
|
||||||
draw_string_const str_y
|
draw_string_const str_y
|
||||||
|
|
||||||
copy32 FR0, oy
|
copy32 FR0, oy
|
||||||
shift_round_16 FR0, 3
|
jsr fixed6_26_to_float
|
||||||
copy16 FR0, FR0 + 2
|
|
||||||
jsr fixed3_13_to_float
|
|
||||||
jsr FASC
|
jsr FASC
|
||||||
jsr draw_string
|
jsr draw_string
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue