Compare commits

...

2 commits

2 changed files with 44 additions and 3 deletions

View file

@ -30,6 +30,8 @@
.canvas-height #01 ADD .canvas-width #01 SUB .canvas-height draw-v-line
( right line )
.canvas-height #01 ADD .canvas-width #02 MUL #01 ADD .canvas-height draw-v-line
( set pxs-pt to start of pixels )
;pxs ;pxs-pt STA2
;on-mouse .Mouse/vector DEO2
BRK
@ -47,6 +49,33 @@
.x LDZ2 .Screen/x DEO2
.y LDZ2 .Screen/y DEO2
#01 .Screen/pixel DEO
( set local pt to start of pixels )
!{ &local-pt $2 }
;pxs ,/local-pt STR2
&loop
( is the drawing done? )
;pxs-pt LDA2 ( pt* )
;pxs #1550 ADD2 ( pt* end-of-px* )
EQU2 ?/end
( check if current xy has already been visited )
,/local-pt LDR2 LDA2 ( x1 y1 )
.x LDZ2 NIP ( x1 y1 x )
.y LDZ2 NIP ( x1 y1 x y )
EQU2 ?/end
( have we go through the whole list? )
,/local-pt LDR2 ( local-pt* )
;pxs #1550 ADD2 ( local-pt* end-of-px* )
EQU2 ?/save
( incrment pxs pointer and save it )
,/local-pt LDR2 ( local-pt* )
#0002 ADD2 ( local-pt*+2 )
,/local-pt STR2
!&loop
&save
.x LDZ2 NIP .y LDZ2 NIP ( x y )
;pxs-pt LDA2 ( x y pt* )
STA2
;pxs-pt LDA2 INC2 INC2 ;pxs-pt STA2
&end
JMP2r
@ -63,8 +92,8 @@
LIT2 0000 .Screen/y DEO2
#c0 .Screen/pixel DEO
( draw cursor sprite to fg )
.x LDZ2 .Screen/x DEO2
.y LDZ2 .Screen/y DEO2
.x LDZ2 #0002 SUB2 .Screen/x DEO2
.y LDZ2 #0002 SUB2 .Screen/y DEO2
;cursor-sprite .Screen/addr DEO2
#41 .Screen/sprite DEO
JMP2r
@ -141,3 +170,13 @@
. . . . . . . . 3c
. . . . . . . . 18
)
@pxs-pt $2
@pxs $1550 ( 5456 )
(
pxs are the pixels of the drawing in order they are drawn
0001 05 <-- x1
0002 04 <-- y1
0003 05 <-- x2
0004 03 <-- y2
)

View file

@ -4,7 +4,9 @@
|0100
@on-reset
#02 #04 SUB
#0aa8
#0058
NIP
( mem-test )
BRK