Browse code

Ported the shapes example

neauoire authored on 27/02/2021 19:39:12
Showing 8 changed files
... ...
@@ -20,5 +20,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr
20 20
 # cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator
21 21
 
22 22
 # run
23
-./bin/assembler examples/gui.picture.usm bin/boot.rom
23
+./bin/assembler examples/dev.mouse.usm bin/boot.rom
24 24
 ./bin/emulator bin/boot.rom
... ...
@@ -197,10 +197,10 @@ drawdebugger(Uint32 *dst, Uxn *u)
197 197
 void
198 198
 redraw(Uint32 *dst, Uxn *u)
199 199
 {
200
-	int x, y;
200
+	Uint16 x, y;
201 201
 	for(y = 0; y < VER; ++y)
202 202
 		for(x = 0; x < HOR; ++x) {
203
-			int key = (y * HOR + x) * 16;
203
+			Uint16 key = (y * HOR + x) * 16;
204 204
 			drawchr(dst, (x + PAD) * 8, (y + PAD) * 8, &screen.bg[key], 0);
205 205
 			drawchr(dst, (x + PAD) * 8, (y + PAD) * 8, &screen.fg[key], 1);
206 206
 		}
... ...
@@ -6,6 +6,11 @@
6 6
 &Controller { buttons 1 }
7 7
 &Mouse      { x 2 y 2 state 1 chord 1 }
8 8
 
9
+&Label2d { x 2 y 2 color 1 addr 2 }
10
+&Picture2d { x 2 y 2 width 2 height 2 color 1 addr 2 }
11
+&Rect2d { x1 2 y1 2 x2 2 y2 2 }
12
+&Point2d { x 2 y 2 }
13
+
9 14
 |0100 @RESET BRK
10 15
 |c000 @FRAME BRK 
11 16
 |d000 @ERROR BRK 
12 17
deleted file mode 100644
... ...
@@ -1,84 +0,0 @@
1
-( desktop )
2
-
3
-:dev/w fff9 ( const write port )
4
-
5
-;x1 2 ;y1 2
6
-
7
-;x 2 ;y 2 ;color 1
8
-
9
-|0100 @RESET 
10
-	
11
-	#02 =dev/w 
12
-
13
-	#01 =color
14
-	,text #0020 #0030 ,draw-label JSR
15
-	#02 =color
16
-	,text #0022 #0038 ,draw-label JSR
17
-	#03 =color
18
-	,text #0024 #0040 ,draw-label JSR
19
-	#04 =color
20
-	,text #0026 #0048 ,draw-label JSR
21
-	#06 =color
22
-	,text #0028 #0050 ,draw-label JSR
23
-	#07 =color
24
-	,text #002a #0058 ,draw-label JSR
25
-	#08 =color
26
-	,text #002c #0060 ,draw-label JSR
27
-	#09 =color
28
-	,text #002e #0068 ,draw-label JSR
29
-
30
-BRK
31
-
32
-@text [ Hello World ] <1 .00 ( add characters to memory )
33
-
34
-@draw-label ( x1 y1 text )
35
-	=y1 =x1
36
-	@draw-label-loop
37
-		( draw ) ~x1 ~y1 IOW2 IOW2 DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 IOW2 ~color IOW
38
-		( incr ) #0001 ADD2
39
-		( incr ) ~x1 #0008 ADD2 =x1
40
-		DUP2 LDR #00 NEQ ,draw-label-loop ROT JMP? POP2
41
-	POP2
42
-RTS
43
-
44
-@font ( spectrum-zx font ) 
45
-[
46
-	0000 0000 0000 0000 0000 2400 7e3c 0000 0000 2400 3c42 0000 0000 6c7c 7c38 1000
47
-	0010 387c 7c38 1000 0038 387c 6c10 3800 0010 387c 7c10 3800 0000 0018 1800 0000
48
-	007e 4242 4242 7e00 0000 1824 2418 0000 0018 2442 4224 1800 001e 063a 4a48 3000
49
-	0038 446c 107c 1000 000c 0808 0838 3800 003e 2222 2266 6600 0000 0822 0022 0800
50
-	0000 1018 1c18 1000 0000 0818 3818 0800 0008 1c00 001c 0800 0028 2828 2800 2800
51
-	003e 4a4a 3a0a 0a00 000c 3046 620c 3000 0000 0000 0000 ffff 0010 3800 3810 0038
52
-	0008 1c2a 0808 0800 0008 0808 2a1c 0800 0000 0804 7e04 0800 0000 1020 7e20 1000
53
-	0000 4040 7e00 0000 0000 0024 6624 0000 0000 1038 7c00 0000 0000 007c 3810 0000
54
-	0000 0000 0000 0000 0008 0808 0800 0800 0014 1400 0000 0000 0024 7e24 247e 2400
55
-	0008 1e28 1c0a 3c08 0042 0408 1020 4200 0030 4832 4c44 3a00 0008 1000 0000 0000
56
-	0004 0808 0808 0400 0010 0808 0808 1000 0000 1408 3e08 1400 0000 0808 3e08 0800
57
-	0000 0000 0008 0810 0000 0000 3c00 0000 0000 0000 0000 0800 0000 0204 0810 2000
58
-	003c 464a 5262 3c00 0018 2808 0808 3e00 003c 4202 3c40 7e00 003c 421c 0242 3c00
59
-	0008 1828 487e 0800 007e 407c 0242 3c00 003c 407c 4242 3c00 007e 0204 0810 1000
60
-	003c 423c 4242 3c00 003c 4242 3e02 3c00 0000 0008 0000 0800 0000 0800 0008 0810
61
-	0000 0810 2010 0800 0000 003e 003e 0000 0000 1008 0408 1000 003c 4202 0c00 0800
62
-	003c 425a 5442 3c00 0018 2442 7e42 4200 007c 427c 4242 7c00 003c 4240 4042 3c00
63
-	0078 4442 4244 7800 007e 407c 4040 7e00 003e 4040 7c40 4000 003c 4240 4e42 3c00
64
-	0042 427e 4242 4200 003e 0808 0808 3e00 0002 0202 4242 3c00 0044 4870 4844 4200
65
-	0040 4040 4040 7e00 0042 665a 4242 4200 0042 6252 4a46 4200 003c 4242 4242 3c00
66
-	007c 4242 7c40 4000 003c 4242 524a 3c00 007c 4242 7c44 4200 003c 403c 0242 3c00
67
-	00fe 1010 1010 1000 0042 4242 4242 3c00 0042 4242 4224 1800 0042 4242 5a66 4200
68
-	0042 2418 1824 4200 0082 4428 1010 1000 007e 0408 1020 7e00 000c 0808 0808 0c00
69
-	0040 2010 0804 0200 0018 0808 0808 1800 0008 1422 0000 0000 0000 0000 0000 7e00
70
-	0008 0400 0000 0000 0000 1c02 1e22 1e00 0020 203c 2222 3c00 0000 1e20 2020 1e00
71
-	0002 021e 2222 1e00 0000 1c22 3c20 1e00 000c 101c 1010 1000 0000 1c22 221e 021c
72
-	0020 202c 3222 2200 0008 0018 0808 0400 0008 0008 0808 4830 0020 2428 3028 2400
73
-	0010 1010 1010 0c00 0000 6854 5454 5400 0000 5864 4444 4400 0000 3844 4444 3800
74
-	0000 7844 4478 4040 0000 3c44 443c 0406 0000 2c30 2020 2000 0000 3840 3804 7800
75
-	0010 103c 1010 0c00 0000 4444 4444 3800 0000 4444 2828 1000 0000 4454 5454 2800
76
-	0000 4428 1028 4400 0000 4444 443c 0438 0000 7c08 1020 7c00 000c 0810 1008 0c00
77
-	0008 0808 0808 0800 0030 1008 0810 3000 0000 0032 4c00 0000 3c42 99a1 a199 423c
78
-]
79
-
80
-|c000 @FRAME
81
-|d000 @ERROR 
82
-
83
-|FFF0 [ f3f0 f30b f30a ] ( palette )
84
-|FFFA .RESET .FRAME .ERROR
85 0
\ No newline at end of file
... ...
@@ -1,59 +1,153 @@
1 1
 ( draw routines )
2 2
 
3
-&Screen { width 2 height 2 pad 4 y 2 x 2 color 1 red 1 green 1 blue 1 }
3
+&Screen { width 2 height 2 pad 4 x 2 y 2 color 1 }
4
+&Sprite { pad 8 x 2 y 2 addr 2 color 1 }
5
+
6
+&Label2d { x 2 y 2 color 1 addr 2 }
7
+&Picture2d { x 2 y 2 width 2 height 2 color 1 addr 2 }
8
+&Rect2d { x1 2 y1 2 x2 2 y2 2 }
9
+&Point2d { x 2 y 2 }
10
+
11
+;label Label2d
12
+;pict Picture2d
13
+;rect Rect2d
4 14
 
5 15
 ;color 1 ;x1 2 ;x2 2 ;y1 2 ;y2 2
6 16
 
7 17
 |0100 @RESET
18
+	
19
+	#0010 #0020 #0040 #0060 #01 ,fill-rect JSR
20
+	#0020 #0030 #0050 #0070 #02 ,fill-rect JSR
21
+	#0030 #0040 #0060 #0080 #03 ,fill-rect JSR
22
+	#0070 #0020 #00a0 #0060 #01 ,line-rect JSR
23
+	#0080 #0030 #00b0 #0070 #02 ,line-rect JSR
24
+	#0090 #0040 #00c0 #0080 #03 ,line-rect JSR
8 25
 
9
-	#01 =color
10
-	#0010 #0020 #0040 #0060 ,fill-rect JSR
11
-	#02 =color
12
-	#0020 #0030 #0050 #0070 ,fill-rect JSR
13
-	#03 =color
14
-	#0030 #0040 #0060 #0080 ,fill-rect JSR
15
-
16
-	#01 =color
17
-	#0070 #0020 #00a0 #0060 ,line-rect JSR
18
-	#02 =color
19
-	#0080 #0030 #00b0 #0070 ,line-rect JSR
20
-	#03 =color
21
-	#0090 #0040 #00c0 #0080 ,line-rect JSR
26
+	#0000 #0080 #0020 #0020 #01 ,pict_small ,draw-picture JSR
27
+	#0010 #0088 #0020 #0020 #02 ,pict_small ,draw-picture JSR
28
+	#0020 #0090 #0020 #0020 #03 ,pict_small ,draw-picture JSR
29
+	#0030 #0098 #0020 #0020 #04 ,pict_small ,draw-picture JSR
30
+
31
+	#0028 #0068 #01 ,text ,draw-label JSR
32
+	#0038 #0078 #02 ,text ,draw-label JSR
33
+	#0048 #0088 #03 ,text ,draw-label JSR
34
+	#0058 #0098 #04 ,text ,draw-label JSR
22 35
 	
23 36
 BRK
24 37
 
25
-@line-rect ( x1 y1 x2 y2 )
26
-	=y2 =x2 ( stash x1 y1 ) DUP2 WSR2 =y1 DUP2 WSR2 =x1
38
+@line-rect ( x1 y1 x2 y2 color )
39
+
40
+	( load ) =color =rect.y2 =rect.x2 DUP2 =dev/screen.y =rect.y1 DUP2 =dev/screen.x =rect.x1
27 41
 	@line-rect-hor
28
-		( draw ) ~x1 ~y1 =dev/screen.y =dev/screen.x ~color =dev/screen.color
29
-		( draw ) ~x1 ~y2 =dev/screen.y =dev/screen.x ~color =dev/screen.color
30
-		( incr ) ~x1 #0001 ADD2 DUP2 =x1  
31
-		~x2 #0001 ADD2 LTH2 ,line-rect-hor ROT JMP? POP2
32
-	( restore x1 y1 ) RSW2 =x1 RSW2 =y1
42
+		( draw ) ~rect.y1 =dev/screen.y ~color =dev/screen.color
43
+		( draw ) ~rect.y2 =dev/screen.y ~color =dev/screen.color
44
+		( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x
45
+		,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2
46
+	~rect.y1 =dev/screen.y
33 47
 	@line-rect-ver
34
-		( incr ) ~y1 #0001 ADD2 DUP2 =y1  
35
-		( draw ) ~x1 ~y1 =dev/screen.y =dev/screen.x ~color =dev/screen.color
36
-		( draw ) ~x2 ~y1 =dev/screen.y =dev/screen.x ~color =dev/screen.color
37
-		~y2 #0001 SUB2 LTH2 ,line-rect-ver ROT JMP? POP2
48
+		( draw ) ~rect.x1 =dev/screen.x ~color =dev/screen.color
49
+		( draw ) ~rect.x2 =dev/screen.x ~color =dev/screen.color
50
+		( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y
51
+		,line-rect-ver ~dev/screen.y ~rect.y2 LTH2 JMP? POP2
52
+
38 53
 RTS
39 54
 
40
-@fill-rect ( x1 y1 x2 y2 )
41
-	=y2 =x2 ( stash x1 y1 ) =y1 DUP2 WSR2 =x1
55
+@fill-rect ( x1 y1 x2 y2 color )
56
+
57
+	( load ) =color =rect.y2 =rect.x2 DUP2 =dev/screen.y =rect.y1 DUP2 =dev/screen.x =rect.x1
42 58
 	@fill-rect-ver
43
-		RSW2 DUP2 =x1 WSR2
59
+		~rect.x1 =dev/screen.x
44 60
 		@fill-rect-hor
45
-			( draw ) ~x1 ~y1 =dev/screen.y =dev/screen.x ~color =dev/screen.color
46
-			( incr ) ~x1 #0001 ADD2 DUP2 =x1  
47
-			~x2 LTH2 ,fill-rect-hor ROT JMP? POP2
48
-		~y1 #0001 ADD2 DUP2 =y1
49
-		~y2 LTH2 ,fill-rect-ver ROT JMP? POP2
50
-	RSW2 POP2
61
+			( draw ) ~color =dev/screen.color
62
+			( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x
63
+			,fill-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2
64
+		( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y
65
+		,fill-rect-ver ~dev/screen.y ~rect.y2 LTH2 JMP? POP2
66
+
67
+RTS
68
+
69
+@draw-picture ( x y width height color addr )
70
+	
71
+	( load ) DUP2 =dev/sprite.addr =pict.addr =pict.color =pict.height =pict.width DUP2 =dev/sprite.y =pict.y =pict.x
72
+	@draw-picture-ver
73
+		~pict.x =dev/sprite.x 
74
+		@draw-picture-hor
75
+			( draw ) ~pict.color =dev/sprite.color
76
+			( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x
77
+			( incr ) ~dev/sprite.addr #0008 ADD2 =dev/sprite.addr
78
+		,draw-picture-hor ~dev/sprite.x ~pict.width ~pict.x ADD2 LTH2 JMP? POP2
79
+		( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y
80
+	,draw-picture-ver ~dev/sprite.y ~pict.height ~pict.y ADD2 LTH2 JMP? POP2
81
+
82
+RTS
83
+
84
+@draw-label ( x y color addr )
85
+	
86
+	( load ) =label.addr =label.color =dev/sprite.y =dev/sprite.x ~label.addr
87
+	@draw-label-loop
88
+		( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color
89
+		( incr ) #0001 ADD2
90
+		( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x
91
+		DUP2 LDR #00 NEQ ,draw-label-loop ROT JMP? POP2
92
+	POP2
93
+
51 94
 RTS
52 95
 
96
+@pict_small [
97
+
98
+	ff80 8080 8080 8088 ffff fffc f8f9 f1f4
99
+	ffff 0010 c721 2120 ffff 3f0f 0717 c343
100
+	8888 8080 8080 8080 f0f1 f2f5 f2f1 f0f4
101
+	1208 804c 9212 4c00 7303 0343 1b1b fbfb
102
+	8080 8f83 8383 8393 f0f3 f1f0 e4c0 80ff
103
+	00c7 c7c6 4606 00ff c3d3 c307 870f 3fff
104
+	8f83 8383 8383 83ff fff7 fdff c0e2 f1ff
105
+	7fef bfff 07af 5fff ffff ffff ffff ffff
106
+]
107
+
108
+@font ( spectrum-zx font ) 
109
+[
110
+	0000 0000 0000 0000 0000 2400 7e3c 0000 0000 2400 3c42 0000 0000 6c7c 7c38 1000
111
+	0010 387c 7c38 1000 0038 387c 6c10 3800 0010 387c 7c10 3800 0000 0018 1800 0000
112
+	007e 4242 4242 7e00 0000 1824 2418 0000 0018 2442 4224 1800 001e 063a 4a48 3000
113
+	0038 446c 107c 1000 000c 0808 0838 3800 003e 2222 2266 6600 0000 0822 0022 0800
114
+	0000 1018 1c18 1000 0000 0818 3818 0800 0008 1c00 001c 0800 0028 2828 2800 2800
115
+	003e 4a4a 3a0a 0a00 000c 3046 620c 3000 0000 0000 0000 ffff 0010 3800 3810 0038
116
+	0008 1c2a 0808 0800 0008 0808 2a1c 0800 0000 0804 7e04 0800 0000 1020 7e20 1000
117
+	0000 4040 7e00 0000 0000 0024 6624 0000 0000 1038 7c00 0000 0000 007c 3810 0000
118
+	0000 0000 0000 0000 0008 0808 0800 0800 0014 1400 0000 0000 0024 7e24 247e 2400
119
+	0008 1e28 1c0a 3c08 0042 0408 1020 4200 0030 4832 4c44 3a00 0008 1000 0000 0000
120
+	0004 0808 0808 0400 0010 0808 0808 1000 0000 1408 3e08 1400 0000 0808 3e08 0800
121
+	0000 0000 0008 0810 0000 0000 3c00 0000 0000 0000 0000 0800 0000 0204 0810 2000
122
+	003c 464a 5262 3c00 0018 2808 0808 3e00 003c 4202 3c40 7e00 003c 421c 0242 3c00
123
+	0008 1828 487e 0800 007e 407c 0242 3c00 003c 407c 4242 3c00 007e 0204 0810 1000
124
+	003c 423c 4242 3c00 003c 4242 3e02 3c00 0000 0008 0000 0800 0000 0800 0008 0810
125
+	0000 0810 2010 0800 0000 003e 003e 0000 0000 1008 0408 1000 003c 4202 0c00 0800
126
+	003c 425a 5442 3c00 0018 2442 7e42 4200 007c 427c 4242 7c00 003c 4240 4042 3c00
127
+	0078 4442 4244 7800 007e 407c 4040 7e00 003e 4040 7c40 4000 003c 4240 4e42 3c00
128
+	0042 427e 4242 4200 003e 0808 0808 3e00 0002 0202 4242 3c00 0044 4870 4844 4200
129
+	0040 4040 4040 7e00 0042 665a 4242 4200 0042 6252 4a46 4200 003c 4242 4242 3c00
130
+	007c 4242 7c40 4000 003c 4242 524a 3c00 007c 4242 7c44 4200 003c 403c 0242 3c00
131
+	00fe 1010 1010 1000 0042 4242 4242 3c00 0042 4242 4224 1800 0042 4242 5a66 4200
132
+	0042 2418 1824 4200 0082 4428 1010 1000 007e 0408 1020 7e00 000c 0808 0808 0c00
133
+	0040 2010 0804 0200 0018 0808 0808 1800 0008 1422 0000 0000 0000 0000 0000 7e00
134
+	0008 0400 0000 0000 0000 1c02 1e22 1e00 0020 203c 2222 3c00 0000 1e20 2020 1e00
135
+	0002 021e 2222 1e00 0000 1c22 3c20 1e00 000c 101c 1010 1000 0000 1c22 221e 021c
136
+	0020 202c 3222 2200 0008 0018 0808 0400 0008 0008 0808 4830 0020 2428 3028 2400
137
+	0010 1010 1010 0c00 0000 6854 5454 5400 0000 5864 4444 4400 0000 3844 4444 3800
138
+	0000 7844 4478 4040 0000 3c44 443c 0406 0000 2c30 2020 2000 0000 3840 3804 7800
139
+	0010 103c 1010 0c00 0000 4444 4444 3800 0000 4444 2828 1000 0000 4454 5454 2800
140
+	0000 4428 1028 4400 0000 4444 443c 0438 0000 7c08 1020 7c00 000c 0810 1008 0c00
141
+	0008 0808 0808 0800 0030 1008 0810 3000 0000 0032 4c00 0000 3c42 99a1 a199 423c
142
+]
143
+
144
+@text [ Label Text ] <1 .00 ( add characters to memory )
145
+
53 146
 |c000 @FRAME BRK 
54 147
 |d000 @ERROR BRK 
55 148
 
56 149
 |FF10 ;dev/screen Screen
150
+|FF20 ;dev/sprite Sprite
57 151
 
58 152
 |FFF0 [ 0f0f 0fff 0ff0 ] ( palette )
59 153
 |FFFA .RESET .FRAME .ERROR ( vectors )
60 154
\ No newline at end of file
61 155
similarity index 100%
62 156
rename from examples/gui.hover.usm
63 157
rename to examples/old.hover.usm
64 158
deleted file mode 100644
... ...
@@ -1,81 +0,0 @@
1
-( draw routines )
2
-
3
-:dev/r fff8 ( std read port )
4
-:dev/w fff9 ( std write port )
5
-
6
-;x_ 2 ;y_ 2 ;color 1
7
-;x0 2 ;y0 2 ;x1 2 ;y1 2 ;dx 2 ;dy 2 ;err1 2 ;err2 2
8
-
9
-|0100 @RESET
10
-
11
-	( set dev/write to screen ) 
12
-	#01 =dev/w ( set dev/write to sprite ) 
13
-
14
-	( positive )
15
-	#01 ,color STR
16
-	+0030 ,x0 STR2 +0040 ,y0 STR2
17
-	+0100 ,x1 STR2 +0060 ,y1 STR2
18
-	,line JSR
19
-
20
-	#02 ,color STR
21
-	+0020 ,x0 STR2 +0010 ,y0 STR2
22
-	+0090 ,x1 STR2 +0070 ,y1 STR2
23
-	,line JSR
24
-
25
-	#03 ,color STR
26
-	+0010 ,x0 STR2 +0040 ,y0 STR2
27
-	+0070 ,x1 STR2 +0060 ,y1 STR2
28
-	,line JSR
29
-
30
-	( draw control points )
31
-	#02 ,color STR
32
-	,x0 LDR2 ,y0 LDR2 ,putpixel JSR
33
-	,x1 LDR2 ,y1 LDR2 ,putpixel JSR
34
-
35
-	,redraw JSR
36
-
37
-BRK
38
-
39
-@line
40
-	,x0 LDR2 ,x_ STR2 ,y0 LDR2 ,y_ STR2                   ( start at x0,y0 )
41
-	,x1 LDR2 ,x0 LDR2 ,diff16sub JSR ,dx STR2             ( int dx = abs[x1 - x0] )
42
-	,y1 LDR2 ,y0 LDR2 ,diff16sub JSR -0001 MULS2 ,dy STR2 ( int dy = -abs[y1 - y0] )
43
-	,dx LDR2 ,dy LDR2 ADDS2 ,err1 STR2                    ( int err1 = dx + dy, e2; )
44
-	@lineloop
45
-	,x_ LDR2 ,y_ LDR2 ,putpixel JSR                       ( draw )
46
-	@line-x
47
-	,err1 LDR2 +0002 MULS2 ,err2 STR2                     ( e2 = 2 * err; )
48
-	,err2 LDR2 ,dy LDR2 LTHS2 ,line-y ROT JMP? POP2 	  ( e2 >= dy )
49
-		,err1 LDR2 ,dy LDR2 ADDS2 ,err1 STR2 			  ( err1 += dy; )
50
-		,x_ LDR2 +0001 ADDS2 ,x_ STR2                     ( y0 += y0 < y1 ? 1 : -1; )
51
-	@line-y
52
-	,err2 LDR2 ,dx LDR2 GTHS2 ,line-end ROT JMP? POP2     ( e2 <= dx )
53
-		,err1 LDR2 ,dx LDR2 ADDS2 ,err1 STR2              ( err1 += dx; )
54
-		,y_ LDR2 +0001 ADDS2 ,y_ STR2                     ( y0 += y0 < y1 ? 1 : -1; )
55
-	@line-end
56
-	,x_ LDR2 ,x1 LDR2 NEQS2 ,lineloop ROT JMP? POP2       ( loop )
57
-	RTS
58
-
59
-@redraw
60
-	#0000 IOW2
61
-	#0000 IOW2
62
-	#00 IOW
63
-	#01 IOW
64
-	RTS
65
-
66
-@putpixel 
67
-	IOW2 ( y short )
68
-	IOW2 ( x short )
69
-	,color LDR IOW  ( color byte )
70
-	#00 IOW  ( redraw byte )
71
-	RTS
72
-
73
-@diff16
74
-	OVR2 OVR2 GTH2 ,diff16sub ROT JMP? POP2
75
-	SWP2 @diff16sub SUB2
76
-RTS
77
-
78
-|c000 @FRAME BRK 
79
-|d000 @ERROR BRK 
80
-|FFF0 [ f2ac 35bb 2b53 ] ( palette )
81
-|FFFA .RESET .FRAME .ERROR
82 0
similarity index 100%
83 1
rename from examples/gui.paint.usm
84 2
rename to examples/old.paint.usm