Browse code

A bit of housekeeping on the example files

Devine Lu Linvega authored on 07/07/2022 02:25:54
Showing 11 changed files
... ...
@@ -146,7 +146,7 @@ JMP2r
146 146
 
147 147
 JMP2r
148 148
 
149
-@mod DUP2 DIV MUL SUB JMP2r
149
+@mod DIVk MUL SUB JMP2r
150 150
 
151 151
 @cursor 
152 152
 	80c0 e0f0 f8e0 1000
... ...
@@ -2,10 +2,8 @@
2 2
 
3 3
 %+  { ADD }  %-  { SUB }  %*  { MUL }  %/  { DIV }
4 4
 %<  { LTH }  %>  { GTH }  %=  { EQU }  %!  { NEQ }
5
-%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
6
-%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
7 5
 
8
-%GTS2 { #8000 ++ SWP2 #8000 ++ << }
6
+%GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }
9 7
 %AUTO-X    { #01 .Screen/auto DEO }
10 8
 %NEXT-LINE { #0000 .Screen/x DEO2 .Screen/y DEI2k INC2 ROT DEO2 }
11 9
 
... ...
@@ -17,8 +15,8 @@
17 15
 %YMIN { #ecc7 } ( -4915 )
18 16
 %YMAX { #1333 } ( 4915 )
19 17
 %MAXI { #20 } ( 32 )
20
-%DX { XMAX XMIN -- WIDTH // } ( (XMAX-XMIN)/W )
21
-%DY { YMAX YMIN -- HEIGHT // } ( (YMAX-YMIN)/H )
18
+%DX { XMAX XMIN SUB2 WIDTH DIV2 } ( (XMAX-XMIN)/W )
19
+%DY { YMAX YMIN SUB2 HEIGHT DIV2 } ( (YMAX-YMIN)/H )
22 20
 %X  { .x LDZ2  } %Y  { .y LDZ2  }
23 21
 %X2 { .x2 LDZ2 } %Y2 { .y2 LDZ2 }
24 22
 
... ...
@@ -54,21 +52,21 @@ BRK
54 52
 		XMAX XMIN
55 53
 		&hor
56 54
 			DUP2 ,&x STR2
57
-			#0000 DUP2 DUP2 DUP2 .x STZ2 .y STZ2 .x2 STZ2 .y2 STZ2
55
+			#0000 DUP2k DUP2 .x STZ2 .y STZ2 .x2 STZ2 .y2 STZ2
58 56
 			MAXI #00
59 57
 			&loop
60
-				X Y ;smul2 JSR2 DUP2 ADD2 [ LIT2 &y $2 ] ++ .y STZ2
61
-				X2 Y2 -- [ LIT2 &x $2 ] ++ .x STZ2
58
+				X Y ;smul2 JSR2 DUP2 ADD2 [ LIT2 &y $2 ] ADD2 .y STZ2
59
+				X2 Y2 SUB2 [ LIT2 &x $2 ] ADD2 .x STZ2
62 60
 				X DUP2 ;smul2 JSR2 .x2 STZ2
63 61
 				Y DUP2 ;smul2 JSR2 .y2 STZ2
64
-				X2 Y2 ++ #4000 >> ,&end JCN
62
+				X2 Y2 ADD2 #4000 GTH2 ,&end JCN
65 63
 				INC GTHk ,&loop JCN
66 64
 				&end
67 65
 			NIP .Screen/pixel DEO
68
-			DX ++ OVR2 OVR2 GTS2 ;&hor JCN2
66
+			DX ADD2 OVR2 OVR2 GTS2 ;&hor JCN2
69 67
 		POP2 POP2
70 68
 		NEXT-LINE
71
-		DY ++ OVR2 OVR2 GTS2 ;&ver JCN2
69
+		DY ADD2 OVR2 OVR2 GTS2 ;&ver JCN2
72 70
 	POP2 POP2
73 71
 
74 72
 JMP2r
... ...
@@ -74,8 +74,7 @@ BRK
74 74
 	DUP ,&last LDR NEQ ,&changed JCN
75 75
 		POP JMP2r &changed
76 76
 	( only redraw on change )
77
-	DUP
78
-	#00 SWP ;eye ADD2 .Screen/addr DEO2
77
+	#00 OVR ;eye ADD2 .Screen/addr DEO2
79 78
 	.cat/y LDZ2 #0008 ADD2 .Screen/y DEO2
80 79
 	.cat/x LDZ2 #0008 SUB2 .Screen/x DEO2
81 80
 	#81 .Screen/sprite DEOk DEO
... ...
@@ -1,6 +1,6 @@
1 1
 ( dev/audio )
2 2
 
3
-%MOD { DUP2 DIV MUL SUB }
3
+%MOD { DIVk MUL SUB }
4 4
 
5 5
 ( devices )
6 6
 
... ...
@@ -1,13 +1,7 @@
1 1
 ( dev/audio )
2 2
 
3
-%2// { #01 SFT2 }
4
-%4** { #20 SFT2 }
5
-%8** { #30 SFT2 }
6
-%20MOD { #1f AND }
7
-%RTN { JMP2r }
8
-
9 3
 %GET-NOTE { #00 SWP ;melody ADD2 LDA }
10
-%GET-HEXCHAR  { #00 SWP 8** ;font-hex ADD2 .Screen/addr DEO2 }
4
+%GET-HEXCHAR  { #00 SWP #30 SFT2 ;font-hex ADD2 .Screen/addr DEO2 }
11 5
 
12 6
 ( devices )
13 7
 
... ...
@@ -44,8 +38,8 @@
44 38
 	#dd .Audio0/volume DEO ( TODO: turn ON )
45 39
 
46 40
 	( center )
47
-	.Screen/width DEI2 2// #0080 SUB2 .offset/x STZ2
48
-	.Screen/height DEI2 2// #0040 SUB2 .offset/y STZ2
41
+	.Screen/width DEI2 #01 SFT2 #0080 SUB2 .offset/x STZ2
42
+	.Screen/height DEI2 #01 SFT2 #0040 SUB2 .offset/y STZ2
49 43
 
50 44
 	;draw JSR2
51 45
 	#02 ;draw-selector JSR2
... ...
@@ -71,12 +65,12 @@ BRK
71 65
 		&no-down
72 66
 	[ #04 ] NEQk NIP ,&no-left JCN 
73 67
 		#00 ;draw-selector JSR2
74
-		.selection LDZ #01 SUB 20MOD .selection STZ
68
+		.selection LDZ #01 SUB #1f AND .selection STZ
75 69
 		#02 ;draw-selector JSR2
76 70
 		&no-left
77 71
 	[ #08 ] NEQk NIP ,&no-right JCN 
78 72
 		#00 ;draw-selector JSR2
79
-		.selection LDZ INC 20MOD .selection STZ
73
+		.selection LDZ INC #1f AND .selection STZ
80 74
 		#02 ;draw-selector JSR2
81 75
 		&no-right
82 76
 	POP
... ...
@@ -89,9 +83,9 @@ BRK
89 83
 	( skip ) .timer LDZ #10 EQU #01 JCN [ BRK ]
90 84
 	.progress LDZ 
91 85
 	( play note )    DUP GET-NOTE .Audio0/pitch DEO
92
-	( erase last )   DUP #01 SUB 20MOD #01 ,draw-note JSR
86
+	( erase last )   DUP #01 SUB #1f AND #01 ,draw-note JSR
93 87
 	( draw current ) #01 ,draw-note JSR
94
-	( incr ) .progress LDZ INC 20MOD .progress STZ
88
+	( incr ) .progress LDZ INC #1f AND .progress STZ
95 89
 	#00 .timer STZ
96 90
 
97 91
 BRK
... ...
@@ -104,22 +98,22 @@ BRK
104 98
 		INC GTHk ,&loop JCN
105 99
 	POP2
106 100
 
107
-RTN
101
+JMP2r
108 102
 
109 103
 @draw-note ( id color -- )
110 104
 
111 105
 	STH STH
112
-	( set x ) [ #00 STHkr ] 8** .offset/x LDZ2 ADD2 .Screen/x DEO2
113
-	( set y ) [ #00 #00 STHkr ;melody ADD2 LDA ] 4** #0100 SWP2 SUB2 .offset/y LDZ2 ADD2 #0080 ADD2 .Screen/y DEO2
106
+	( set x ) [ #00 STHkr ] #30 SFT2 .offset/x LDZ2 ADD2 .Screen/x DEO2
107
+	( set y ) [ #00 #00 STHkr ;melody ADD2 LDA ] #20 SFT2 #0100 SWP2 SUB2 .offset/y LDZ2 ADD2 #0080 ADD2 .Screen/y DEO2
114 108
 	( set addr ) ;marker-icn [ #00 .progress LDZ STHr EQU #08 MUL ADD2 ] .Screen/addr DEO2
115 109
 	( draw ) STHr .Screen/sprite DEO
116 110
 
117
-RTN
111
+JMP2r
118 112
 
119 113
 @draw-selector ( color -- )
120 114
 	
121 115
 	STH
122
-	[ #00 .selection LDZ ] 8** .offset/x LDZ2 ADD2 .Screen/x DEO2
116
+	[ #00 .selection LDZ ] #30 SFT2 .offset/x LDZ2 ADD2 .Screen/x DEO2
123 117
 	#0070 .offset/y LDZ2 ADD2 .Screen/y DEO2
124 118
 	;selector-icn .Screen/addr DEO2
125 119
 	STHkr .Screen/sprite DEO
... ...
@@ -127,7 +121,7 @@ RTN
127 121
 	.Screen/y DEI2 #0008 ADD2 .Screen/y DEO2
128 122
 	.selection LDZ GET-NOTE STHr ,draw-byte JSR
129 123
 
130
-RTN
124
+JMP2r
131 125
 
132 126
 @draw-byte ( byte color -- )
133 127
 	
... ...
@@ -139,7 +133,7 @@ RTN
139 133
 		#0f AND GET-HEXCHAR 
140 134
 		( draw ) STHr .Screen/sprite DEO
141 135
 
142
-RTN
136
+JMP2r
143 137
 
144 138
 @melody 
145 139
 	54 52 54 4f 4b 4f 48 ff
... ...
@@ -180,4 +174,4 @@ RTN
180 174
 	007c 8282 7c82 827c 007c 8282 7e02 827c
181 175
 	007c 8202 7e82 827e 00fc 8282 fc82 82fc
182 176
 	007c 8280 8080 827c 00fc 8282 8282 82fc
183
-	007c 8280 f080 827c 007c 8280 f080 8080
184 177
\ No newline at end of file
178
+	007c 8280 f080 827c 007c 8280 f080 8080
... ...
@@ -15,7 +15,7 @@ BRK
15 15
 
16 16
 @print ( short* -- )
17 17
 
18
-	&short ( short* -- ) SWP ,&byte JSR
18
+	SWP ,&byte JSR
19 19
 	&byte ( byte -- ) DUP #04 SFT ,&char JSR
20 20
 	&char ( char -- ) #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO
21 21
 
... ...
@@ -1,13 +1,8 @@
1 1
 ( GUI Shapes )
2 2
 
3
-%2** { #10 SFT2 }
4
-%4** { #20 SFT2 }
5
-%2// { #01 SFT2 }
6
-%4// { #02 SFT2 }
7 3
 %ABS2 { DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 }
8 4
 %LTS2  { #8000 ADD2 SWP2 #8000 ADD2 GTH2 }
9 5
 %GTS2  { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }
10
-
11 6
 %WIDTH { #0100 } %HEIGHT { #00a0 }
12 7
 
13 8
 ( devices )
... ...
@@ -35,24 +30,24 @@
35 30
 	#f03c .System/g DEO2 
36 31
 	#f03f .System/b DEO2
37 32
 
38
-	( background ) ;checker_icn #03 ;cover-pattern JSR2
33
+	( background ) ;checker-icn #03 ;cover-pattern JSR2
39 34
 
40
-	.Screen/width DEI2 2// WIDTH 2// SUB2 #0008 ADD2
41
-	.Screen/height DEI2 2// HEIGHT 2// SUB2 #0008 ADD2
35
+	.Screen/width DEI2 #01 SFT2 WIDTH #01 SFT2 SUB2 #0008 ADD2
36
+	.Screen/height DEI2 #01 SFT2 HEIGHT #01 SFT2 SUB2 #0008 ADD2
42 37
 	WIDTH HEIGHT
43 38
 	STH2 STH2 OVR2 STH2r ADD2 OVR2 STH2r ADD2 #02 ;fill-rect JSR2
44 39
 
45
-	.Screen/width DEI2 2// WIDTH 2// SUB2
46
-	.Screen/height DEI2 2// HEIGHT 2// SUB2
40
+	.Screen/width DEI2 #01 SFT2 WIDTH #01 SFT2 SUB2
41
+	.Screen/height DEI2 #01 SFT2 HEIGHT #01 SFT2 SUB2
47 42
 	WIDTH HEIGHT
48 43
 	STH2 STH2 OVR2 STH2r ADD2 OVR2 STH2r ADD2 #01 ;fill-rect JSR2
49 44
 
50
-	.Screen/width DEI2 2// WIDTH 2// SUB2  #0008 ADD2
51
-	.Screen/height DEI2 2// HEIGHT 2// SUB2  #0008 ADD2
45
+	.Screen/width DEI2 #01 SFT2 WIDTH #01 SFT2 SUB2  #0008 ADD2
46
+	.Screen/height DEI2 #01 SFT2 HEIGHT #01 SFT2 SUB2  #0008 ADD2
52 47
 	WIDTH #0010 SUB2 HEIGHT #0010 SUB2
53 48
 	STH2 STH2 OVR2 STH2r ADD2 OVR2 STH2r ADD2 #03 ;line-rect JSR2
54 49
 
55
-	.Screen/width DEI2 2// .Screen/height DEI2 2// WIDTH 4// #02 ;draw-circle JSR2
50
+	.Screen/width DEI2 #01 SFT2 .Screen/height DEI2 #01 SFT2 WIDTH #02 SFT2 #02 ;draw-circle JSR2
56 51
 
57 52
 	#0010 #0030 #0068 #02 ;line-hor JSR2
58 53
 	#0020 #0058 #0078 #02 ;line-ver JSR2
... ...
@@ -64,13 +59,13 @@ BRK
64 59
 	( load ) .color STZ #0001 SUB2 .line/y0 STZ2 #0001 SUB2 .line/x0 STZ2 .line/y STZ2 .line/x STZ2
65 60
 	.line/x0 LDZ2 .line/x LDZ2 SUB2 ABS2 .line/dx STZ2
66 61
 	.line/y0 LDZ2 .line/y LDZ2 SUB2 ABS2 #0000 SWP2 SUB2 .line/dy STZ2
67
-	#ffff #00 .line/x LDZ2 .line/x0 LDZ2 LTS2 2** ADD2 .line/sx STZ2
68
-	#ffff #00 .line/y LDZ2 .line/y0 LDZ2 LTS2 2** ADD2 .line/sy STZ2
62
+	#ffff #00 .line/x LDZ2 .line/x0 LDZ2 LTS2 #10 SFT2 ADD2 .line/sx STZ2
63
+	#ffff #00 .line/y LDZ2 .line/y0 LDZ2 LTS2 #10 SFT2 ADD2 .line/sy STZ2
69 64
 	.line/dx LDZ2 .line/dy LDZ2 ADD2 .line/e1 STZ2
70 65
 	&loop
71 66
 		.line/x LDZ2 .Screen/x DEO2 .line/y LDZ2 .Screen/y DEO2 .color LDZ .Screen/pixel DEO
72
-		.line/x LDZ2 .line/x0 LDZ2 EQU2 .line/y LDZ2 .line/y0 LDZ2 EQU2 #0101 EQU2 ,&end JCN
73
-		.line/e1 LDZ2 2** .line/e2 STZ2
67
+		.line/x LDZ2 .line/x0 LDZ2 EQU2 .line/y LDZ2 .line/y0 LDZ2 EQU2 AND ,&end JCN
68
+		.line/e1 LDZ2 #10 SFT2 .line/e2 STZ2
74 69
 		.line/e2 LDZ2 .line/dy LDZ2 LTS2 ,&skipy JCN
75 70
 			.line/e1 LDZ2 .line/dy LDZ2 ADD2 .line/e1 STZ2
76 71
 			.line/x LDZ2 .line/sx LDZ2 ADD2 .line/x STZ2
... ...
@@ -136,16 +131,16 @@ JMP2r
136 131
 
137 132
 	( load ) .color STZ .circle/r STZ2 .circle/yc STZ2 .circle/xc STZ2
138 133
 	#0000 .circle/x STZ2 .circle/r LDZ2 .circle/y STZ2
139
-	.circle/r LDZ2 2** .circle/d STZ2
134
+	.circle/r LDZ2 #10 SFT2 .circle/d STZ2
140 135
 	( draw ) ;&seg JSR2
141 136
 	&loop
142 137
 		( incr ) .circle/x LDZ2 INC2 .circle/x STZ2
143 138
 		.circle/d LDZ2 #0001 LTS2 ,&else JCN
144 139
 			( decr ) .circle/y LDZ2 #0001 SUB2 .circle/y STZ2
145
-			.circle/x LDZ2 .circle/y LDZ2 SUB2 4** .circle/d LDZ2 ADD2 .circle/d STZ2
140
+			.circle/x LDZ2 .circle/y LDZ2 SUB2 #20 SFT2 .circle/d LDZ2 ADD2 .circle/d STZ2
146 141
 			;&end JMP2
147 142
 		&else
148
-			.circle/x LDZ2 4** .circle/d LDZ2 ADD2 .circle/d STZ2
143
+			.circle/x LDZ2 #20 SFT2 .circle/d LDZ2 ADD2 .circle/d STZ2
149 144
 		&end
150 145
 		( draw ) ;&seg JSR2
151 146
 		.circle/y LDZ2 .circle/x LDZ2 #0001 SUB2 GTS2 ,&loop JCN
... ...
@@ -204,4 +199,5 @@ JMP2r
204 199
 
205 200
 JMP2r
206 201
 
207
-@checker_icn [ f0f0 f0f0 0f0f 0f0f ]
202
+@checker-icn
203
+	f0f0 f0f0 0f0f 0f0f
... ...
@@ -219,7 +219,7 @@ JMP2r
219 219
 
220 220
 JMP2r
221 221
 
222
-@mod DUP2 DIV MUL SUB JMP2r
222
+@mod DIVk MUL SUB JMP2r
223 223
 @abs2 DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 JMP2r
224 224
 @lts2 #8000 STH2k ADD2 SWP2 STH2r ADD2 GTH2 JMP2r
225 225
 @gts2 #8000 STH2k ADD2 SWP2 STH2r ADD2 LTH2 JMP2r
226 226
deleted file mode 100644
... ...
@@ -1,705 +0,0 @@
1
-( UXN-DOS )
2
-
3
-%+  { ADD }  %-  { SUB }  %*  { MUL }  %/  { DIV }
4
-%<  { LTH }  %>  { GTH }  %=  { EQU }  %!  { NEQ }
5
-%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
6
-%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
7
-
8
-%HALT   { #010f DEO }
9
-%EMIT   { #18 DEO }
10
-%PRINT  { ;print-str JSR2 #0a EMIT }
11
-%DEBUG  { ;print-hex/byte JSR2 #0a EMIT }
12
-%DEBUG2 { ;print-hex JSR2 #0a EMIT }
13
-
14
-%2*  { #10 SFT } %2/  { #01 SFT } %2**  { #10 SFT2 } %2//  { #01 SFT2 }
15
-%4*  { #20 SFT } %4/  { #02 SFT } %4**  { #20 SFT2 } %4//  { #02 SFT2 }
16
-%8*  { #30 SFT } %8/  { #03 SFT } %8**  { #30 SFT2 } %8//  { #03 SFT2 }
17
-%10* { #40 SFT } %10/ { #04 SFT } %10** { #40 SFT2 } %10// { #04 SFT2 }
18
-%20* { #50 SFT } %20/ { #05 SFT } %20** { #50 SFT2 } %20// { #05 SFT2 }
19
-
20
-%2MOD  { #01 AND } %2MOD2  { #0001 AND2 }
21
-%4MOD  { #03 AND } %4MOD2  { #0003 AND2 }
22
-%8MOD  { #07 AND } %8MOD2  { #0007 AND2 }
23
-%10MOD { #0f AND } %10MOD2 { #000f AND2 }
24
-
25
-%MOD  { DIVk MUL SUB }
26
-%MOD2 { DIV2k MUL2 SUB2 }
27
-
28
-%AUTO-X      { #01 .Screen/auto DEO }
29
-%AUTO-Y      { #02 .Screen/auto DEO }
30
-%AUTO-XY     { #03 .Screen/auto DEO }
31
-%AUTO-ADDR   { #04 .Screen/auto DEO }
32
-%AUTO-XADDR  { #05 .Screen/auto DEO }
33
-%AUTO-YADDR  { #06 .Screen/auto DEO }
34
-%AUTO-XYADDR { #07 .Screen/auto DEO }
35
-%RELEASE-MOUSE { #0096 DEO }
36
-
37
-%RTN { JMP2r }
38
-
39
-%WIDTH { #38 }
40
-%HEIGHT { #20 }
41
-%PAD { #0018 }
42
-
43
-( devices )
44
-
45
-|00 @System     &vector $2 &wst      $1 &rst    $1 &eaddr  $2 &ecode  $1 &pad     $1 &r       $2 &g      $2 &b     $2 &debug  $1 &halt $1
46
-|20 @Screen     &vector $2 &width   $2 &height $2 &auto  $1 &pad   $1 &x     $2 &y $2 &addr $2 &pixel $1 &sprite $1
47
-|80 @Controller &vector $2 &button $1 &key    $1
48
-|a0 @File       &vector $2 &success  $2 &stat   $2 &delete $1 &append $1 &name    $2 &length  $2 &read   $2 &write $2
49
-|c0 @DateTime   [ &year   $2 &month    $1 &day    $1 &hour  $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 ]
50
-
51
-( variables )
52
-
53
-|0000
54
-
55
-@buffer $3
56
-	&input $80
57
-@path $40
58
-@frame $1
59
-
60
-( init )
61
-
62
-|0100 ( -> )
63
-
64
-	( theme ) 
65
-	#50f8 .System/r DEO2 
66
-	#c0f8 .System/g DEO2 
67
-	#a0f8 .System/b DEO2
68
-
69
-	( vectors ) 
70
-	;on-button .Controller/vector DEO2
71
-
72
-	( resize )
73
-	#00 WIDTH 8** PAD 2** ++ .Screen/width DEO2
74
-	#00 HEIGHT 8** PAD 2** ++ .Screen/height DEO2
75
-
76
-	#04 ;draw-input JSR2
77
-
78
-	LIT '. .path STZ
79
-
80
-	;clear JSR2
81
-
82
-BRK
83
-
84
-@on-button ( -> )
85
-
86
-	.Controller/key DEI
87
-	DUP #00 ! ,&no-null JCN
88
-		POP BRK
89
-		&no-null
90
-	DUP #0d ! ,&no-enter JCN
91
-		#00 ;draw-input JSR2
92
-		;validate JSR2
93
-		#01 ;draw-input JSR2
94
-		.frame LDZk INC SWP STZ
95
-		&no-enter
96
-	DUP #08 ! ,&no-backspace JCN
97
-		#00 ;draw-input JSR2
98
-		;buffer ;spop JSR2
99
-		#04 ;draw-input JSR2
100
-		.frame LDZk INC SWP STZ
101
-		&no-backspace
102
-	DUP STHk #1f > STHr #7b < #0101 !! ,&no-valid JCN
103
-	;buffer ;slen JSR2 #007f >> ,&no-valid JCN
104
-		STHk ;buffer STHr ;sput JSR2
105
-		#04 ;draw-input JSR2
106
-		.frame LDZk INC SWP STZ
107
-		&no-valid
108
-	POP
109
-
110
-BRK
111
-
112
-@clear ( -- )
113
-
114
-	PAD .Screen/x DEO2
115
-	PAD .Screen/y DEO2
116
-	;&blank-icn .Screen/addr DEO2
117
-	AUTO-X
118
-	HEIGHT #00
119
-	&ver
120
-		WIDTH #00
121
-		&hor
122
-			#02 .Screen/sprite DEO
123
-			INC GTHk ,&hor JCN
124
-		POP2
125
-		PAD .Screen/x DEO2
126
-		.Screen/y DEI2k #0008 ++ ROT DEO2
127
-		INC GTHk ,&ver JCN
128
-	POP2
129
-	#00 .Screen/auto DEO
130
-
131
-RTN
132
-	&blank-icn 8000 0000 0000 0000
133
-
134
-( DOS )
135
-
136
-@validate ( -- )
137
-	
138
-	;clear JSR2
139
-
140
-	PAD .Screen/x DEO2
141
-	PAD .Screen/y DEO2
142
-
143
-	;get-cmd JSR2 ;commands-func ++ LDA2 JSR2
144
-	;buffer #0080 ;mclr JSR2
145
-
146
-JMP2r
147
-
148
-@get-cmd ( -- cmd* )
149
-
150
-	;commands/end ;commands
151
-	&loop
152
-		LDA2k ;buffer ;scmp-seg JSR2 #00 = ,&continue JCN
153
-			NIP2 ;commands -- RTN
154
-			&continue
155
-		INC2 INC2 GTH2k ,&loop JCN
156
-	POP2 ;commands --
157
-
158
-RTN
159
-
160
-@cmd-ls "ls $1 &docs "list 20 "folder 20 "content $1 &func
161
-
162
-	( load )
163
-	;path .File/name DEO2
164
-	#8000 .File/length DEO2
165
-	;view .File/read DEO2
166
-
167
-	;view #01 ;draw-tx JSR2
168
-
169
-RTN
170
-
171
-@cmd-mk "mk $1 &docs "make 20 "file $1 &func
172
-
173
-	;buffer/input ;file-exists JSR2 #01 ! ,&no-exists JCN
174
-		;error-exists-txt ;buffer/input ;draw-message JSR2 RTN
175
-		&no-exists
176
-	( save )
177
-	;buffer/input .File/name DEO2
178
-	#0001 .File/length DEO2
179
-	;&buf .File/write DEO2
180
-	( message ) 
181
-	;make-success-txt ;buffer/input ;draw-message JSR2
182
-
183
-RTN
184
-	&buf 0a
185
-
186
-@cmd-cp "cp $1 &docs "copy 20 "file 20 "to 20 "name $1 &func
187
-
188
-	( b ) ;buffer/input #20 ;next-char JSR2 STH2k INC2
189
-	#00 STH2r STA
190
-	( a ) ;buffer/input
191
-	( a exists )
192
-	;buffer/input ;file-exists JSR2 ,&valid JCN
193
-		;error-unexists-txt ;buffer/input ;draw-message JSR2 POP2 POP2 RTN
194
-		&valid
195
-	( b unexists )
196
-	OVR2 ;file-exists JSR2 #00 = ,&available JCN
197
-		OVR2 ;error-exists-txt SWP2 ;draw-message JSR2 POP2 POP2 RTN
198
-		&available
199
-	( load )
200
-	.File/name DEO2
201
-	#8000 .File/length DEO2
202
-	;view .File/read DEO2
203
-	( save )
204
-	DUP2 .File/name DEO2
205
-	#8000 .File/length DEO2
206
-	;view .File/write DEO2
207
-	( message ) 
208
-	;copy-success-txt SWP2 ;draw-message JSR2
209
-
210
-RTN
211
-
212
-@cmd-mv "mv $1 &docs "move 20 "file 20 "to 20 "name $1
213
-	&func
214
-
215
-	( todo )
216
-
217
-RTN
218
-
219
-@cmd-rm "rm $1 &docs "remove 20 "file $1
220
-	&func
221
-
222
-	( exists )
223
-	;buffer/input ;file-exists JSR2 ,&valid JCN
224
-		;error-unexists-txt ;buffer/input ;draw-message JSR2 RTN
225
-		&valid
226
-	( delete )
227
-	;buffer/input .File/name DEO2
228
-	#01 .File/delete DEO
229
-	( message ) 
230
-	;remove-success-txt ;buffer/input ;draw-message JSR2
231
-
232
-RTN
233
-
234
-@cmd-tx "tx $1 &docs "display 20 "file 20 "as 20 "text $1
235
-	&func
236
-
237
-	( exists )
238
-	;buffer/input ;file-exists JSR2 ,&valid JCN
239
-		;error-unexists-txt ;buffer/input ;draw-message JSR2 RTN
240
-		&valid
241
-	( load )
242
-	;buffer/input .File/name DEO2
243
-	#8000 .File/length DEO2
244
-	;view .File/read DEO2
245
-	( message )
246
-	;view #01 ;draw-tx JSR2
247
-
248
-RTN
249
-
250
-@cmd-hx "hx $1 &docs "display 20 "file 20 "as 20 "hex $1
251
-	&func
252
-
253
-	( exists )
254
-	;buffer/input ;file-exists JSR2 ,&valid JCN
255
-		;error-unexists-txt ;buffer/input ;draw-message JSR2 RTN
256
-		&valid
257
-	( load )
258
-	;buffer/input .File/name DEO2
259
-	#8000 .File/length DEO2
260
-	;view .File/read DEO2
261
-	( message )
262
-	AUTO-YADDR
263
-	.File/success DEI2 #0000
264
-	&loop
265
-		DUP2 ;view ++ LDA #01 ;draw-hex JSR2
266
-		( make shorts )
267
-		DUP2 #0001 AND2 #0000 == ,&no-short JCN
268
-			.Screen/x DEI2k #0008 ++ ROT DEO2
269
-			&no-short
270
-		( make lines )
271
-		DUP2 #000f AND2 #000f !! ,&no-lines JCN
272
-			.Screen/y DEI2k #0010 ++ ROT DEO2
273
-			PAD .Screen/x DEO2
274
-			.Screen/y DEI2 .Screen/height DEI2 PAD -- #0010 -- >> ,&end JCN
275
-			&no-lines
276
-		INC2 GTH2k ,&loop JCN
277
-	&end
278
-	POP2 POP2
279
-
280
-RTN
281
-
282
-@cmd-do "do $1 &docs "run 20 "file 20 "as 20 "rom $1
283
-	&func
284
-
285
-	( release inputs )
286
-	#0000 .Controller/button DEO2
287
-
288
-	;buffer/input
289
-	DUP2 ;check-rom JSR2 ,&valid JCN
290
-		PAD .Screen/x DEO2
291
-		PAD .Screen/y DEO2
292
-		;&invalid-txt #02 ;draw-str JSR2
293
-		#01 ;draw-str JSR2
294
-		RTN
295
-		&valid
296
-	;load-rom JSR2 
297
-
298
-RTN
299
-	&invalid-txt "invalid 20 "rom: $1
300
-
301
-@cmd-tm "tm $1 &docs "display 20 "time $1
302
-	&func
303
-
304
-	#00 .DateTime/month DEI 4* ;month-txt ++ #01 ;draw-str JSR2
305
-	#20 #01 ;draw-char JSR2
306
-	.DateTime/day DEI #01 ;draw-dec JSR2
307
-	#20 #01 ;draw-char JSR2
308
-	#00 .DateTime/dotw DEI 4* ;week-txt ++ #01 ;draw-str JSR2
309
-	#20 #01 ;draw-char JSR2
310
-	.DateTime/hour DEI #01 ;draw-dec JSR2
311
-	LIT ': #01 ;draw-char JSR2
312
-	.DateTime/minute DEI #01 ;draw-dec JSR2
313
-	LIT ': #01 ;draw-char JSR2
314
-	.DateTime/second DEI #01 ;draw-dec JSR2
315
-
316
-RTN
317
-
318
-@cmd-1b "1b $1 &docs "display 20 "1bit 20 "file $1
319
-	&func
320
-
321
-	( todo )
322
-
323
-RTN
324
-
325
-@cmd-2b "2b $1 &docs "display 20 "2bit 20 "file $1
326
-	&func
327
-
328
-	( todo )
329
-
330
-RTN
331
-
332
-@cmd-sn "sn $1 &docs "play 20 "sound 20 "file $1
333
-	&func
334
-
335
-	( todo )
336
-
337
-RTN
338
-
339
-@cmd-?? "-- $1 &docs "display 20 "commands $1
340
-	&func
341
-
342
-	;&help-txt #01 ;draw-tx JSR2
343
-	PAD #0010 ++ .Screen/y DEO2
344
-
345
-	;commands/end ;commands
346
-	&loop
347
-		PAD .Screen/x DEO2
348
-		( name ) LDA2k #04 ;draw-str JSR2
349
-		PAD #0020 ++ .Screen/x DEO2
350
-		( docs ) DUP2 ;commands -- ;commands-docs ++ LDA2 #01 ;draw-str JSR2
351
-		.Screen/y DEI2k #0010 ++ ROT DEO2
352
-		INC2 INC2 GTH2k ,&loop JCN
353
-	POP2 POP2
354
-
355
-RTN
356
-	&help-txt "Commands: $1
357
-
358
-@commands
359
-	:cmd-ls :cmd-mk :cmd-cp :cmd-mv :cmd-rm 
360
-	:cmd-hx :cmd-tx :cmd-do :cmd-tm
361
-	:cmd-1b :cmd-2b :cmd-sn
362
-	&end :cmd-??
363
-@commands-docs
364
-	:cmd-ls/docs :cmd-mk/docs :cmd-cp/docs :cmd-mv/docs :cmd-rm/docs 
365
-	:cmd-hx/docs :cmd-tx/docs :cmd-do/docs :cmd-tm/docs
366
-	:cmd-1b/docs :cmd-2b/docs :cmd-sn/docs
367
-	&end :cmd-??/docs
368
-@commands-func
369
-	:cmd-ls/func :cmd-mk/func :cmd-cp/func :cmd-mv/func :cmd-rm/func 
370
-	:cmd-hx/func :cmd-tx/func :cmd-do/func :cmd-tm/func
371
-	:cmd-1b/func :cmd-2b/func :cmd-sn/func
372
-	&end :cmd-??/func
373
-
374
-@file-exists ( name* -- bool )
375
-
376
-	.File/name DEO2
377
-	#0040 .File/length DEO2
378
-	;&buf .File/stat DEO2
379
-	.File/success DEI2 #0000 >>
380
-
381
-RTN
382
-	&buf $40
383
-
384
-( gui )
385
-
386
-@draw-input ( color -- )
387
-
388
-	AUTO-YADDR
389
-	STH
390
-	PAD .Screen/x DEO2
391
-	.Screen/height DEI2 PAD -- .Screen/y DEO2
392
-
393
-	( flower )
394
-	;flowers-icn #00 .frame LDZ #06 MOD 20** ++ .Screen/addr DEO2
395
-	#81 .Screen/sprite DEOk DEO
396
-	.Screen/y DEI2 #0010 -- .Screen/y DEO2
397
-	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
398
-
399
-	#20 #00 ;draw-char JSR2
400
-
401
-	;buffer STHkr ;draw-str JSR2
402
-
403
-	;cursor-icn .Screen/addr DEO2
404
-	STHr .Screen/sprite DEOk DEO
405
-	.Screen/y DEI2 #0010 -- .Screen/y DEO2
406
-	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
407
-
408
-JMP2r
409
-
410
-@draw-message ( a* b* -- )
411
-
412
-	SWP2 #02 ;draw-str JSR2
413
-	#01 ;draw-str JSR2
414
-	
415
-RTN
416
-
417
-@draw-tx ( str* color -- )
418
-
419
-	AUTO-YADDR
420
-	.Screen/x DEI2 ,&anchor STR2
421
-	STH
422
-	&while
423
-		( outside view )
424
-		.Screen/x DEI2 .Screen/width DEI2 PAD -- #0010 -- >> ,&lb JCN
425
-		( linebreak )
426
-		LDAk #0a ! ,&no-lb JCN
427
-			&lb
428
-			LIT2 &anchor $2 .Screen/x DEO2
429
-			.Screen/y DEI2k #0010 ++ STH2k ROT DEO2
430
-			STH2r .Screen/height DEI2 PAD -- #0010 -- >> ,&end JCN
431
-			,&skip JMP
432
-			&no-lb
433
-		LDAk STHkr ,draw-char JSR
434
-		&skip
435
-		INC2 LDAk ,&while JCN
436
-	&end
437
-	POP2
438
-	POPr
439
-
440
-RTN
441
-
442
-@draw-dec ( byte color -- )
443
-
444
-	STH
445
-	DUP #0a DIV LIT '0 + STHkr ,draw-char JSR
446
-	#0a MOD LIT '0 + STHr ,draw-char JSR
447
-
448
-RTN
449
-
450
-@draw-hex ( byte color -- )
451
-
452
-	STH
453
-	DUP #04 SFT ,&parse JSR STHkr ,draw-char JSR
454
-	#0f AND ,&parse JSR STHr ,draw-char JSR
455
-	RTN
456
-	&parse ( value -- char )
457
-		DUP #09 > ,&above JCN
458
-			#30 + RTN
459
-		&above
460
-			#09 - #60 + RTN
461
-
462
-RTN
463
-
464
-@draw-str ( str* color -- )
465
-
466
-	AUTO-YADDR
467
-	STH
468
-	&while
469
-		LDAk STHkr ,draw-char JSR
470
-		INC2 LDAk ,&while JCN
471
-	POP2
472
-	POPr
473
-
474
-RTN
475
-
476
-@draw-char ( char color -- )
477
-
478
-	SWP
479
-	[ #20 - #00 SWP #40 SFT2 ;font ++ ] .Screen/addr DEO2
480
-	.Screen/sprite DEOk DEO
481
-	.Screen/y DEI2 #0010 -- .Screen/y DEO2
482
-	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
483
-
484
-RTN
485
-
486
-( utils )
487
-
488
-@next-char ( addr* char -- addr* )
489
-
490
-	STH
491
-	&while
492
-		LDAk STHkr = ,&end JCN
493
-		LDAk #00 = ,&end JCN
494
-		INC2 LDAk ,&while JCN
495
-	&end
496
-		POPr
497
-
498
-RTN
499
-
500
-@slen ( str* -- len* )
501
-
502
-	DUP2 ,scap JSR SWP2 --
503
-
504
-RTN
505
-
506
-@scap ( str* -- str-end* )
507
-
508
-	( clamp ) LDAk #00 ! JMP RTN
509
-	&while INC2 LDAk ,&while JCN
510
-
511
-RTN
512
-
513
-@sput ( str* char -- )
514
-
515
-	ROT ROT ,scap JSR STA
516
-
517
-RTN
518
-
519
-@spop ( str* -- )
520
-
521
-	( clamp ) LDAk #00 ! JMP RTN
522
-	#00 ROT ROT ,scap JSR #0001 -- STA
523
-
524
-RTN
525
-
526
-@scmp-seg ( a* b* -- flag )
527
-
528
-	STH2
529
-	&loop
530
-		LDAk LDAkr STHr = ,&not-diff JCN
531
-			POP2 POP2r #00 RTN
532
-			&not-diff
533
-		INC2k LDA #00 ! ,&continue JCN
534
-			POP2 POP2r #01 RTN
535
-			&continue
536
-		INC2 INC2r
537
-		,&loop JMP
538
-	POP2 POP2r #00
539
-
540
-RTN
541
-
542
-@mclr ( addr* len* -- )
543
-
544
-	OVR2 ++ SWP2
545
-	&loop
546
-		STH2k #00 STH2r STA
547
-		INC2 GTH2k ,&loop JCN
548
-	POP2 POP2
549
-
550
-JMP2r
551
-
552
-@print-hex ( value* -- )
553
-
554
-	SWP ,&byte JSR 
555
-	&byte ( byte -- )
556
-		STHk #04 SFT ,&parse JSR #18 DEO
557
-		STHr #0f AND ,&parse JSR #18 DEO
558
-	JMP2r
559
-	&parse ( byte -- char ) DUP #09 GTH ,&above JCN #30 ADD JMP2r 
560
-	&above #57 ADD JMP2r
561
-
562
-JMP2r
563
-
564
-@print-str ( string* -- )
565
-
566
-	#0001 SUB2 
567
-	&while
568
-		INC2 LDAk DUP #18 DEO ,&while JCN 
569
-	POP2
570
-
571
-JMP2r
572
-
573
-@error-exists-txt "file_exists: 20 $1
574
-@error-unexists-txt "file_does_not_exists: 20 $1
575
-
576
-@make-success-txt "made: 20 $1
577
-@copy-success-txt "copied: 20 $1
578
-@remove-success-txt "removed: 20 $1
579
-
580
-@week-txt
581
-	"Sun $1 "Mon $1 "Tue $1 "Wed $1 "Thu $1 "Fri $1 
582
-	"Sat $1
583
-
584
-@month-txt
585
-	"Jan $1 "Feb $1 "Mar $1 "Apr $1 "May $1 "Jun $1
586
-	"Jul $1 "Aug $1 "Sep $1 "Oct $1 "Nov $1 "Dec $1
587
-
588
-@cursor-icn
589
-	aa55 aa55 aa55 aa55 aa55 aa55 aa55 aa55
590
-	aa55 aa55 aa55 aa55 aa55 aa55 aa55 aa55
591
-
592
-@flowers-icn ( by elioat )
593
-	0000 0020 1408 0810 40a0 4205 0200 40a0
594
-	0810 103c 7e7e 3c18 4205 0234 7e7e 3c18
595
-	0000 0020 100c 0818 0040 a042 0522 5024
596
-	0008 083c 7e7e 3c18 0a04 002c 7e7e 3c18
597
-	0000 0000 0000 000c 0000 0000 0000 0000
598
-	1c10 083c 7e7e 3c18 0000 002c 7e7e 3c18
599
-	0000 0000 0000 0004 0000 0000 0002 0502
600
-	0810 103c 7e7e 3c18 0000 0034 7e7e 3c18
601
-	0000 0000 0000 0010 0000 0000 0020 5225
602
-	080c 083c 7e7e 3c18 0200 002c 7e7e 3c18
603
-	0000 0000 0800 1800 0000 040a 2450 240a
604
-	1010 103c 7e7e 3c18 0400 0034 7e7e 3c18
605
-
606
-@font ( terminus01x02 )
607
-	0000 0000 0000 0000 0000 0000 0000 0000
608
-	0000 183c 3c3c 1818 1800 1818 0000 0000
609
-	0066 6666 2400 0000 0000 0000 0000 0000
610
-	0000 006c 6cfe 6c6c 6cfe 6c6c 0000 0000
611
-	1818 7cc6 c2c0 7c06 0686 c67c 1818 0000
612
-	0000 0000 c2c6 0c18 3060 c686 0000 0000
613
-	0000 386c 6c38 76dc cccc cc76 0000 0000
614
-	0030 3030 6000 0000 0000 0000 0000 0000
615
-	0000 0c18 3030 3030 3030 180c 0000 0000
616
-	0000 3018 0c0c 0c0c 0c0c 1830 0000 0000
617
-	0000 0000 0066 3cff 3c66 0000 0000 0000
618
-	0000 0000 0018 187e 1818 0000 0000 0000
619
-	0000 0000 0000 0000 0018 1818 3000 0000
620
-	0000 0000 0000 00fe 0000 0000 0000 0000
621
-	0000 0000 0000 0000 0000 1818 0000 0000
622
-	0000 0000 0206 0c18 3060 c080 0000 0000
623
-	0000 386c c6c6 d6d6 c6c6 6c38 0000 0000
624
-	0000 1838 7818 1818 1818 187e 0000 0000
625
-	0000 7cc6 060c 1830 60c0 c6fe 0000 0000
626
-	0000 7cc6 0606 3c06 0606 c67c 0000 0000
627
-	0000 0c1c 3c6c ccfe 0c0c 0c1e 0000 0000
628
-	0000 fec0 c0c0 fc06 0606 c67c 0000 0000
629
-	0000 3860 c0c0 fcc6 c6c6 c67c 0000 0000
630
-	0000 fec6 0606 0c18 3030 3030 0000 0000
631
-	0000 7cc6 c6c6 7cc6 c6c6 c67c 0000 0000
632
-	0000 7cc6 c6c6 7e06 0606 0c78 0000 0000
633
-	0000 0000 1818 0000 0018 1800 0000 0000
634
-	0000 0000 1818 0000 0018 1830 0000 0000
635
-	0000 0006 0c18 3060 3018 0c06 0000 0000
636
-	0000 0000 007e 0000 7e00 0000 0000 0000
637
-	0000 0060 3018 0c06 0c18 3060 0000 0000
638
-	0000 7cc6 c60c 1818 1800 1818 0000 0000
639
-	0000 007c c6c6 dede dedc c07c 0000 0000
640
-	0000 1038 6cc6 c6fe c6c6 c6c6 0000 0000
641
-	0000 fc66 6666 7c66 6666 66fc 0000 0000
642
-	0000 3c66 c2c0 c0c0 c0c2 663c 0000 0000
643
-	0000 f86c 6666 6666 6666 6cf8 0000 0000
644
-	0000 fe66 6268 7868 6062 66fe 0000 0000
645
-	0000 fe66 6268 7868 6060 60f0 0000 0000
646
-	0000 3c66 c2c0 c0de c6c6 663a 0000 0000
647
-	0000 c6c6 c6c6 fec6 c6c6 c6c6 0000 0000
648
-	0000 3c18 1818 1818 1818 183c 0000 0000
649
-	0000 1e0c 0c0c 0c0c cccc cc78 0000 0000
650
-	0000 e666 666c 7878 6c66 66e6 0000 0000
651
-	0000 f060 6060 6060 6062 66fe 0000 0000
652
-	0000 c6ee fefe d6c6 c6c6 c6c6 0000 0000
653
-	0000 c6e6 f6fe dece c6c6 c6c6 0000 0000
654
-	0000 7cc6 c6c6 c6c6 c6c6 c67c 0000 0000
655
-	0000 fc66 6666 7c60 6060 60f0 0000 0000
656
-	0000 7cc6 c6c6 c6c6 c6d6 de7c 0c0e 0000
657
-	0000 fc66 6666 7c6c 6666 66e6 0000 0000
658
-	0000 7cc6 c660 380c 06c6 c67c 0000 0000
659
-	0000 7e7e 5a18 1818 1818 183c 0000 0000
660
-	0000 c6c6 c6c6 c6c6 c6c6 c67c 0000 0000
661
-	0000 c6c6 c6c6 c6c6 c66c 3810 0000 0000
662
-	0000 c6c6 c6c6 d6d6 d6fe ee6c 0000 0000
663
-	0000 c6c6 6c7c 3838 7c6c c6c6 0000 0000
664
-	0000 6666 6666 3c18 1818 183c 0000 0000
665
-	0000 fec6 860c 1830 60c2 c6fe 0000 0000
666
-	0000 3c30 3030 3030 3030 303c 0000 0000
667
-	0000 0080 c0e0 7038 1c0e 0602 0000 0000
668
-	0000 3c0c 0c0c 0c0c 0c0c 0c3c 0000 0000
669
-	1038 6cc6 0000 0000 0000 0000 0000 0000
670
-	0000 0000 0000 0000 0000 0000 00ff 0000
671
-	3030 1800 0000 0000 0000 0000 0000 0000
672
-	0000 0000 0078 0c7c cccc cc76 0000 0000
673
-	0000 e060 6078 6c66 6666 667c 0000 0000
674
-	0000 0000 007c c6c0 c0c0 c67c 0000 0000
675
-	0000 1c0c 0c3c 6ccc cccc cc76 0000 0000
676
-	0000 0000 007c c6fe c0c0 c67c 0000 0000
677
-	0000 386c 6460 f060 6060 60f0 0000 0000
678
-	0000 0000 0076 cccc cccc cc7c 0ccc 7800
679
-	0000 e060 606c 7666 6666 66e6 0000 0000
680
-	0000 1818 0038 1818 1818 183c 0000 0000
681
-	0000 0606 000e 0606 0606 0606 6666 3c00
682
-	0000 e060 6066 6c78 786c 66e6 0000 0000
683
-	0000 3818 1818 1818 1818 183c 0000 0000
684
-	0000 0000 00ec fed6 d6d6 d6c6 0000 0000
685
-	0000 0000 00dc 6666 6666 6666 0000 0000
686
-	0000 0000 007c c6c6 c6c6 c67c 0000 0000
687
-	0000 0000 00dc 6666 6666 667c 6060 f000
688
-	0000 0000 0076 cccc cccc cc7c 0c0c 1e00
689
-	0000 0000 00dc 7666 6060 60f0 0000 0000
690
-	0000 0000 007c c660 380c c67c 0000 0000
691
-	0000 1030 30fc 3030 3030 361c 0000 0000
692
-	0000 0000 00cc cccc cccc cc76 0000 0000
693
-	0000 0000 0066 6666 6666 3c18 0000 0000
694
-	0000 0000 00c6 c6d6 d6d6 fe6c 0000 0000
695
-	0000 0000 00c6 6c38 3838 6cc6 0000 0000
696
-	0000 0000 00c6 c6c6 c6c6 c67e 060c f800
697
-	0000 0000 00fe cc18 3060 c6fe 0000 0000
698
-	0000 0e18 1818 7018 1818 180e 0000 0000
699
-	0000 1818 1818 0018 1818 1818 0000 0000
700
-	0000 7018 1818 0e18 1818 1870 0000 0000
701
-
702
-~projects/library/check-rom.tal
703
-~projects/library/load-rom.tal
704
-
705
-@view
... ...
@@ -200,7 +200,7 @@ JMP2r
200 200
 @follow-selection ( -- )
201 201
 
202 202
 	.browser/y2 LDZ2 .browser/y LDZ2 SUB2 #04 SFT2 NIP .browser/sel LDZ .browser/scroll LDZ SUB
203
-	DUP2 GTH ,&no-down JCN
203
+	GTHk ,&no-down JCN
204 204
 		.browser/scroll LDZ INC ,scroll-to JSR
205 205
 		&no-down
206 206
 	DUP2 SWP LTH ,&no-up JCN
... ...
@@ -215,7 +215,7 @@ JMP2r
215 215
 	STH
216 216
 	( more lines than visible )
217 217
 	.browser/lines LDZ .browser/y2 LDZ2 .browser/y LDZ2 SUB2 #04 SFT2 NIP
218
-	DUP2 GTH ,&can-scroll JCN
218
+	GTHk ,&can-scroll JCN
219 219
 		POPr POP2 JMP2r
220 220
 		&can-scroll
221 221
 	( less than max scroll )
... ...
@@ -1,40 +1,14 @@
1
-(
2
-	app/neralie : clock with arvelie date
3
-
4
-	TODO
5
-		- use splash screen when FPS calculation is unstable
6
-)
7
-
8
-%+  { ADD } %-   { SUB }              %/   { DIV }  
9
-%<  { LTH } %>   { GTH }  %=  { EQU } %!   { NEQ } 
10
-%++ { ADD2 } %-- { SUB2 }              %// { DIV2 } 
11
-%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }  
12
-
13
-%2*  { #10 SFT } %2/  { #01 SFT }
14
-%4*  { #20 SFT } %4/  { #02 SFT }
15
-%8*  { #30 SFT } %8/  { #03 SFT }
16
-%10* { #40 SFT } %10/ { #04 SFT }
17
-%20* { #50 SFT } %20/ { #05 SFT }
18
-
19
-%2**  { #10 SFT2 } %2//  { #01 SFT2 }
20
-%4**  { #20 SFT2 } %4//  { #02 SFT2 }
21
-%8**  { #30 SFT2 } %8//  { #03 SFT2 }
22
-%10** { #40 SFT2 } %10// { #04 SFT2 }
23
-%20** { #50 SFT2 } %20// { #05 SFT2 }
24
-
25
-%MOD  { DUP2 DIV MUL SUB }
1
+( app/neralie : clock with arvelie date )
2
+
3
+%PAD { #0018 }
4
+
5
+%MOD  { DIVk MUL SUB }
26 6
 %MOD2 { DIV2k MUL2 SUB2 }
27
-%TOS { #00 SWP }
28 7
 
29 8
 %h { .DateTime/hour   DEI }
30 9
 %m { .DateTime/minute DEI }
31 10
 %s { .DateTime/second DEI }
32 11
 
33
-%1-- { #0001 -- }
34
-
35
-%PAD { #0018 }
36
-%RTN { JMP2r }
37
-
38 12
 ( devices )
39 13
 
40 14
 |00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
... ...
@@ -76,15 +50,15 @@
76 50
 	PAD
77 51
 	DUP2 .frame/x1 STZ2
78 52
 	DUP2 .frame/y1 STZ2
79
-	DUP2 .Screen/width DEI2 SWP2 -- #0001 -- .frame/x2 STZ2
80
-	     .Screen/height DEI2 SWP2 -- .frame/y2 STZ2
53
+	DUP2 .Screen/width DEI2 SWP2 SUB2 #0001 SUB2 .frame/x2 STZ2
54
+	     .Screen/height DEI2 SWP2 SUB2 .frame/y2 STZ2
81 55
 
82 56
 	#01 .neralie/color STZ
83 57
 
84 58
 	.frame/x1 LDZ2 .frame/x2 LDZ2
85 59
 	OVR2 OVR2 .frame/y1 LDZ2 ;h JSR2
86 60
 	          .frame/y2 LDZ2 ;h JSR2
87
-	.frame/y1 LDZ2 #0001 -- .frame/y2 LDZ2 INC2
61
+	.frame/y1 LDZ2 #0001 SUB2 .frame/y2 LDZ2 INC2
88 62
 	OVR2 OVR2 .frame/x1 LDZ2 ;v JSR2
89 63
 	          .frame/x2 LDZ2 ;v JSR2
90 64
 
... ...
@@ -108,7 +82,7 @@ BRK
108 82
 	#0120 #00 h MUL2
109 83
 	#00c0 #00 m MUL2 ADD2
110 84
 	#00f8 #00 s MUL2 ADD2
111
-	#0271 #00 .fps/next LDZ MUL2 #00 .fps/current LDZ DIV2 8** ADD2
85
+	#0271 #00 .fps/next LDZ MUL2 #00 .fps/current LDZ DIV2 #30 SFT2 ADD2
112 86
 	#01b0 ;modf JSR2 SWP2 #0017 MUL2 #03e8 DIV2 .neralie/n6 STZ POP
113 87
 
114 88
 	( add up units and tens of pulses, store in n5 and n4 )
... ...
@@ -122,29 +96,29 @@ BRK
122 96
 	#01a0 #00 h MUL2 ADD2
123 97
 	#0006 #00 m MUL2 ADD2 .neralie/n0123 STZ2
124 98
 
125
-RTN
99
+JMP2r
126 100
 
127 101
 @draw-date ( -- )
128 102
 
129 103
 	( auto x ) #01 .Screen/auto DEO
130 104
 
131
-	.Screen/width DEI2 2// #0034 -- .Screen/x DEO2
132
-	.Screen/height DEI2 #0010 -- .Screen/y DEO2
105
+	.Screen/width DEI2 #01 SFT2 #0034 SUB2 .Screen/x DEO2
106
+	.Screen/height DEI2 #0010 SUB2 .Screen/y DEO2
133 107
 
134 108
 	( arvelie )
135
-	.DateTime/year DEI2 #07d6 -- NIP 
136
-		DUP #0a DIV TOS 8** ;font-numbers ++ .Screen/addr DEO2
109
+	.DateTime/year DEI2 #07d6 SUB2 NIP
110
+		DUP #0a DIV #00 SWP #30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2
137 111
 			#01 .Screen/sprite DEO
138
-		#0a MOD TOS 8** ;font-numbers ++ .Screen/addr DEO2
112
+		#0a MOD #00 SWP #30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2
139 113
 			#01 .Screen/sprite DEO
140 114
 	.DateTime/doty DEI2
141
-		DUP2 #000e DIV2 8** ;font-letters ++ .Screen/addr DEO2
115
+		DUP2 #000e DIV2 #30 SFT2 ;font-letters ADD2 .Screen/addr DEO2
142 116
 			#01 .Screen/sprite DEO
143 117
 		#000e MOD2
144 118
 		DUP2 #000a DIV2 ,digit JSR
145 119
 		#000a MOD2 ,digit JSR
146 120
 
147
-	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
121
+	.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
148 122
 
149 123
 	( neralie )
150 124
 	.neralie/n0123 LDZ2 
... ...
@@ -158,14 +132,14 @@ RTN
158 132
 
159 133
 	( auto none ) #00 .Screen/auto DEO
160 134
 
161
-RTN
135
+JMP2r
162 136
 
163 137
 @digit ( index* -- )
164 138
 
165
-	8** ;font-numbers ++ .Screen/addr DEO2
139
+	#30 SFT2 ;font-numbers ADD2 .Screen/addr DEO2
166 140
 	.neralie/color LDZ .Screen/sprite DEO
167 141
 	
168
-RTN
142
+JMP2r
169 143
 
170 144
 @draw-clock ( -- )
171 145
 
... ...
@@ -197,7 +171,7 @@ RTN
197 171
 
198 172
 	&next ( digit-addr number* -- next-digit-addr next-number* prev-digit* )
199 173
 	#03e8 ;modf JSR2 STH2 #000a MUL2
200
-	ROT DUP STH INC ROT ROT
174
+	ROT STHk INC ROT ROT
201 175
 	#00 STHr LDZ ADD2
202 176
 	STH2r
203 177
 	JMP2r
... ...
@@ -256,8 +230,8 @@ RTN
256 230
 	#00 .fps/next STZ
257 231
 	JMP2r
258 232
 
259
-@modf ( dividend* divisor* -- remainder* quotient* )
260
-	OVR2 OVR2 DIV2 DUP2 STH2 MUL2 SUB2 STH2r JMP2r
233
+@modf ( dividend* divisor* SUB2 remainder* quotient* )
234
+	OVR2 OVR2 DIV2 STH2k MUL2 SUB2 STH2r JMP2r
261 235
 
262 236
 @mul2hi ( a* b* -- product-top-16-bits* )
263 237
 	(