Browse code

(clock.tal) Added day of the week

Devine Lu Linvega authored on 18/11/2021 17:47:05
Showing 1 changed files
... ...
@@ -5,11 +5,13 @@
5 5
 %++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 } 
6 6
 %<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 } 
7 7
 
8
+%4* { #20 SFT }
8 9
 %8* { #30 SFT }
9 10
 %10* { #40 SFT }
10 11
 %2// { #01 SFT2 }
11 12
 %4// { #02 SFT2 }
12 13
 %2** { #10 SFT2 }
14
+%10** { #40 SFT2 }
13 15
 
14 16
 %DIAMETER  { #0080 }
15 17
 %RADIUS    { DIAMETER 2// }
... ...
@@ -115,30 +117,34 @@ RTN
115 117
 @draw-display ( -- )
116 118
 
117 119
 	( auto addr ) #04 .Screen/auto DEO
118
-	( date )
120
+
121
+	( dotw )
119 122
 	.center/y LDZ2 #0068 -- .Screen/y DEO2
123
+	.center/x LDZ2 #0048 -- .Screen/x DEO2
124
+	.DateTime/dotw DEI 4* TOS ;dotw ++ ;draw-dotw JSR2
125
+	( date )
120 126
 	.center/x LDZ2 #0014 -- .Screen/x DEO2
121 127
 	.DateTime/month DEI2 
122 128
 		SWP INC ,&number JSR
123
-		;font/slash ,&spacer JSR
129
+		;font/slash ,&char JSR
124 130
 		,&number JSR
125 131
 	( time )
126 132
 	.center/y LDZ2 #0060 ++ .Screen/y DEO2
127 133
 	.center/x LDZ2 #0020 -- .Screen/x DEO2
128 134
 	.DateTime/hour DEI2 
129 135
 		SWP ,&number JSR
130
-		;font/spacer ,&spacer JSR
136
+		;font/spacer ,&char JSR
131 137
 		,&number JSR
132
-		;font/spacer ,&spacer JSR
138
+		;font/spacer ,&char JSR
133 139
 	.DateTime/second DEI 
134 140
 		,&number JSR
135
-	( auto none ) #00 .Screen/auto DEO
136 141
 
142
+	( auto none ) #00 .Screen/auto DEO
137 143
 
138 144
 RTN
139 145
 	&pady ( -- )
140 146
 		.Screen/y DEI2 #0008 ++ .Screen/y DEO2 RTN
141
-	&spacer ( char* -- )
147
+	&char ( char* -- )
142 148
 		.Screen/addr DEO2
143 149
 		#03 .Screen/sprite DEO
144 150
 		,&pady JSR
... ...
@@ -160,6 +166,16 @@ RTN
160 166
 		.Screen/y DEI2 #0008 -- .Screen/y DEO2
161 167
 	RTN
162 168
 
169
+@draw-dotw ( str* -- )
170
+
171
+	DUP2 #0003 ++ SWP2
172
+	&loop
173
+		LDAk #41 - TOS 10** ;font/letters ++ ;draw-display/char JSR2
174
+		INC2 GTH2k ,&loop JCN
175
+	POP2 POP2
176
+
177
+RTN
178
+
163 179
 @draw-line ( x1 y1 x2 y2 color -- )
164 180
 	
165 181
 	( load ) .line/color STZ .line/y0 STZ2 .line/x0 STZ2 .line/y STZ2 .line/x STZ2
... ...
@@ -188,6 +204,9 @@ RTN
188 204
 
189 205
 RTN
190 206
 
207
+@dotw
208
+	"Sun $1 "Mon $1 "Tue $1 "Wed $1 "Thu $1 "Fri $1 "Sat $1
209
+
191 210
 @table ( 60 positions on a circle )
192 211
 	8000 8d00 9a02 a706 b40b c011 cb18 d520
193 212
 	df2a e734 ee40 f44b f958 fd65 ff72 ff80
... ...
@@ -213,4 +232,63 @@ RTN
213 232
 	0000 0000 0010 1000 0000 0000 1010 0000
214 233
 	&slash
215 234
 	0202 0404 0808 1010 2020 4040 8080 0000
235
+	&letters
236
+	0010 1028 2844 4444 8282 fe82 8282 0000
237
+	00f8 4442 4242 4478 4442 4242 44f8 0000
238
+	003c 4282 8280 8080 8080 8282 423c 0000
239
+	00f8 4442 4242 4242 4242 4242 44f8 0000
240
+	00fc 4240 4040 4878 4840 4040 42fc 0000
241
+	80fe 4240 4040 447c 4440 4040 40e0 0000
242
+	003a 4682 8080 8e82 8282 8282 463a 0000
243
+	00ee 4444 4444 447c 4444 4444 44ee 0000
244
+	0038 1010 1010 1010 1010 1010 1038 0000
245
+	000e 0404 0404 0404 0404 4444 2810 0000
246
+	00ee 4448 4850 5060 5050 4848 44ee 0000
247
+	00e0 4040 4040 4040 4040 4040 42fe 0000
248
+	0082 c6c6 c6aa aaaa 9292 9282 8282 0000
249
+	00e2 4262 6262 5252 4a4a 4646 42e2 0000
250
+	0038 4482 8282 8282 8282 8282 4438 0000
251
+	00f8 4442 4242 4244 7840 4040 40f0 0000
252
+	0038 4482 8282 8282 8282 829a 643a 0000
253
+	00f8 4442 4242 4478 4844 4442 42e2 0000
254
+	0010 2844 4440 2010 0804 4444 2810 0000
255
+	00fe 9210 1010 1010 1010 1010 1038 0000
256
+	00ee 4444 4444 4444 4444 4444 4438 0000
257
+	0082 8282 8282 8244 4444 2828 1010 0000
258
+	0082 8292 9292 9292 92ba aa44 4444 0000
259
+	0042 4242 2424 1818 1824 2442 4242 0000
260
+	0082 8282 4444 2828 1010 1010 1038 0000
261
+	007e 4204 0408 0810 1020 2040 427e 0000
262
+	0e08 0808 0808 0808 0808 0808 0808 080e
263
+	0082 8282 4444 fe28 10fe 1010 1010 1000
264
+	7010 1010 1010 1010 1010 1010 1010 1070
265
+	1028 4400 0000 0000 0000 0000 0000 0000
266
+	0000 0000 0000 0000 0000 0000 0000 00fe
267
+	1010 1008 0000 0000 0000 0000 0000 0000
268
+	0000 0000 0030 0808 3848 4848 4834 0000
269
+	0060 2020 202c 3222 2222 2222 322c 0000
270
+	0000 0000 001c 2240 4040 4040 221c 0000
271
+	000c 0404 0434 4c44 4444 4444 4c36 0000
272
+	0000 0000 0018 2424 3c20 2020 2418 0000
273
+	000c 1210 1038 1010 1010 1010 1038 0000
274
+	0000 0000 0034 4a48 4830 4038 4444 4438
275
+	00c0 4040 4058 6444 4444 4444 44ee 0000
276
+	0010 0000 0030 1010 1010 1010 1038 0000
277
+	0008 0000 0018 0808 0808 0808 0808 2810
278
+	0060 2020 2022 2224 2438 2424 2272 0000
279
+	0030 1010 1010 1010 1010 1010 1038 0000
280
+	0000 0000 00a4 da92 9292 9292 9292 0000
281
+	0000 0000 00d8 6444 4444 4444 44ee 0000
282
+	0000 0000 0038 4482 8282 8282 4438 0000
283
+	0000 0000 00d8 6442 4242 4242 6458 40e0
284
+	0000 0000 0034 4c84 8484 8484 4c34 040e
285
+	0000 0000 0068 3420 2020 2020 2070 0000
286
+	0000 0000 0018 2424 1008 0424 2418 0000
287
+	0010 1010 107c 1010 1010 1010 1408 0000
288
+	0000 0000 00cc 4444 4444 4444 4c36 0000
289
+	0000 0000 00ee 4444 4428 2828 1010 0000
290
+	0000 0000 0092 9292 9292 92aa 4444 0000
291
+	0000 0000 00ee 4428 1010 1028 44ee 0000
292
+	0000 0000 00ee 4444 4448 2828 1010 2040
293
+	0000 0000 007c 4408 0810 2020 447c 0000
216 294