Browse code

Optimized noodle

neauoire authored on 27/03/2021 02:41:19
Showing 2 changed files
... ...
@@ -28,7 +28,7 @@ else
28 28
 fi
29 29
 
30 30
 echo "Assembling.."
31
-./bin/assembler projects/software/nasu.usm bin/boot.rom
31
+./bin/assembler projects/software/noodle.usm bin/boot.rom
32 32
 
33 33
 echo "Running.."
34 34
 if [ "${2}" = '--cli' ]; 
... ...
@@ -111,7 +111,7 @@ BRK
111 111
 	,draw-cursor JSR2
112 112
 
113 113
 	( release drag )
114
-	~Mouse.state #00 EQU ~brush.drag #01 EQU #0101 NEQ2 ,$no-release JNZ2
114
+	~Mouse.state #00 EQU ~brush.drag #01 EQU #0101 NEQ2 ^$no-release JNZ
115 115
 		~origin.x1 #0002 SUB2 ~origin.y1 #0002 SUB2 ~origin.x2 #0002 ADD2 ~origin.y2 #0002 ADD2 #00 ,fill-rect JSR2
116 116
 		~canvas.x1 -- ~canvas.y1 -- ~canvas.x2 ~canvas.y2 #10 ,line-rect JSR2
117 117
 		,draw-background JSR2
... ...
@@ -126,18 +126,18 @@ BRK
126 126
 	~Mouse.state ~brush.last EQU ,$no-touch-change JNZ2
127 127
 	~Mouse.x CLN2r ~canvas.x1 GTS2 STH2r ~canvas.x2 LTS2 #0101 NEQ2 ,$no-touch-change JNZ2
128 128
 	~Mouse.y CLN2r ~canvas.y1 GTS2 STH2r ~canvas.y2 LTS2 #0101 NEQ2 ,$no-touch-change JNZ2
129
-		~Mouse.state #00 EQU ,$no-touch-ondown JNZ2
129
+		~Mouse.state #00 EQU ^$no-touch-ondown JNZ
130 130
 			( on down )
131 131
 			~Mouse.x =cursor.dx
132 132
 			~Mouse.y =cursor.dy
133 133
 		$no-touch-ondown
134
-		~Mouse.state #00 NEQ ,$no-touch-onup JNZ2
134
+		~Mouse.state #00 NEQ ^$no-touch-onup JNZ
135 135
 			( on up )
136
-			~brush.tool #02 NEQ ,$no-touch-line JNZ2
136
+			~brush.tool #02 NEQ ^$no-touch-line JNZ
137 137
 				~cursor.dx ~canvas.x1 SUB2 ~cursor.dy ~canvas.y1 SUB2 ~Mouse.x ~canvas.x1 SUB2 ~Mouse.y ~canvas.y1 SUB2 ,paint-line JSR2
138 138
 				,$touch-end JMP2
139 139
 			$no-touch-line
140
-			~brush.tool #03 NEQ ,$no-touch-rect JNZ2
140
+			~brush.tool #03 NEQ ^$no-touch-rect JNZ
141 141
 				~cursor.dx ~canvas.x1 SUB2 ~cursor.dy ~canvas.y1 SUB2 ~Mouse.x ~canvas.x1 SUB2 ~Mouse.y ~canvas.y1 SUB2 ,paint-rect JSR2
142 142
 				,$touch-end JMP2
143 143
 			$no-touch-rect
... ...
@@ -148,7 +148,7 @@ BRK
148 148
 
149 149
 		( drag )
150 150
 		~Controller #02 NEQ ,$no-drag JNZ2
151
-			~brush.drag #00 NEQ ,$no-drag-start JNZ2
151
+			~brush.drag #00 NEQ ^$no-drag-start JNZ
152 152
 				~canvas.x1 =origin.x1
153 153
 				~canvas.y1 =origin.y1
154 154
 				~canvas.x2 =origin.x2
... ...
@@ -165,8 +165,8 @@ BRK
165 165
 		$no-drag
166 166
 
167 167
 		( in sizepane )
168
-		~Mouse.x CLN2r ~sizepane.x1 GTH2 STH2r ~sizepane.x2 LTH2 #0101 NEQ2 ,$no-touch-sizepane JNZ2
169
-		~Mouse.y CLN2r ~sizepane.y1 GTH2 STH2r ~sizepane.y2 LTH2 #0101 NEQ2 ,$no-touch-sizepane JNZ2
168
+		~Mouse.x CLN2r ~sizepane.x1 GTH2 STH2r ~sizepane.x2 LTH2 #0101 NEQ2 ^$no-touch-sizepane JNZ
169
+		~Mouse.y CLN2r ~sizepane.y1 GTH2 STH2r ~sizepane.y2 LTH2 #0101 NEQ2 ^$no-touch-sizepane JNZ
170 170
 			( release ) #00 =Mouse.state
171 171
 			#01 =brush.tool
172 172
 			~Mouse.x ~sizepane.x1 SUB2 8/ SWP POP =brush.size
... ...
@@ -176,8 +176,8 @@ BRK
176 176
 		$no-touch-sizepane
177 177
 
178 178
 		( in pattpane )
179
-		~Mouse.x CLN2r ~pattpane.x1 GTH2 STH2r ~pattpane.x2 LTH2 #0101 NEQ2 ,$no-touch-pattpane JNZ2
180
-		~Mouse.y CLN2r ~pattpane.y1 GTH2 STH2r ~pattpane.y2 LTH2 #0101 NEQ2 ,$no-touch-pattpane JNZ2
179
+		~Mouse.x CLN2r ~pattpane.x1 GTH2 STH2r ~pattpane.x2 LTH2 #0101 NEQ2 ^$no-touch-pattpane JNZ
180
+		~Mouse.y CLN2r ~pattpane.y1 GTH2 STH2r ~pattpane.y2 LTH2 #0101 NEQ2 ^$no-touch-pattpane JNZ
181 181
 			( release ) #00 =Mouse.state
182 182
 			~Mouse.x ~pattpane.x1 SUB2 8/ SWP POP =brush.patt
183 183
 			( draw ) ,draw-pattpane JSR2
... ...
@@ -185,8 +185,8 @@ BRK
185 185
 		$no-touch-pattpane
186 186
 
187 187
 		( in toolpane )
188
-		~Mouse.x CLN2r ~toolpane.x1 GTH2 STH2r ~toolpane.x2 LTH2 #0101 NEQ2 ,$no-touch-toolpane JNZ2
189
-		~Mouse.y CLN2r ~toolpane.y1 GTH2 STH2r ~toolpane.y2 LTH2 #0101 NEQ2 ,$no-touch-toolpane JNZ2
188
+		~Mouse.x CLN2r ~toolpane.x1 GTH2 STH2r ~toolpane.x2 LTH2 #0101 NEQ2 ^$no-touch-toolpane JNZ
189
+		~Mouse.y CLN2r ~toolpane.y1 GTH2 STH2r ~toolpane.y2 LTH2 #0101 NEQ2 ^$no-touch-toolpane JNZ
190 190
 			( release ) #00 =Mouse.state
191 191
 			~Mouse.x ~toolpane.x1 SUB2 8/ SWP POP =brush.tool
192 192
 			( draw ) ,draw-toolpane JSR2
... ...
@@ -200,17 +200,17 @@ BRK
200 200
 			( set cursor operation )
201 201
 			,add-pixel ~Mouse.state #01 EQU ,$no-oper JNZ2 POP2 ,remove-pixel $no-oper =brush.oper
202 202
 
203
-			~brush.tool #00 NEQ ,$no-touch-pen JNZ2
203
+			~brush.tool #00 NEQ ^$no-touch-pen JNZ
204 204
 				~cursor.x0 ~canvas.x1 SUB2 ~cursor.y0 ~canvas.y1 SUB2 ~Mouse.x ~canvas.x1 SUB2 ~Mouse.y ~canvas.y1 SUB2 ,paint-line JSR2
205 205
 				,$touch-end JMP2
206 206
 			$no-touch-pen
207 207
 
208
-			~brush.tool #01 NEQ ,$no-touch-brush JNZ2
208
+			~brush.tool #01 NEQ ^$no-touch-brush JNZ
209 209
 				~Mouse.x ~canvas.x1 SUB2 ~Mouse.y ~canvas.y1 SUB2 ,paint-brush JSR2
210 210
 				,$touch-end JMP2
211 211
 			$no-touch-brush
212 212
 
213
-			~brush.tool #04 NEQ ,$no-touch-zoom JNZ2
213
+			~brush.tool #04 NEQ ^$no-touch-zoom JNZ
214 214
 				~zoom.active #00 EQU =zoom.active
215 215
 				( release ) #00 =Mouse.state
216 216
 				~Mouse.x ~canvas.x1 SUB2 ~canvas.w 2/ SUB2 =zoom.x
... ...
@@ -222,14 +222,14 @@ BRK
222 222
 		$no-touch-canvas
223 223
 
224 224
 		( background interface )
225
-		~Mouse.y STEP8 ~Screen.height #0010 SUB2 NEQ2 ,$no-touch-background JNZ2
225
+		~Mouse.y STEP8 ~Screen.height #0010 SUB2 NEQ2 ^$no-touch-background JNZ
226 226
 			~Mouse.x ~Screen.width #0020 SUB2 SUB2 8/ 
227
-			DUP2 #0001 NEQ2 ,$no-load-button JNZ2
227
+			DUP2 #0001 NEQ2 ^$no-load-button JNZ
228 228
 				,filepath ,load-file JSR2
229 229
 				,draw-canvas JSR2
230 230
 				( release ) #00 =Mouse.state
231 231
 			$no-load-button
232
-			DUP2 #0002 NEQ2 ,$no-save-button JNZ2
232
+			DUP2 #0002 NEQ2 ^$no-save-button JNZ
233 233
 				,filepath ,save-file JSR2
234 234
 				( release ) #00 =Mouse.state
235 235
 			$no-save-button
... ...
@@ -242,34 +242,34 @@ BRK
242 242
 	$no-touch
243 243
 
244 244
 	~Controller.buttons #f0 AND
245
-		DUP #04 SFT #01 AND #01 NEQ ,$no-up JNZ2
245
+		DUP #04 SFT #01 AND #01 NEQ ^$no-up JNZ
246 246
 			( move ) ~zoom.y -- =zoom.y $no-up
247
-		DUP #05 SFT #01 AND #01 NEQ ,$no-down JNZ2
247
+		DUP #05 SFT #01 AND #01 NEQ ^$no-down JNZ
248 248
 			( move ) ~zoom.y ++ =zoom.y $no-down
249
-		DUP #06 SFT #01 AND #01 NEQ ,$no-left JNZ2
249
+		DUP #06 SFT #01 AND #01 NEQ ^$no-left JNZ
250 250
 			( move ) ~zoom.x -- =zoom.x $no-left
251
-		DUP #07 SFT #01 AND #01 NEQ ,$no-right JNZ2
251
+		DUP #07 SFT #01 AND #01 NEQ ^$no-right JNZ
252 252
 			( move ) ~zoom.x ++ =zoom.x $no-right
253 253
 	#00 EQU #04 JNZ ,draw-canvas JSR2
254 254
 	
255 255
 	~Keys #00 EQU ,$no-keys JNZ2
256 256
 		~Keys 
257
-		DUP #20 NEQ ,$no-space JNZ2
257
+		DUP #20 NEQ ^$no-space JNZ
258 258
 			( toggle zoom ) ~zoom.active #00 EQU =zoom.active ,redraw JSR2 $no-space 
259
-		DUP #08 NEQ ,$no-backspace JNZ2
259
+		DUP #08 NEQ ^$no-backspace JNZ
260 260
 			( erase ) ,clear JSR2 $no-backspace
261
-		DUP #71 NEQ ,$no-qkey JNZ2
261
+		DUP #71 NEQ ^$no-qkey JNZ
262 262
 			( tool0 ) #00 =brush.tool ,draw-toolpane JSR2 $no-qkey
263
-		DUP #77 NEQ ,$no-wkey JNZ2
263
+		DUP #77 NEQ ^$no-wkey JNZ
264 264
 			( tool0 ) #01 =brush.tool ,draw-toolpane JSR2 $no-wkey
265
-		DUP #65 NEQ ,$no-ekey JNZ2
265
+		DUP #65 NEQ ^$no-ekey JNZ
266 266
 			( tool0 ) #02 =brush.tool ,draw-toolpane JSR2 $no-ekey
267
-		DUP #72 NEQ ,$no-rkey JNZ2
267
+		DUP #72 NEQ ^$no-rkey JNZ
268 268
 			( tool0 ) #03 =brush.tool ,draw-toolpane JSR2 $no-rkey
269
-		DUP #74 NEQ ,$no-tkey JNZ2
269
+		DUP #74 NEQ ^$no-tkey JNZ
270 270
 			( tool0 ) #04 =brush.tool ,draw-toolpane JSR2 $no-tkey
271 271
 		DUP 
272
-			DUP #30 GTH SWP #39 LTH #0101 NEQ2 ,$no-numkey JNZ2
272
+			DUP #30 GTH SWP #39 LTH #0101 NEQ2 ^$no-numkey JNZ
273 273
 			( size ) ~Keys #31 SUB =brush.size ,draw-sizepane JSR2 $no-numkey
274 274
 		POP
275 275
 		( release ) #00 =Keys
... ...
@@ -285,7 +285,7 @@ BRK
285 285
 	
286 286
 	( from ) ,data
287 287
 	( to ) ~canvas.w ~canvas.h MUL2 #0008 MUL2 ,data ADD2
288
-	$loop NOP
288
+	$loop
289 289
 		OVR2 #00 ROT ROT POK2
290 290
 		( incr ) SWP2 #0001 ADD2 SWP2
291 291
 		OVR2 OVR2 LTH2 ^$loop JNZ
... ...
@@ -320,7 +320,7 @@ RTN
320 320
 	( load ) =line.y1 =line.x1 =line.y2 =line.x2
321 321
 
322 322
 	( trim if zoomed )
323
-	~zoom.active #01 NEQ ,$no-zoom JNZ2
323
+	~zoom.active #01 NEQ ^$no-zoom JNZ
324 324
 		~line.x1 8/ ~zoom.x ADD2 =line.x1
325 325
 		~line.y1 8/ ~zoom.y ADD2 =line.y1
326 326
 		~line.x2 8/ ~zoom.x ADD2 =line.x2
... ...
@@ -334,18 +334,17 @@ RTN
334 334
 	~line.dx ~line.dy ADD2 =line.e1
335 335
 	$loop
336 336
 		( paint ) ~line.x2 ~line.y2 ~brush.oper JSR2
337
-		~line.x2 ~line.x1 EQU2 ~line.y2 ~line.y1 EQU2 #0101 EQU2 ,$end JNZ2
337
+		~line.x2 ~line.x1 EQU2 ~line.y2 ~line.y1 EQU2 #0101 EQU2 ^$end JNZ
338 338
 		~line.e1 #0002 MUL2 =line.e2
339
-		~line.e2 ~line.dy LTS2 ,$skipy JNZ2
339
+		~line.e2 ~line.dy LTS2 ^$skipy JNZ
340 340
 			~line.e1 ~line.dy ADD2 =line.e1
341 341
 			~line.x2 ~line.sx ADD2 =line.x2
342 342
 		$skipy
343
-		~line.e2 ~line.dx GTS2 ,$skipx JNZ2
343
+		~line.e2 ~line.dx GTS2 ^$skipx JNZ
344 344
 			~line.e1 ~line.dx ADD2 =line.e1
345 345
 			~line.y2 ~line.sy ADD2 =line.y2
346 346
 		$skipx
347 347
 		,$loop JMP2
348
-
349 348
 	$end
350 349
 
351 350
 	,draw-canvas JSR2
... ...
@@ -360,7 +359,7 @@ RTN
360 359
 	( load ) =rect.y2 =rect.x2 =rect.y1 =rect.x1
361 360
 
362 361
 	( trim if zoomed )
363
-	~zoom.active #01 NEQ ,$no-zoom JNZ2
362
+	~zoom.active #01 NEQ ^$no-zoom JNZ
364 363
 		~rect.x1 8/ ~zoom.x ADD2 =rect.x1
365 364
 		~rect.y1 8/ ~zoom.y ADD2 =rect.y1
366 365
 		~rect.x2 8/ ~zoom.x ADD2 #0001 ADD2 =rect.x2
... ...
@@ -374,13 +373,12 @@ RTN
374 373
 		~rect.x1 =pt2.x
375 374
 		$hor
376 375
 			~pt2.x SWP POP =px.x ~pt2.y SWP POP =px.y
377
-			,patternize JSR2 #00 EQU ,$no-pixel JNZ2
378
-				( draw ) ~pt2.x ~pt2.y ~brush.oper JSR2
379
-			$no-pixel
376
+			,patternize JSR2 #00 EQU ^$no-pixel JNZ
377
+				( draw ) ~pt2.x ~pt2.y ~brush.oper JSR2 $no-pixel
380 378
 			( incr ) ~pt2.x ++ =pt2.x
381
-			~pt2.x ~rect.x2 LTS2 ,$hor JNZ2
379
+			~pt2.x ~rect.x2 LTS2 ^$hor JNZ
382 380
 		~pt2.y ++ =pt2.y
383
-		~pt2.y ~rect.y2 LTS2 ,$ver JNZ2
381
+		~pt2.y ~rect.y2 LTS2 ^$ver JNZ
384 382
 
385 383
 	,draw-canvas JSR2
386 384
 	,draw-toolpane JSR2
... ...
@@ -394,7 +392,7 @@ RTN
394 392
 	#0003 SUB2 =pt0.y #0003 SUB2 =pt0.x ( cursor offset )
395 393
 
396 394
 	( trim if zoomed )
397
-	~zoom.active #01 NEQ ,$no-zoom JNZ2
395
+	~zoom.active #01 NEQ ^$no-zoom JNZ
398 396
 		~pt0.x 8/ ~zoom.x ADD2 #0003 SUB2 =pt0.x
399 397
 		~pt0.y 8/ ~zoom.y ADD2 #0003 SUB2 =pt0.y
400 398
 	$no-zoom
... ...
@@ -405,14 +403,13 @@ RTN
405 403
 		$hor
406 404
 			( addr ) ,size_icn #00 ~brush.size 8* ADD2
407 405
 			( byte ) #00 ~px.y ADD2 PEK2 #07 ~px.x SUB SFT #01 AND 
408
-			#00 EQU ,$no-pixel JNZ2
409
-				,patternize JSR2 #00 EQU ,$no-pixel JNZ2
410
-				~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 ~brush.oper JSR2
411
-			$no-pixel
406
+			#00 EQU ^$no-pixel JNZ
407
+			,patternize JSR2 #00 EQU ^$no-pixel JNZ
408
+				~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 ~brush.oper JSR2 $no-pixel
412 409
 			( incr ) ~px.x #01 ADD =px.x
413
-			~px.x #08 LTH ,$hor JNZ2
410
+			~px.x #08 LTH ^$hor JNZ
414 411
 		( incr ) ~px.y #01 ADD =px.y
415
-		~px.y #08 LTH ,$ver JNZ2
412
+		~px.y #08 LTH ^$ver JNZ
416 413
 
417 414
 	,draw-canvas JSR2
418 415
 	,draw-toolpane JSR2
... ...
@@ -423,44 +420,44 @@ RTN
423 420
 
424 421
 @patternize
425 422
 
426
-	~brush.patt #00 NEQ ,$noplain JNZ2
423
+	~brush.patt #00 NEQ ^$noplain JNZ
427 424
 		#01 RTN
428 425
 	$noplain
429 426
 
430
-	~brush.patt #01 NEQ ,$notone1 JNZ2
427
+	~brush.patt #01 NEQ ^$notone1 JNZ
431 428
 		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 ADD2 #0001 AND2 #0000 EQU2 
432 429
 		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 SUB2 #0001 AND2 #0000 EQU2 
433 430
 		#0101 EQU2
434 431
 		RTN
435 432
 	$notone1
436 433
 
437
-	~brush.patt #02 NEQ ,$notone2 JNZ2
434
+	~brush.patt #02 NEQ ^$notone2 JNZ
438 435
 		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 ADD2 #0003 AND2 #0000 EQU2 
439 436
 		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 SUB2 #0003 AND2 #0000 EQU2 
440 437
 		#0101 EQU2
441 438
 		RTN
442 439
 	$notone2
443 440
 
444
-	~brush.patt #03 NEQ ,$notone3 JNZ2
441
+	~brush.patt #03 NEQ ^$notone3 JNZ
445 442
 		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 ADD2 #0005 AND2 #0000 EQU2 
446 443
 		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 SUB2 #0005 AND2 #0000 EQU2 
447 444
 		#0101 EQU2
448 445
 		RTN
449 446
 	$notone3
450 447
 
451
-	~brush.patt #04 NEQ ,$notone4 JNZ2
452
-		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 ADD2 #0003 AND2 #0000 EQU2  RTN
448
+	~brush.patt #04 NEQ ^$notone4 JNZ
449
+		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 ADD2 #0003 AND2 #0000 EQU2 RTN
453 450
 	$notone4
454 451
 
455
-	~brush.patt #05 NEQ ,$notone5 JNZ2
456
-		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 SUB2 #0003 AND2 #0000 EQU2  RTN
452
+	~brush.patt #05 NEQ ^$notone5 JNZ
453
+		~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 SUB2 #0003 AND2 #0000 EQU2 RTN
457 454
 	$notone5
458 455
 
459
-	~brush.patt #06 NEQ ,$notone6 JNZ2
456
+	~brush.patt #06 NEQ ^$notone6 JNZ
460 457
 		~pt0.x #00 ~px.x ADD2 #0001 AND2 SWP POP RTN
461 458
 	$notone6
462 459
 
463
-	~brush.patt #07 NEQ ,$notone7 JNZ2
460
+	~brush.patt #07 NEQ ^$notone7 JNZ
464 461
 		~pt0.y #00 ~px.y ADD2 #0001 AND2 SWP POP RTN
465 462
 	$notone7
466 463
 
... ...
@@ -522,9 +519,9 @@ RTN
522 519
 			( draw ) #09 =Sprite.color
523 520
 			( incr ) ~Sprite.x 8+ =Sprite.x
524 521
 			( incr ) ~Sprite.addr 8+ =Sprite.addr
525
-		~Sprite.x ~canvas.x2 NEQ2 ,$hor JNZ2
522
+		~Sprite.x ~canvas.x2 NEQ2 ^$hor JNZ
526 523
 		( incr ) ~Sprite.y 8+ =Sprite.y
527
-	~Sprite.y ~canvas.y2 NEQ2 ,$ver JNZ2
524
+	~Sprite.y ~canvas.y2 NEQ2 ^$ver JNZ
528 525
 
529 526
 RTN
530 527
 
... ...
@@ -541,10 +538,10 @@ RTN
541 538
 			( draw ) #09 =Sprite.color
542 539
 			( incr ) ~Sprite.x 8+ =Sprite.x
543 540
 			( incr ) ~pt1.x ++ =pt1.x
544
-		~Sprite.x ~canvas.x2 NEQ2 ,$hor JNZ2
541
+		~Sprite.x ~canvas.x2 NEQ2 ^$hor JNZ
545 542
 		( incr ) ~Sprite.y 8+ =Sprite.y
546 543
 		( incr ) ~pt1.y ++ =pt1.y
547
-	~Sprite.y ~canvas.y2 NEQ2 ,$ver JNZ2
544
+	~Sprite.y ~canvas.y2 NEQ2 ^$ver JNZ
548 545
 
549 546
 RTN
550 547
 
... ...
@@ -582,12 +579,12 @@ RTN
582 579
 		~Mouse.x CLN2r ~sizepane.x1 GTH2 STH2r ~sizepane.x2 LTH2 #0101 EQU2 ~Mouse.y CLN2r ~sizepane.y1 GTH2 STH2r ~sizepane.y2 LTH2 #0101 EQU2 #0101 EQU2 ,$outside-canvas JNZ2
583 580
 		~Mouse.x CLN2r ~pattpane.x1 GTH2 STH2r ~pattpane.x2 LTH2 #0101 EQU2 ~Mouse.y CLN2r ~pattpane.y1 GTH2 STH2r ~pattpane.y2 LTH2 #0101 EQU2 #0101 EQU2 ,$outside-canvas JNZ2
584 581
 		( do not draw size when holding alt )
585
-		~Controller #02 EQU ,$outside-canvas JNZ2
582
+		~Controller #02 EQU ^$outside-canvas JNZ
586 583
 		~cursor.x #0003 SUB2 =Sprite.x
587 584
 		~cursor.y #0003 SUB2 =Sprite.y
588 585
 		,brush_view #00 ~brush.size 8* ADD2 =Sprite.addr
589 586
 		#11 ~Mouse.state #02 MUL ADD =Sprite.color
590
-		~Mouse.state #00 EQU ,$outside-canvas JNZ2
587
+		~Mouse.state #00 EQU ^$outside-canvas JNZ
591 588
 			RTN
592 589
 	$outside-canvas
593 590
 
... ...
@@ -611,9 +608,9 @@ RTN
611 608
 		( draw ) #01 ~Sprite.x ~pattpane.x1 SUB2 8/ SWP POP ~brush.tool EQU #02 MUL ADD =Sprite.color
612 609
 		( incr ) ~Sprite.x 8+ =Sprite.x
613 610
 		( incr ) ~Sprite.addr 8+ =Sprite.addr
614
-		~Sprite.x ~toolpane.x2 LTH2 ,$tools JNZ2
611
+		~Sprite.x ~toolpane.x2 LTH2 ^$tools JNZ
615 612
 
616
-	~zoom.active #01 NEQ ,$no-zoom JNZ2
613
+	~zoom.active #01 NEQ ^$no-zoom JNZ
617 614
 		~Sprite.x #0008 SUB2 =Sprite.x
618 615
 		,tool_icn #0028 ADD2 =Sprite.addr
619 616
 		#01 #04 ~brush.tool EQU #02 MUL ADD =Sprite.color
... ...
@@ -634,7 +631,7 @@ RTN
634 631
 		( draw ) #01 ~Sprite.x ~pattpane.x1 SUB2 8/ SWP POP ~brush.patt EQU #02 MUL ADD =Sprite.color
635 632
 		( incr ) ~Sprite.x 8+ =Sprite.x
636 633
 		( incr ) ~Sprite.addr 8+ =Sprite.addr
637
-		~Sprite.x ~pattpane.x2 LTH2 ,$patterns JNZ2
634
+		~Sprite.x ~pattpane.x2 LTH2 ^$patterns JNZ
638 635
 
639 636
 RTN
640 637
 
... ...
@@ -651,7 +648,7 @@ RTN
651 648
 		( draw ) #01 ~Sprite.x ~sizepane.x1 SUB2 8/ SWP POP ~brush.size EQU #02 MUL ADD =Sprite.color
652 649
 		( incr ) ~Sprite.x 8+ =Sprite.x
653 650
 		( incr ) ~Sprite.addr 8+ =Sprite.addr
654
-		~Sprite.x ~sizepane.x2 LTH2 ,$patterns JNZ2
651
+		~Sprite.x ~sizepane.x2 LTH2 ^$patterns JNZ
655 652
 
656 653
 RTN
657 654
 
... ...
@@ -711,13 +708,13 @@ RTN
711 708
 		( incr ) ~Screen.x ++ =Screen.x
712 709
 		( draw ) ~rect.y1 =Screen.y ~color =Screen.color
713 710
 		( draw ) ~rect.y2 =Screen.y ~color =Screen.color
714
-		~Screen.x ~rect.x2 NEQ2 ,$hor JNZ2
711
+		~Screen.x ~rect.x2 NEQ2 ^$hor JNZ
715 712
 	~rect.y1 =Screen.y
716 713
 	$ver
717 714
 		( draw ) ~rect.x1 =Screen.x ~color =Screen.color
718 715
 		( draw ) ~rect.x2 =Screen.x ~color =Screen.color
719 716
 		( incr ) ~Screen.y ++ =Screen.y
720
-		~Screen.y ~rect.y2 ++ NEQ2 ,$ver JNZ2
717
+		~Screen.y ~rect.y2 ++ NEQ2 ^$ver JNZ
721 718
 
722 719
 RTN
723 720
 
... ...
@@ -729,9 +726,9 @@ RTN
729 726
 		$hor
730 727
 			( draw ) ~color =Screen.color
731 728
 			( incr ) ~Screen.x ++ =Screen.x
732
-			~Screen.x ~rect.x2 NEQ2 ,$hor JNZ2
729
+			~Screen.x ~rect.x2 NEQ2 ^$hor JNZ
733 730
 		( incr ) ~Screen.y ++ =Screen.y
734
-		~Screen.y ~rect.y2 NEQ2 ,$ver JNZ2
731
+		~Screen.y ~rect.y2 NEQ2 ^$ver JNZ
735 732
 
736 733
 RTN
737 734