Browse code

Progress on nasu revamp

neauoire authored on 10/05/2021 03:43:33
Showing 5 changed files
... ...
@@ -34,7 +34,7 @@ else
34 34
 fi
35 35
 
36 36
 echo "Assembling.."
37
-./bin/assembler projects/software/nasu.usm bin/boot.rom
37
+./bin/assembler projects/demos/life.usm bin/boot.rom
38 38
 
39 39
 echo "Running.."
40 40
 if [ "${2}" = '--cli' ]; 
... ...
@@ -4,10 +4,10 @@
4 4
 	Any live cell with more than three live neighbours dies, as if by overpopulation.
5 5
 	Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. )
6 6
 
7
-%+  { ADD } %-   { SUB }  %*  { MUL } %/   { DIV }  
8
-%<  { LTH } %>   { GTH }  %=  { EQU } %!   { NEQ } 
9
-%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 } 
10
-%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }  
7
+%+  { ADD } %-   { SUB }  %*  { MUL } %/   { DIV }
8
+%<  { LTH } %>   { GTH }  %=  { EQU } %!   { NEQ }
9
+%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
10
+%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
11 11
 
12 12
 %INCR { #01 + }   %DECR { #01 - }
13 13
 %TOS  { #00 SWP } %TOB  { SWP POP }
14 14
Binary files a/projects/pictures/cyr10x8.chr and b/projects/pictures/cyr10x8.chr differ
15 15
similarity index 100%
16 16
rename from projects/pictures/logo0808.bit
17 17
rename to projects/pictures/logo1x1.bit
... ...
@@ -14,6 +14,11 @@
14 14
 		Select paint color for 2-bit mode
15 15
 )
16 16
 
17
+%+  { ADD } %-   { SUB }  %*  { MUL } %/   { DIV }
18
+%<  { LTH } %>   { GTH }  %=  { EQU } %!   { NEQ }
19
+%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
20
+%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
21
+
17 22
 %RTN { JMP2r }
18 23
 %STEP8 { #0033 SFT2 }
19 24
 
... ...
@@ -68,6 +73,8 @@
68 73
 ( interface )
69 74
 @bankview  [ &x  $2 &y  $2 &mode $1 &selection $1 ]
70 75
 @tileview  [ &x  $2 &y  $2 ]
76
+
77
+@editview  [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
71 78
 @colorview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
72 79
 @blendview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
73 80
 @dataview  [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
... ...
@@ -76,7 +83,6 @@
76 83
 @rect [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
77 84
 @mouse [ &x $2 &y $2 ]
78 85
 @pt [ &x $1 &y $1 ]
79
-@addr [ &short $2 ]
80 86
 @pos [ &x $2 &y $2 ]
81 87
 
82 88
 @color $1 
... ...
@@ -84,7 +90,7 @@
84 90
 
85 91
 ( program )
86 92
 
87
-|0100
93
+|0100 ( -> )
88 94
 
89 95
 	( theme ) 
90 96
 	#0efc .System/r DEO2 
... ...
@@ -100,7 +106,7 @@
100 106
 	#0130 .frame/width POK2
101 107
 	#00a8 .frame/height POK2
102 108
 	#01 .settings/brush POK
103
-	#44 .settings/ratio POK
109
+	#32 .settings/ratio POK
104 110
 
105 111
 	.Screen/width DEI2 #0001 SFT2 .frame/width PEK2 #0001 SFT2 SUB2
106 112
 	.Screen/height DEI2 #0001 SFT2 .frame/height PEK2 #0001 SFT2 SUB2 #0010 ADD2
... ...
@@ -115,10 +121,11 @@
115 121
 	.frame/y1 PEK2 .tileview/y POK2
116 122
 	BANK #0448 ADD2 .settings/tile POK2
117 123
 
118
-	.frame/x1 PEK2 #0010 ADD2 .frame/y2 PEK2 #0020 SUB2 #0020 #0020 SIZE-TO-RECT ;blendview SET-RECT
119
-	.frame/x1 PEK2 #0038 ADD2 .frame/y2 PEK2 #0020 SUB2 #0020 #0020 SIZE-TO-RECT ;colorview SET-RECT
120
-	.frame/x1 PEK2 #0068 ADD2 .frame/y2 PEK2 #0020 SUB2 #0020 #0020 SIZE-TO-RECT ;preview SET-RECT
121 124
 	.frame/x2 PEK2 #0010 SUB2 .frame/y1 PEK2 #0010 #0080 SIZE-TO-RECT ;dataview SET-RECT
125
+	.frame/x1 PEK2 #0010 ADD2 .frame/y2 PEK2 #0020 SUB2 #0020 #0020 SIZE-TO-RECT ;blendview SET-RECT
126
+	.frame/x1 PEK2 #0060 ADD2 .frame/y2 PEK2 #0020 SUB2 #0020 #0020 SIZE-TO-RECT ;colorview SET-RECT
127
+	.frame/x1 PEK2 #0038 ADD2 .frame/y2 PEK2 #0020 SUB2 #0020 #0020 SIZE-TO-RECT ;preview SET-RECT
128
+	.frame/x2 PEK2 #0098 SUB2 .frame/y1 PEK2 #0080 #0080 SIZE-TO-RECT ;editview SET-RECT
122 129
 
123 130
 	#01 .settings/blending POK
124 131
 
... ...
@@ -198,6 +205,11 @@ BRK
198 205
 	.Mouse/y DEI2 .tileview/y PEK2 GTH2 .Mouse/y DEI2 .tileview/y PEK2 #0080 ADD2 LTH2 #0101 EQU2
199 206
 	#0101 EQU2 ;on-touch-tileview JNZ2
200 207
 
208
+	( editview )
209
+	.Mouse/x DEI2 DUP2 .editview/x1 PEK2 GTH2 ROT ROT .editview/x2 PEK2 LTH2 #0101 EQU2
210
+	.Mouse/y DEI2 DUP2 .editview/y1 PEK2 GTH2 ROT ROT .editview/y2 PEK2 LTH2 #0101 EQU2
211
+	#0101 EQU2 ;on-touch-editview JNZ2
212
+
201 213
 	( dataview )
202 214
 	.Mouse/x DEI2 DUP2 .dataview/x1 PEK2 GTH2 ROT ROT .dataview/x2 PEK2 LTH2 #0101 EQU2
203 215
 	.Mouse/y DEI2 DUP2 .dataview/y1 PEK2 GTH2 ROT ROT .dataview/y2 PEK2 LTH2 #0101 EQU2
... ...
@@ -261,24 +273,12 @@ BRK
261 273
 
262 274
 @on-touch-tileview ( -> )
263 275
 	
264
-	.Mouse/x DEI2 .tileview/x PEK2 SUB2 STEP8 #0040 DIV2
265
-	.Mouse/y DEI2 .tileview/y PEK2 SUB2 STEP8 #0040 DIV2 #0002 DIV2 ADD2
266
-	#0008 MUL2
267
-	.settings/tile PEK2 ADD2 .addr POK2 ( addr offset )
268
-	.Mouse/x DEI2 .tileview/x PEK2 SUB2 .Mouse/x DEI2 .tileview/x PEK2 SUB2 #0040 DIV2 #0040 MUL2 SUB2 .pos/x POK2
269
-	.Mouse/y DEI2 .tileview/y PEK2 SUB2 .Mouse/y DEI2 .tileview/y PEK2 SUB2 #0040 DIV2 #0040 MUL2 SUB2 .pos/y POK2
270
-	.Mouse/state DEI #10 NEQ ,&no-erase-mode JNZ
271
-		( load ) .addr PEK2 .pos/y PEK2 #0008 DIV2 ADD2 LDA
272
-		( mask ) #01 #07 .pos/x PEK2 #0008 DIV2 TOB SUB SFL
273
-		#ff EOR AND
274
-		( save ) .addr PEK2 .pos/y PEK2 #0008 DIV2 ADD2 STA
275
-		;redraw JSR2 BRK
276
-	&no-erase-mode
277
-	( load ) .addr PEK2 .pos/y PEK2 #0008 DIV2 ADD2 LDA
278
-	( mask ) #01 #07 .pos/x PEK2 #0008 DIV2 TOB SUB SFL
279
-	ORA
280
-	( save ) .addr PEK2 .pos/y PEK2 #0008 DIV2 ADD2 STA
281
-	;redraw JSR2
276
+
277
+BRK
278
+
279
+@on-touch-editview ( -> )
280
+	
281
+	#aa DEBUG
282 282
 
283 283
 BRK
284 284
 
... ...
@@ -334,7 +334,6 @@ BRK
334 334
 	#40 SFT ADD #11 ADD
335 335
 	.settings/ratio POK
336 336
 
337
-	( release ) #00 .Mouse/state DEO
338 337
 	;redraw JSR2
339 338
 
340 339
 BRK
... ...
@@ -386,7 +385,7 @@ RTN
386 385
 
387 386
 RTN
388 387
 
389
-@op_shiftup
388
+@op_shiftup ( -- )
390 389
 	
391 390
 	.settings/tile PEK2 LDA
392 391
 	.settings/tile PEK2 #0001 ADD2 LDA .settings/tile PEK2 STA
... ...
@@ -400,7 +399,7 @@ RTN
400 399
 
401 400
 RTN
402 401
 
403
-@op_shiftdown
402
+@op_shiftdown ( -- )
404 403
 	
405 404
 	.settings/tile PEK2 #0007 ADD2 LDA
406 405
 	.settings/tile PEK2 #0006 ADD2 LDA .settings/tile PEK2 #0007 ADD2 STA
... ...
@@ -414,10 +413,10 @@ RTN
414 413
 
415 414
 RTN
416 415
 
417
-@redraw
416
+@redraw ( -- )
418 417
 	
419 418
 	;draw-bankview JSR2
420
-	;draw-tileview JSR2
419
+	;draw-editview JSR2
421 420
 	;draw-blendview JSR2
422 421
 	;draw-colorview JSR2
423 422
 	;draw-dataview JSR2
... ...
@@ -425,7 +424,7 @@ RTN
425 424
 
426 425
 RTN
427 426
 
428
-@draw-bankview
427
+@draw-bankview ( -- )
429 428
 	
430 429
 	.bankview/x PEK2 #0002 SUB2 .bankview/y PEK2 #0002 SUB2 .bankview/x PEK2 #0081 ADD2 .bankview/y PEK2 #0081 ADD2 #03 ;line-rect JSR2
431 430
 
... ...
@@ -433,7 +432,7 @@ RTN
433 432
 
434 433
 	.bankview/x PEK2 .Screen/x DEO2
435 434
 	.bankview/y PEK2 #0010 SUB2 .Screen/y DEO2
436
-	.settings/page PEK2 ;draw-short JSR2
435
+	.settings/page PEK2 #22 ;draw-short JSR2
437 436
 
438 437
 	( toolbar )
439 438
 
... ...
@@ -459,7 +458,7 @@ RTN
459 458
 
460 459
 	.bankview/x PEK2 #0010 SUB2 .Screen/x DEO2
461 460
 	.bankview/y PEK2 .Screen/y DEO2
462
-	;font_hex .Screen/addr DEO2
461
+	;font-hex .Screen/addr DEO2
463 462
 	#00 #10
464 463
 	&guides
465 464
 		( draw ) OVR .bankview/selection PEK #04 SFT EQU #22 ADD .Screen/color DEO
... ...
@@ -492,7 +491,7 @@ RTN
492 491
 
493 492
 RTN
494 493
 
495
-@draw-tileview
494
+@draw-tileview ( -- )
496 495
 
497 496
 	.tileview/x PEK2 #0002 SUB2 .tileview/y PEK2 #0002 SUB2 .tileview/x PEK2 #0080 ADD2 .tileview/y PEK2 #0081 ADD2 #03 ;line-rect JSR2
498 497
 
... ...
@@ -508,7 +507,7 @@ RTN
508 507
 
509 508
 	.tileview/x PEK2 .Screen/x DEO2
510 509
 	.tileview/y PEK2 #0010 SUB2 .Screen/y DEO2
511
-	.settings/tile PEK2 ;draw-short JSR2
510
+	.settings/tile PEK2 #22 ;draw-short JSR2
512 511
 
513 512
 	( body )
514 513
 
... ...
@@ -552,7 +551,91 @@ RTN
552 551
 
553 552
 RTN
554 553
 
555
-@draw-tileview-icn
554
+@draw-editview ( -- )
555
+
556
+	.editview/x1 PEK2 #0002 SUB2 .editview/y1 PEK2 #0002 SUB2 .editview/x2 PEK2 #0001 ADD2 .editview/y2 PEK2 #0001 ADD2 #03 ;line-rect JSR2
557
+
558
+	( grid )
559
+	.editview/x1 PEK2 DUP2 #0080 ADD2 .editview/y1 PEK2 #0020 ADD2 #03 ;line-hor JSR2
560
+	.editview/x1 PEK2 DUP2 #0080 ADD2 .editview/y1 PEK2 #0040 ADD2 #03 ;line-hor JSR2
561
+	.editview/x1 PEK2 DUP2 #0080 ADD2 .editview/y1 PEK2 #0060 ADD2 #03 ;line-hor JSR2
562
+	.editview/x1 PEK2 #0020 ADD2 .editview/y1 PEK2 DUP2 #0080 ADD2 #03 ;line-ver JSR2
563
+	.editview/x1 PEK2 #0040 ADD2 .editview/y1 PEK2 DUP2 #0080 ADD2 #03 ;line-ver JSR2
564
+	.editview/x1 PEK2 #0060 ADD2 .editview/y1 PEK2 DUP2 #0080 ADD2 #03 ;line-ver JSR2
565
+
566
+	( position )
567
+
568
+	.editview/x1 PEK2 .Screen/x DEO2
569
+	.editview/y1 PEK2 #0010 SUB2 .Screen/y DEO2
570
+	.settings/tile PEK2 #22 ;draw-short JSR2
571
+
572
+	( tiles )
573
+	.settings/tile PEK2 DUP2 STH2 .Screen/addr DEO2
574
+	#00 #04
575
+	&ver
576
+		OVR #08 MUL TOS #0004 MUL2 .editview/y1 PEK2 ADD2 .Screen/y DEO2
577
+		#00 #04
578
+		&hor
579
+			OVR #08 MUL TOS #0004 MUL2 .editview/x1 PEK2 ADD2 .Screen/x DEO2
580
+			( get x,y )
581
+			SWP2 OVR STH SWP2 OVR STHr
582
+			( check if within ratio )
583
+			.settings/ratio PEK #0f AND LTH STH
584
+			.settings/ratio PEK #04 SFT LTH STHr
585
+			#0101 NEQ2 ,&outside JNZ 
586
+
587
+				( draw zoomed tile )
588
+				.Screen/x DEI2
589
+				.Screen/y DEI2
590
+				#01 ;draw-tile JSR2
591
+
592
+				( get tile ) DUP2r STH2r .Screen/addr DEO2
593
+				( get blending ) .settings/blending PEK
594
+				( get depth ) .settings/depth PEK #20 MUL
595
+				( draw ) #20 ADD ADD .Screen/color DEO
596
+
597
+				( incr ) STH2r #0008 ADD2 STH2
598
+				,&resume JMP
599
+			&outside
600
+			;halftone_icn .Screen/addr DEO2
601
+			#23 .Screen/color DEO
602
+			&resume
603
+			( incr ) SWP #01 ADD SWP
604
+			DUP2 LTH ,&hor JNZ
605
+		POP2
606
+		( incr ) SWP #01 ADD SWP
607
+		DUP2 LTH ;&ver JNZ2
608
+	POP2
609
+	POP2r
610
+
611
+RTN
612
+
613
+@draw-tile ( x* y* color -- )
614
+	
615
+	( TODO: complete )
616
+	STH
617
+	.Screen/y DEO2 
618
+	.Screen/x DEO2 
619
+	#00 #20
620
+	&ver
621
+		#00 #20
622
+		&hor
623
+			DUPr STHr .Screen/color DEO
624
+			#0001 .Screen/x DEI2 ADD2 .Screen/x DEO2
625
+			( incr ) SWP #01 ADD SWP
626
+			DUP2 LTH ,&hor JNZ
627
+		POP2
628
+		#0001 .Screen/y DEI2 ADD2 .Screen/y DEO2
629
+		.Screen/x DEI2 #0020 SUB2 .Screen/x DEO2
630
+		( incr ) SWP #01 ADD SWP
631
+		DUP2 LTH ,&ver JNZ
632
+	POP2
633
+	.Screen/y DEI2 #0020 SUB2 .Screen/y DEO2
634
+	POPr
635
+
636
+RTN
637
+
638
+@draw-tileview-icn ( -- )
556 639
 
557 640
 	#00 .pt/x POK #00 .pt/y POK
558 641
 	&ver
... ...
@@ -575,7 +658,7 @@ RTN
575 658
 
576 659
 @draw-blendview ( -- )
577 660
 	
578
-	.blendview/x1 PEK2 #0002 SUB2 .blendview/y1 PEK2 #0002 SUB2 .blendview/x2 PEK2 #0001 ADD2 .blendview/y2 PEK2 #0001 ADD2 #03 ;line-rect JSR2
661
+	( .blendview/x1 PEK2 #0002 SUB2 .blendview/y1 PEK2 #0002 SUB2 .blendview/x2 PEK2 #0001 ADD2 .blendview/y2 PEK2 #0001 ADD2 #03 ;line-rect JSR2 )
579 662
 
580 663
 	.settings/tile PEK2 .Screen/addr DEO2
581 664
 	#00 #10
... ...
@@ -588,13 +671,11 @@ RTN
588 671
 		DUP2 LTH ,&loop JNZ
589 672
 	POP2
590 673
 
591
-	.blendview/x1 PEK2 #0002 SUB2 .blendview/y2 PEK2 #0001 ADD2 .blendview/x1 PEK2 #000e ADD2 .blendview/y2 PEK2 #0009 ADD2 #03 ;line-rect JSR2
592
-	.blendview/x1 PEK2 #0001 SUB2 .Screen/x DEO2
674
+	.blendview/x1 PEK2 .Screen/x DEO2
593 675
 	.blendview/y2 PEK2 #0001 ADD2 .Screen/y DEO2
594
-
595 676
 	( get blending ) .settings/blending PEK
596 677
 	( get depth ) .settings/depth PEK #20 MUL
597
-	( draw ) #20 ADD ADD #2c ;draw-byte JSR2
678
+	( draw ) #20 ADD ADD #21 ;draw-byte JSR2
598 679
 
599 680
 RTN
600 681
 
... ...
@@ -667,7 +748,8 @@ RTN
667 748
 
668 749
 @draw-preview ( -- )
669 750
 
670
-	.preview/x1 PEK2 #0002 SUB2 .preview/y1 PEK2 #0002 SUB2 .preview/x2 PEK2 #0001 ADD2 .preview/y2 PEK2 #0001 ADD2 #03 ;line-rect JSR2
751
+	( .preview/x1 PEK2 #0002 SUB2 .preview/y1 PEK2 #0002 SUB2 .preview/x2 PEK2 #0001 ADD2 .preview/y2 PEK2 #0001 ADD2 #03 ;line-rect JSR2 )
752
+	
671 753
 	( stash address )
672 754
 	.settings/tile PEK2 DUP2 STH2 .Screen/addr DEO2
673 755
 	#00 #04
... ...
@@ -682,10 +764,11 @@ RTN
682 764
 			.settings/ratio PEK #0f AND LTH STH
683 765
 			.settings/ratio PEK #04 SFT LTH STHr
684 766
 			#0101 NEQ2 ,&outside JNZ 
767
+				( get tile ) DUP2r STH2r .Screen/addr DEO2
685 768
 				( get blending ) .settings/blending PEK
686 769
 				( get depth ) .settings/depth PEK #20 MUL
687 770
 				( draw ) #20 ADD ADD .Screen/color DEO
688
-				( incr ) STH2r #0008 ADD2 DUP2 STH2 .Screen/addr DEO2
771
+				( incr ) STH2r #0008 ADD2 STH2
689 772
 				,&resume JMP
690 773
 			&outside
691 774
 			;halftone_icn .Screen/addr DEO2
... ...
@@ -706,21 +789,21 @@ RTN
706 789
 
707 790
 @draw-color-code ( color* -- )
708 791
 	
709
-	DUP ;font_hex ROT #0f AND #08 MUL #00 SWP ADD2 .Screen/addr DEO2
792
+	DUP ;font-hex ROT #0f AND #08 MUL #00 SWP ADD2 .Screen/addr DEO2
710 793
 	( draw ) #22 .Screen/color DEO
711 794
 	.colorview/y1 PEK2 #10 ADD .Screen/y DEO2
712
-	;font_hex ROT #04 SFT #08 MUL #00 SWP ADD2 .Screen/addr DEO2
795
+	;font-hex ROT #04 SFT #08 MUL #00 SWP ADD2 .Screen/addr DEO2
713 796
 	( draw ) #22 .Screen/color DEO
714 797
 	.colorview/y1 PEK2 #08 ADD .Screen/y DEO2
715
-	DUP ;font_hex ROT #0f AND #08 MUL #00 SWP ADD2 .Screen/addr DEO2
798
+	DUP ;font-hex ROT #0f AND #08 MUL #00 SWP ADD2 .Screen/addr DEO2
716 799
 	( draw ) #22 .Screen/color DEO
717 800
 	.colorview/y1 PEK2 .Screen/y DEO2
718
-	;font_hex ROT #04 SFT #08 MUL #00 SWP ADD2 .Screen/addr DEO2
801
+	;font-hex ROT #04 SFT #08 MUL #00 SWP ADD2 .Screen/addr DEO2
719 802
 	( draw ) #22 .Screen/color DEO
720 803
 
721 804
 RTN
722 805
 
723
-@draw-cursor
806
+@draw-cursor ( -- )
724 807
 
725 808
 	( clear last cursor )
726 809
 	.mouse/x PEK2 .Screen/x DEO2
... ...
@@ -742,34 +825,34 @@ RTN
742 825
 @draw-byte ( byte color -- )
743 826
 	
744 827
 	.color POK STH
745
-	;font_hex #00 DUPr STHr #f0 AND #04 SFT #08 MUL ADD2 .Screen/addr DEO2
828
+	;font-hex #00 DUPr STHr #f0 AND #04 SFT #08 MUL ADD2 .Screen/addr DEO2
746 829
 	( draw ) .color PEK .Screen/color DEO
747 830
 	.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
748
-	;font_hex #00 STHr #0f AND #08 MUL ADD2 .Screen/addr DEO2
831
+	;font-hex #00 STHr #0f AND #08 MUL ADD2 .Screen/addr DEO2
749 832
 	( draw ) .color PEK .Screen/color DEO
750 833
 
751 834
 RTN
752 835
 
753
-@draw-short ( short -- )
754
-
755
-	.addr POK2
756
-	;font_hex #00 ;addr LDA #f0 AND #04 SFT #08 MUL ADD2 .Screen/addr DEO2
757
-	( draw ) #22 .Screen/color DEO
758
-	.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
759
-	;font_hex #00 ;addr LDA #0f AND #08 MUL ADD2 .Screen/addr DEO2
760
-	( draw ) #22 .Screen/color DEO
761
-	.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
762
-	;font_hex #00 ;addr #0001 ADD2 LDA #f0 AND #04 SFT #08 MUL ADD2 .Screen/addr DEO2
763
-	( draw ) #22 .Screen/color DEO
764
-	.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
765
-	;font_hex #00 ;addr #0001 ADD2 LDA #0f AND #08 MUL ADD2 .Screen/addr DEO2
766
-	( draw ) #22 .Screen/color DEO
836
+@draw-short ( short* color -- )
837
+
838
+	STH SWP 
839
+	DUP #04 SFT TOS #0008 ** ;font-hex ++ .Screen/addr DEO2
840
+	( draw ) DUPr STHr .Screen/color DEO
841
+	#0f AND TOS #0008 ** ;font-hex ++ .Screen/addr DEO2
842
+	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
843
+	( draw ) DUPr STHr .Screen/color DEO
844
+	DUP #04 SFT TOS #0008 ** ;font-hex ++ .Screen/addr DEO2
845
+	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
846
+	( draw ) DUPr STHr .Screen/color DEO
847
+	#0f AND TOS #0008 ** ;font-hex ++ .Screen/addr DEO2
848
+	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
849
+	( draw ) STHr .Screen/color DEO
767 850
 
768 851
 RTN
769 852
 
770 853
 ( Utils )
771 854
 
772
-@line-rect ( x1 y1 x2 y2 color -- )
855
+@line-rect ( x1* y1* x2* y2* color -- )
773 856
 
774 857
 	( load ) .color POK DUP2 STH2 .rect/y2 POK2 .rect/x2 POK2 DUP2 STH2 .rect/y1 POK2 .rect/x1 POK2
775 858
 	STH2r STH2r
... ...
@@ -791,37 +874,50 @@ RTN
791 874
 
792 875
 RTN
793 876
 
794
-@halftone_icn [
795
-	aa55 aa55 aa55 aa55 ]
877
+@line-hor ( x0* x1* y* color -- )
878
+	
879
+	STH .Screen/y DEO2
880
+	&loop
881
+		( save ) OVR2 .Screen/x DEO2
882
+		( draw ) DUPr STHr .Screen/color DEO
883
+		( incr ) SWP2 #0002 ADD2 SWP2
884
+		OVR2 OVR2 LTH2 ,&loop JNZ
885
+	POP2 POP2 POPr
886
+
887
+RTN
888
+
889
+@line-ver ( x* y0* y1* color -- )
890
+	
891
+	STH ROT2 .Screen/x DEO2
892
+	&loop
893
+		( save ) OVR2 .Screen/y DEO2
894
+		( draw ) DUPr STHr .Screen/color DEO
895
+		( incr ) SWP2 #0002 ADD2 SWP2
896
+		OVR2 OVR2 LTH2 ,&loop JNZ
897
+	POP2 POP2 POPr
898
+
899
+RTN
900
+
901
+@tool_selector 80c0 e0f0 f8e0 1000
902
+@tool_hand     2020 20b8 7c7c 3838
903
+@tool_eraser   2050 b87c 3e1c 0800
904
+@moveup_icn    0010 387c fe10 1000
905
+@movedown_icn  0010 1010 fe7c 3810
906
+@halftone_icn  aa55 aa55 aa55 aa55
907
+
796 908
 @circle_icns
797 909
 	0038 7cfe fefe 7c38 ( full )
798 910
 	0038 4482 8282 4438 ( line )
799 911
 @eye_icns
800 912
 	0038 4492 2810 0000 ( open )
801 913
 	0000 0082 4438 0000 ( closed )
802
-@blank_icn     [
914
+@blank_icn
803 915
 	0000 0000 0000 0000
804 916
 	7cfe fefe fefe 7c00
805
-]
806
-@depth_icns [
917
+@depth_icns 
807 918
 	00fe 8282 fe82 82fe
808 919
 	00fe 9292 fe92 92fe
809
-]
810
-@tool_selector [ 80c0 e0f0 f8e0 1000 ]
811
-@tool_hand     [ 2020 20b8 7c7c 3838 ]
812
-@tool_eraser   [ 2050 b87c 3e1c 0800 ]
813
-@moveup_icn    [ 0010 387c fe10 1000 ]
814
-@movedown_icn  [ 0010 1010 fe7c 3810 ]
815
-
816
-@filepath1     [ "projects/fonts/specter8.bit 00 ]
817
-@filepath2     [ "projects/pictures/cyr10x8.chr 00 ]
818
-@filepath3     [ "projects/pictures/zerotwo10x10.chr 00 ]
819
-@filepath4     [ "projects/fonts/katahira8.bit 00 ]
820
-@filepath5     [ "projects/pictures/ako10x10.chr 00 ]
821
-@filepath6     [ "projects/pictures/cyr4x4.chr 00 ]
822
-
823
-@font_hex ( 0-F )
824
-[
920
+@font-hex
825 921
 	007c 8282 8282 827c 0030 1010 1010 1010
826 922
 	007c 8202 7c80 80fe 007c 8202 1c02 827c
827 923
 	000c 1424 4484 fe04 00fe 8080 7c02 827c
... ...
@@ -829,5 +925,12 @@ RTN
829 925
 	007c 8282 7c82 827c 007c 8282 7e02 827c
830 926
 	007c 8202 7e82 827e 00fc 8282 fc82 82fc
831 927
 	007c 8280 8080 827c 00fc 8282 8282 82fc
832
-	007c 8280 f080 827c 007c 8280 f080 8080
833
-]
928
+	007c 8280 f080 827c 007c 8280 f080 8080 
929
+
930
+@filepath1   [ "projects/fonts/specter8.bit 00 ]
931
+@filepath2   [ "projects/pictures/cyr10x8.chr 00 ]
932
+@filepath3   [ "projects/pictures/zerotwo10x10.chr 00 ]
933
+@filepath4   [ "projects/fonts/katahira8.bit 00 ]
934
+@filepath5   [ "projects/pictures/ako10x10.chr 00 ]
935
+@filepath6   [ "projects/pictures/logo1x1.bit 00 ]
936
+