~rabbits/dotgrid

2e24f39ac20cb38b12285b413a7d8cf0ad705b73 — Devine Lu Linvega 11 months ago fae021b
Added patterns and colors
1 files changed, 41 insertions(+), 5 deletions(-)

M src/dotgrid.tal
M src/dotgrid.tal => src/dotgrid.tal +41 -5
@@ 5,7 5,7 @@
|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &pad $3 &scrollx $2 &scrolly $2
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2

|0 @Shapes &nil $1 &patt $1 &line $1
|0 @Shapes &nil $1 &color $1 &patt $1 &line $1

|0000



@@ 39,6 39,13 @@ BRK
	INC2
JMP2r

@shape-color ( memory* -- next* )

	INC2 LDAk #05 MUL ;draw-point/color STA
	INC2

JMP2r

@shape-patt ( memory* -- next* )

	INC2k .Screen/addr DEO2


@@ 49,21 56,43 @@ JMP2r
@shape-line ( memory* -- next* )

	INC2k STH2
	( x1,y1 )
		LDA2kr STH2r INC2r INC2r
		LDA2kr STH2r INC2r INC2r
	( x2,y2 )
		LDA2kr STH2r INC2r INC2r
		LDA2r STH2r
	draw-line
	#0009 ADD2

	INC2k STH2
	( x1,y1 )
		LDA2kr STH2r INC2r INC2r
		LDA2kr STH2r INC2r INC2r
	draw-handle
	( x2,y2 )
		LDA2kr STH2r INC2r INC2r
		LDA2r STH2r
	draw-handle

	( next shape ) #0009 ADD2

JMP2r

(
@|drawing )

@draw-handle ( x* y* -- )

	.Screen/y DEO2
	.Screen/x DEO2
	;handle-chr .Screen/addr DEO2
	#85 .Screen/sprite DEO

JMP2r

@draw-point ( -- )

	#0a .Screen/sprite DEO
	[ LIT &color $1 ] .Screen/sprite DEO

JMP2r



@@ 167,11 196,14 @@ JMP2r

@shapes-lut
	=shape-null
	=shape-color
	=shape-patt
	=shape-line

@cursor-icn
	[ 80c0 e0f0 f8e0 1000 ]
@handle-chr
	[ 0018 245a 5a24 1800 183c 7ee7 e77e 3c18 ]
@brush
	&1 [ 3c7e ffff ffff 7e3c ]



@@ 179,11 211,15 @@ JMP2r
@|memory )

@picture
	-Shapes/color [ 03 ]
	-Shapes/patt [ 3c7e ffff ffff 7e3c ]
	-Shapes/line [ 0020 0030 0074 00a1 ]
	-Shapes/patt [ 0000 0000 0100 0000 ]
	-Shapes/patt [ 0000 0010 0100 0000 ]
	-Shapes/line [ 0090 0007 0012 0082 ]
	-Shapes/patt [ 0008 1c3e 7f3e 1c08 ]
	-Shapes/color [ 02 ]
	-Shapes/patt [ 0000 0018 1800 0000 ]
	-Shapes/line [ 0023 0093 0088 0058 ]
	-Shapes/color [ 01 ]
	-Shapes/line [ 0042 003f 0142 0124 ]
	$1