now writes pixels sorta

This commit is contained in:
Brooke Vibber 2023-01-22 09:09:12 -08:00
parent a8872b4e66
commit efac8f4f62

View file

@ -18,6 +18,12 @@ zoom = $a1 ; u8: zoom shift level
temp = $a2 ; u16
temp2 = $a4 ; u16
pixel_ptr = $b0 ; u16
pixel_color = $b2 ; u8
pixel_mask = $b3 ; u8
pixel_shift = $b4 ; u8
pixel_offset = $b5 ; u8
; FP registers in zero page
FR0 = $d4
FRE = $da
@ -108,8 +114,8 @@ bit_masks:
.byte 3 << 6
display_list_start:
; 48 lines overscan
.repeat 5
; 24 lines overscan
.repeat 3
.byte $70 ; 8 blank lines
.endrep
@ -185,8 +191,8 @@ color_map:
.macro shl bytes, arg
asl arg
.repeat bytes-1
rol arg
.repeat bytes-1, i
rol arg + 1 + i
.endrepeat
.endmacro
@ -525,12 +531,6 @@ enough:
; iter holds the target to use
; @todo implement
pixel_ptr = $b0
pixel_color = $b2
pixel_mask = $b3
pixel_shift = $b4
pixel_offset = $b5
; iter -> color
ldx iter
lda color_map,x
@ -563,7 +563,7 @@ point:
; temp * 40
; = temp * 32 + temp * 8
; = (temp << 5) + (temp << 3)
extend_8_16 temp, sy
copy16 temp, sy
shl16 temp
shl16 temp
shl16 temp
@ -588,6 +588,9 @@ point:
shift_loop:
beq shift_done
asl pixel_color
asl pixel_color
sec
rol pixel_mask
sec
rol pixel_mask
dex
@ -602,11 +605,10 @@ shift_done:
tay
; read, mask, or, write
lda (temp),y
lda (pixel_ptr),y
and pixel_mask
ora pixel_color
lda #255
sta (temp),y
sta (pixel_ptr),y
rts
.endproc
@ -703,13 +705,12 @@ loop_sx:
zoom_factor cx, sx, zoom, aspect_x
zoom_factor cy, sy, zoom, aspect_y
;jsr mandelbrot
lda #1
lda #2
sta iter
jsr pset
lda sx
clc
lda sx
adc #1
sta sx
lda sx + 1
@ -723,8 +724,8 @@ loop_sx:
loop_sx_done:
lda sy
clc
lda sy
adc #1
sta sy
lda sy + 1