... | ... |
@@ -6,6 +6,7 @@ |
6 | 6 |
TODO |
7 | 7 |
- Only draw-canvas when mouse has changed |
8 | 8 |
- Only draw-canvas target tile |
9 |
+ - Resize buttons |
|
9 | 10 |
) |
10 | 11 |
|
11 | 12 |
%RTN { JMP2r } |
... | ... |
@@ -18,7 +19,7 @@ |
18 | 19 |
|
19 | 20 |
;center { x 2 y 2 } |
20 | 21 |
;toolbar { x1 2 y1 2 x2 2 y2 2 } |
21 |
-;cursor { x 2 y 2 x0 2 y0 2 size 1 drag 1 } |
|
22 |
+;cursor { x 2 y 2 x0 2 y0 2 size 1 patt 1 drag 1 } |
|
22 | 23 |
;rect { x1 2 y1 2 x2 2 y2 2 } |
23 | 24 |
;color { byte 1 } |
24 | 25 |
;pos { x 2 y 2 } |
... | ... |
@@ -35,6 +36,9 @@ |
35 | 36 |
~Screen.width #0002 DIV2 =center.x |
36 | 37 |
~Screen.height #0002 DIV2 =center.y |
37 | 38 |
|
39 |
+ ( default brush ) |
|
40 |
+ #04 =cursor.size |
|
41 |
+ |
|
38 | 42 |
#0010 =canvas.x1 #0016 =canvas.y1 |
39 | 43 |
#0026 =canvas.w #001a =canvas.h ( 380x260 ) |
40 | 44 |
#0010 =toolbar.x1 #0010 =toolbar.y1 |
... | ... |
@@ -62,7 +66,6 @@ BRK |
62 | 66 |
,draw-titlebar JSR2 |
63 | 67 |
,fit-toolbar JSR2 |
64 | 68 |
#00 =cursor.drag |
65 |
- #aa =Console.byte |
|
66 | 69 |
$no-release |
67 | 70 |
|
68 | 71 |
,$no-touch ~Mouse.state #00 EQU JMP2? |
... | ... |
@@ -82,12 +85,17 @@ BRK |
82 | 85 |
( in toolbar ) |
83 | 86 |
,$no-touch-toolbar ~Mouse.x CLN2r ~toolbar.x1 GTH2 STH2r ~toolbar.x2 LTH2 #0101 NEQ2 JMP2? |
84 | 87 |
,$no-touch-toolbar ~Mouse.y CLN2r ~toolbar.y1 GTH2 STH2r ~toolbar.y2 LTH2 #0101 NEQ2 JMP2? |
88 |
+ ( release ) #00 =Mouse.state |
|
85 | 89 |
,$no-touch-size ~Mouse.x ~toolbar.x1 SUB2 8/ #0000 NEQ2 JMP2? |
86 | 90 |
~Mouse.y ~toolbar.y1 SUB2 8/ SWP POP =cursor.size |
87 |
- #00 =Mouse.state |
|
88 |
- ,draw-toolbar JSR2 |
|
91 |
+ ( draw ) ,draw-toolbar JSR2 |
|
89 | 92 |
,$touch-end JMP2 |
90 | 93 |
$no-touch-size |
94 |
+ ,$no-touch-brush ~Mouse.x ~toolbar.x1 SUB2 8/ #0001 NEQ2 JMP2? |
|
95 |
+ ~Mouse.y ~toolbar.y1 SUB2 8/ SWP POP =cursor.patt |
|
96 |
+ ( draw ) ,draw-toolbar JSR2 |
|
97 |
+ ,$touch-end JMP2 |
|
98 |
+ $no-touch-brush |
|
91 | 99 |
$no-touch-toolbar |
92 | 100 |
|
93 | 101 |
( in canvas ) |
... | ... |
@@ -120,10 +128,11 @@ RTN |
120 | 128 |
$ver |
121 | 129 |
#00 =px.x |
122 | 130 |
$hor |
123 |
- ( addr ) ,size0_icn #00 ~cursor.size 8* ADD2 |
|
131 |
+ ( addr ) ,size_icn #00 ~cursor.size 8* ADD2 |
|
124 | 132 |
( byte ) #00 ~px.y ADD2 LDR #07 ~px.x SUB SHR #01 AND |
125 | 133 |
|
126 | 134 |
#00 EQU ,$no-pixel ROT JMP2? |
135 |
+ ,$no-pixel ,patternize JSR2 #00 EQU JMP2? |
|
127 | 136 |
~pos.x #00 ~px.x ADD2 ~pos.y #00 ~px.y ADD2 ,add-pixel JSR2 |
128 | 137 |
$no-pixel |
129 | 138 |
|
... | ... |
@@ -137,6 +146,55 @@ RTN |
137 | 146 |
|
138 | 147 |
RTN |
139 | 148 |
|
149 |
+@patternize |
|
150 |
+ |
|
151 |
+ ,$noplain ~cursor.patt #00 NEQ JMP2? |
|
152 |
+ #01 RTN |
|
153 |
+ $noplain |
|
154 |
+ |
|
155 |
+ ,$notone1 ~cursor.patt #01 NEQ JMP2? |
|
156 |
+ ~pos.x #00 ~px.x ADD2 ~pos.y #00 ~px.y ADD2 ADD2 #0001 AND2 #0000 EQU2 |
|
157 |
+ ~pos.x #00 ~px.x ADD2 ~pos.y #00 ~px.y ADD2 SUB2 #0001 AND2 #0000 EQU2 |
|
158 |
+ #0101 EQU2 |
|
159 |
+ RTN |
|
160 |
+ $notone1 |
|
161 |
+ |
|
162 |
+ ,$notone2 ~cursor.patt #02 NEQ JMP2? |
|
163 |
+ ~pos.x #00 ~px.x ADD2 ~pos.y #00 ~px.y ADD2 ADD2 #0003 AND2 #0000 EQU2 |
|
164 |
+ ~pos.x #00 ~px.x ADD2 ~pos.y #00 ~px.y ADD2 SUB2 #0003 AND2 #0000 EQU2 |
|
165 |
+ #0101 EQU2 |
|
166 |
+ RTN |
|
167 |
+ $notone2 |
|
168 |
+ |
|
169 |
+ ,$notone3 ~cursor.patt #03 NEQ JMP2? |
|
170 |
+ ~pos.x #00 ~px.x ADD2 ~pos.y #00 ~px.y ADD2 ADD2 #0005 AND2 #0000 EQU2 |
|
171 |
+ ~pos.x #00 ~px.x ADD2 ~pos.y #00 ~px.y ADD2 SUB2 #0005 AND2 #0000 EQU2 |
|
172 |
+ #0101 EQU2 |
|
173 |
+ RTN |
|
174 |
+ $notone3 |
|
175 |
+ |
|
176 |
+ ,$notone4 ~cursor.patt #04 NEQ JMP2? |
|
177 |
+ ~pos.x #00 ~px.x ADD2 ~pos.y #00 ~px.y ADD2 ADD2 #0003 AND2 #0000 EQU2 |
|
178 |
+ RTN |
|
179 |
+ $notone4 |
|
180 |
+ |
|
181 |
+ ,$notone5 ~cursor.patt #05 NEQ JMP2? |
|
182 |
+ ~pos.x #00 ~px.x ADD2 ~pos.y #00 ~px.y ADD2 SUB2 #0003 AND2 #0000 EQU2 |
|
183 |
+ RTN |
|
184 |
+ $notone5 |
|
185 |
+ |
|
186 |
+ ,$notone6 ~cursor.patt #06 NEQ JMP2? |
|
187 |
+ ~pos.x #00 ~px.x ADD2 #0001 AND2 SWP POP RTN |
|
188 |
+ $notone6 |
|
189 |
+ |
|
190 |
+ ,$notone7 ~cursor.patt #07 NEQ JMP2? |
|
191 |
+ ~pos.y #00 ~px.y ADD2 #0001 AND2 SWP POP RTN |
|
192 |
+ $notone7 |
|
193 |
+ |
|
194 |
+ #00 |
|
195 |
+ |
|
196 |
+RTN |
|
197 |
+ |
|
140 | 198 |
@add-pixel ( x y ) |
141 | 199 |
|
142 | 200 |
=pix.y =pix.x |
... | ... |
@@ -246,7 +304,7 @@ RTN |
246 | 304 |
|
247 | 305 |
@fit-toolbar |
248 | 306 |
|
249 |
- ~toolbar.x1 #0010 ADD2 =toolbar.x2 |
|
307 |
+ ~toolbar.x1 #0018 ADD2 =toolbar.x2 |
|
250 | 308 |
~toolbar.y1 #0040 ADD2 =toolbar.y2 |
251 | 309 |
,draw-toolbar JSR2 |
252 | 310 |
|
... | ... |
@@ -259,21 +317,32 @@ RTN |
259 | 317 |
|
260 | 318 |
~toolbar.x1 =Sprite.x |
261 | 319 |
~toolbar.y1 =Sprite.y |
262 |
- ,size0_icn =Sprite.addr |
|
320 |
+ ,size_icn =Sprite.addr |
|
263 | 321 |
|
264 | 322 |
( draw brush sizes ) |
265 | 323 |
|
266 | 324 |
$sizes |
267 |
- |
|
268 | 325 |
( draw ) #09 ~Sprite.y ~toolbar.y1 SUB2 8/ SWP POP ~cursor.size EQU #02 MUL ADD =Sprite.color |
269 | 326 |
( incr ) ~Sprite.y 8+ =Sprite.y |
270 | 327 |
( incr ) ~Sprite.addr 8+ =Sprite.addr |
271 | 328 |
,$sizes ~Sprite.y ~toolbar.y1 #0040 ADD2 LTH2 JMP2? |
272 | 329 |
|
273 |
- ( draw brush tools ) |
|
330 |
+ ( draw brush patterns ) |
|
274 | 331 |
|
275 | 332 |
~toolbar.x1 8+ =Sprite.x |
276 | 333 |
~toolbar.y1 =Sprite.y |
334 |
+ ,pattern_icn =Sprite.addr |
|
335 |
+ |
|
336 |
+ $patterns |
|
337 |
+ ( draw ) #09 ~Sprite.y ~toolbar.y1 SUB2 8/ SWP POP ~cursor.patt EQU #02 MUL ADD =Sprite.color |
|
338 |
+ ( incr ) ~Sprite.y 8+ =Sprite.y |
|
339 |
+ ( incr ) ~Sprite.addr 8+ =Sprite.addr |
|
340 |
+ ,$patterns ~Sprite.y ~toolbar.y1 #0040 ADD2 LTH2 JMP2? |
|
341 |
+ |
|
342 |
+ ( draw brush tools ) |
|
343 |
+ |
|
344 |
+ ~toolbar.x1 #0010 ADD2 =Sprite.x |
|
345 |
+ ~toolbar.y1 =Sprite.y |
|
277 | 346 |
|
278 | 347 |
$brushes |
279 | 348 |
( draw ) #09 =Sprite.color |
... | ... |
@@ -329,24 +398,35 @@ RTN |
329 | 398 |
|
330 | 399 |
RTN |
331 | 400 |
|
332 |
-@size0_icn [ 0000 0010 0000 0000 ] |
|
333 |
-@size1_icn [ 0000 1038 1000 0000 ] |
|
334 |
-@size2_icn [ 0000 3838 3800 0000 ] |
|
335 |
-@size3_icn [ 0010 387c 3810 0000 ] |
|
336 |
-@size4_icn [ 0038 7c7c 7c38 0000 ] |
|
337 |
-@size5_icn [ 1038 7cfe 7c38 1000 ] |
|
338 |
-@size6_icn [ 387c fefe fe7c 3800 ] |
|
339 |
-@size7_icn [ 7cfe fefe fefe 7c00 ] |
|
401 |
+@size_icn |
|
402 |
+ [ 0000 0010 0000 0000 ] |
|
403 |
+ [ 0000 1038 1000 0000 ] |
|
404 |
+ [ 0000 3838 3800 0000 ] |
|
405 |
+ [ 0010 387c 3810 0000 ] |
|
406 |
+ [ 0038 7c7c 7c38 0000 ] |
|
407 |
+ [ 1038 7cfe 7c38 1000 ] |
|
408 |
+ [ 387c fefe fe7c 3800 ] |
|
409 |
+ [ 7cfe fefe fefe 7c00 ] |
|
410 |
+ |
|
411 |
+@pattern_icn |
|
412 |
+ [ fe82 baba ba82 fe00 ] |
|
413 |
+ [ fed6 aad6 aad6 fe00 ] |
|
414 |
+ [ fe92 82d6 8292 fe00 ] |
|
415 |
+ [ fe82 92aa 9282 fe00 ] |
|
416 |
+ [ fea6 ca92 a6ca fe00 ] |
|
417 |
+ [ feca a692 caa6 fe00 ] |
|
418 |
+ [ feaa aaaa aaaa fe00 ] |
|
419 |
+ [ fe82 fe82 fe82 fe00 ] |
|
340 | 420 |
|
341 | 421 |
@brush_pointer [ 80c0 e0f0 f8e0 1000 ] |
342 | 422 |
@brush_hand [ 4040 4070 f8f8 f870 ] |
343 | 423 |
@brush_eraser [ 2050 b87c 3e1c 0800 ] |
344 |
-@brush_pattern0 [ ffff ffff ffff ffff ] |
|
345 |
-@brush_pattern1 [ aa55 aa55 aa55 aa55 ] |
|
346 |
-@brush_pattern2 [ 8800 2200 8800 2200 ] |
|
347 | 424 |
|
348 | 425 |
@mode_guidesoff [ 0038 4492 2810 0000 ] |
349 | 426 |
@mode_zoomout [ 3048 8484 4834 0200 ] |
427 |
+[ 0000 0000 0000 0000 ] |
|
428 |
+[ 0000 0000 0000 0000 ] |
|
429 |
+[ 0000 0000 0000 0000 ] |
|
350 | 430 |
|
351 | 431 |
@mode_guideson [ 0000 0082 4438 0000 ] |
352 | 432 |
@mode_zoomin [ 3245 8284 4834 0200 ] |