diff --git a/one_line_canvas.tal b/one_line_canvas.tal index 8b2e8d8..724872a 100644 --- a/one_line_canvas.tal +++ b/one_line_canvas.tal @@ -30,8 +30,6 @@ .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 @@ -49,33 +47,6 @@ .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 @@ -92,8 +63,8 @@ LIT2 0000 .Screen/y DEO2 #c0 .Screen/pixel DEO ( draw cursor sprite to fg ) - .x LDZ2 #0002 SUB2 .Screen/x DEO2 - .y LDZ2 #0002 SUB2 .Screen/y DEO2 + .x LDZ2 .Screen/x DEO2 + .y LDZ2 .Screen/y DEO2 ;cursor-sprite .Screen/addr DEO2 #41 .Screen/sprite DEO JMP2r @@ -170,13 +141,3 @@ . . . . . . . . 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 -) diff --git a/playground.tal b/playground.tal index 10b2c93..e84b6b8 100644 --- a/playground.tal +++ b/playground.tal @@ -4,9 +4,7 @@ |0100 @on-reset - #0aa8 - #0058 - NIP + #02 #04 SUB ( mem-test ) BRK