... | ... |
@@ -22,6 +22,9 @@ |
22 | 22 |
%8MOD { #07 AND } %8MOD2 { #0007 AND2 } |
23 | 23 |
%10MOD { #0f AND } %10MOD2 { #000f AND2 } |
24 | 24 |
|
25 |
+%MOD { DIVk MUL SUB } |
|
26 |
+%MOD2 { DIV2k MUL2 SUB2 } |
|
27 |
+ |
|
25 | 28 |
%AUTO-NONE { #00 .Screen/auto DEO } |
26 | 29 |
%AUTO-X { #01 .Screen/auto DEO } |
27 | 30 |
%AUTO-Y { #02 .Screen/auto DEO } |
... | ... |
@@ -44,6 +47,7 @@ |
44 | 47 |
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |
45 | 48 |
|80 @Controller &vector $2 &button $1 &key $1 |
46 | 49 |
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |
50 |
+|b0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 ] |
|
47 | 51 |
|
48 | 52 |
( variables ) |
49 | 53 |
|
... | ... |
@@ -126,6 +130,10 @@ RTN |
126 | 130 |
@validate ( -- ) |
127 | 131 |
|
128 | 132 |
;clear JSR2 |
133 |
+ |
|
134 |
+ PAD .Screen/x DEO2 |
|
135 |
+ PAD .Screen/y DEO2 |
|
136 |
+ |
|
129 | 137 |
;get-cmd JSR2 ;commands-func ++ LDA2 JSR2 |
130 | 138 |
;buffer #0080 ;mclr JSR2 |
131 | 139 |
|
... | ... |
@@ -144,79 +152,57 @@ JMP2r |
144 | 152 |
|
145 | 153 |
RTN |
146 | 154 |
|
147 |
-@cmd-ls |
|
148 |
- &name "ls $1 |
|
155 |
+@cmd-ls "ls $1 |
|
149 | 156 |
&docs "list_folder_content $1 |
150 | 157 |
&func |
151 |
- |
|
158 |
+ |
|
152 | 159 |
;path .File/name DEO2 |
153 | 160 |
#8000 .File/length DEO2 |
154 | 161 |
;view .File/read DEO2 |
155 |
- PAD .Screen/x DEO2 |
|
156 |
- PAD .Screen/y DEO2 |
|
162 |
+ |
|
157 | 163 |
;view #01 ;draw-tx JSR2 |
158 | 164 |
|
159 | 165 |
RTN |
160 | 166 |
|
161 |
-@cmd-cp |
|
162 |
- &name "cp $1 |
|
163 |
- &docs "copy_file_to_name $1 |
|
167 |
+@cmd-cp "cp $1 &docs "copy_file_to_name $1 |
|
164 | 168 |
&func |
165 | 169 |
|
166 | 170 |
RTN |
167 | 171 |
|
168 |
-@cmd-mv |
|
169 |
- &name "mv $1 |
|
170 |
- &docs "move_file_to_name $1 |
|
172 |
+@cmd-mv "mv $1 &docs "move_file_to_name $1 |
|
171 | 173 |
&func |
172 | 174 |
|
173 | 175 |
RTN |
174 | 176 |
|
175 |
-@cmd-rm |
|
176 |
- &name "rm $1 |
|
177 |
- &docs "remove_file $1 |
|
177 |
+@cmd-rm "rm $1 &docs "remove_file $1 |
|
178 | 178 |
&func |
179 | 179 |
|
180 | 180 |
RTN |
181 | 181 |
|
182 |
-@cmd-tx |
|
183 |
- &name "tx $1 ( print file text ) |
|
184 |
- &docs "display_file_as_text $1 |
|
182 |
+@cmd-tx "tx $1 &docs "display_file_as_text $1 |
|
185 | 183 |
&func |
186 | 184 |
|
187 | 185 |
;buffer #0003 ++ .File/name DEO2 |
188 | 186 |
#8000 .File/length DEO2 |
189 | 187 |
;view .File/read DEO2 |
190 | 188 |
|
191 |
- PAD .Screen/x DEO2 |
|
192 |
- PAD .Screen/y DEO2 |
|
193 |
- |
|
194 |
- .File/success DEI2 #0000 >> ,&continue JCN |
|
195 |
- ;&error-txt #02 ;draw-str JSR2 |
|
196 |
- RTN |
|
197 |
- &continue |
|
189 |
+ .File/success DEI2 #0000 >> ,&valid JCN |
|
190 |
+ ;&error-txt #02 ;draw-str JSR2 RTN &valid |
|
198 | 191 |
|
199 | 192 |
;view #01 ;draw-tx JSR2 |
200 | 193 |
|
201 | 194 |
RTN |
202 | 195 |
&error-txt "unknown_file $1 |
203 | 196 |
|
204 |
-@cmd-hx |
|
205 |
- &name "hx $1 ( print file hex ) |
|
206 |
- &docs "display_file_as_hex $1 |
|
197 |
+@cmd-hx "hx $1 &docs "display_file_as_hex $1 |
|
207 | 198 |
&func |
208 | 199 |
|
209 | 200 |
;buffer #0003 ++ .File/name DEO2 |
210 | 201 |
#8000 .File/length DEO2 |
211 | 202 |
;view .File/read DEO2 |
212 | 203 |
|
213 |
- PAD .Screen/x DEO2 |
|
214 |
- PAD .Screen/y DEO2 |
|
215 |
- |
|
216 |
- .File/success DEI2 #0000 >> ,&continue JCN |
|
217 |
- ;&error-txt #02 ;draw-str JSR2 |
|
218 |
- RTN |
|
219 |
- &continue |
|
204 |
+ .File/success DEI2 #0000 >> ,&valid JCN |
|
205 |
+ ;&error-txt #02 ;draw-str JSR2 RTN &valid |
|
220 | 206 |
|
221 | 207 |
AUTO-YADDR |
222 | 208 |
.Screen/x DEI2 ,&anchor STR2 |
... | ... |
@@ -232,9 +218,7 @@ RTN |
232 | 218 |
RTN |
233 | 219 |
&error-txt "unknown_file $1 |
234 | 220 |
|
235 |
-@cmd-do |
|
236 |
- &name "do $1 ( print file hex ) |
|
237 |
- &docs "run_file_as_rom $1 |
|
221 |
+@cmd-do "do $1 &docs "run_file_as_rom $1 |
|
238 | 222 |
&func |
239 | 223 |
|
240 | 224 |
( release inputs ) |
... | ... |
@@ -253,20 +237,34 @@ RTN |
253 | 237 |
RTN |
254 | 238 |
&invalid-txt "invalid_rom: $1 |
255 | 239 |
|
256 |
-@cmd-?? |
|
257 |
- &name "-- $1 |
|
258 |
- &docs "display_commands $1 |
|
240 |
+@cmd-tm "tm $1 &docs "display_time $1 |
|
259 | 241 |
&func |
260 |
- #aa DEBUG |
|
261 |
- PAD .Screen/x DEO2 |
|
262 |
- PAD .Screen/y DEO2 |
|
242 |
+ |
|
243 |
+ #00 .DateTime/month DEI 4* ;month-txt ++ #01 ;draw-str JSR2 |
|
244 |
+ #20 #01 ;draw-char JSR2 |
|
245 |
+ .DateTime/day DEI #01 ;draw-dec JSR2 |
|
246 |
+ #20 #01 ;draw-char JSR2 |
|
247 |
+ #00 .DateTime/dotw DEI 4* ;week-txt ++ #01 ;draw-str JSR2 |
|
248 |
+ #20 #01 ;draw-char JSR2 |
|
249 |
+ .DateTime/hour DEI #01 ;draw-dec JSR2 |
|
250 |
+ LIT ': #01 ;draw-char JSR2 |
|
251 |
+ .DateTime/minute DEI #01 ;draw-dec JSR2 |
|
252 |
+ LIT ': #01 ;draw-char JSR2 |
|
253 |
+ .DateTime/second DEI #01 ;draw-dec JSR2 |
|
254 |
+ |
|
255 |
+RTN |
|
256 |
+ |
|
257 |
+@cmd-?? "-- $1 &docs "display_commands $1 |
|
258 |
+ &func |
|
259 |
+ |
|
263 | 260 |
;&help-txt #01 ;draw-tx JSR2 |
264 | 261 |
PAD #0010 ++ .Screen/y DEO2 |
262 |
+ |
|
265 | 263 |
;commands/end ;commands |
266 | 264 |
&loop |
267 |
- PAD #0008 ++ .Screen/x DEO2 |
|
268 |
- LDA2k #02 ;draw-str JSR2 |
|
269 |
- PAD #0030 ++ .Screen/x DEO2 |
|
265 |
+ PAD .Screen/x DEO2 |
|
266 |
+ LDA2k #06 ;draw-str JSR2 |
|
267 |
+ PAD #0020 ++ .Screen/x DEO2 |
|
270 | 268 |
DUP2 ;commands -- ;commands-docs ++ LDA2 #01 ;draw-str JSR2 |
271 | 269 |
.Screen/y DEI2k #0010 ++ ROT DEO2 |
272 | 270 |
INC2 INC2 GTH2k ,&loop JCN |
... | ... |
@@ -278,15 +276,15 @@ RTN |
278 | 276 |
|
279 | 277 |
@commands |
280 | 278 |
:cmd-ls :cmd-cp :cmd-mv :cmd-rm |
281 |
- :cmd-hx :cmd-tx :cmd-do |
|
279 |
+ :cmd-hx :cmd-tx :cmd-do :cmd-tm |
|
282 | 280 |
&end :cmd-?? |
283 | 281 |
@commands-docs |
284 | 282 |
:cmd-ls/docs :cmd-cp/docs :cmd-mv/docs :cmd-rm/docs |
285 |
- :cmd-hx/docs :cmd-tx/docs :cmd-do/docs |
|
283 |
+ :cmd-hx/docs :cmd-tx/docs :cmd-do/docs :cmd-tm/docs |
|
286 | 284 |
&end :cmd-??/docs |
287 | 285 |
@commands-func |
288 | 286 |
:cmd-ls/func :cmd-cp/func :cmd-mv/func :cmd-rm/func |
289 |
- :cmd-hx/func :cmd-tx/func :cmd-do/func |
|
287 |
+ :cmd-hx/func :cmd-tx/func :cmd-do/func :cmd-tm/func |
|
290 | 288 |
&end :cmd-??/func |
291 | 289 |
|
292 | 290 |
@draw-input ( color -- ) |
... | ... |
@@ -348,6 +346,14 @@ RTN |
348 | 346 |
|
349 | 347 |
RTN |
350 | 348 |
|
349 |
+@draw-dec ( byte color -- ) |
|
350 |
+ |
|
351 |
+ STH |
|
352 |
+ DUP #0a DIV LIT '0 + STHkr ,draw-char JSR |
|
353 |
+ #0a MOD LIT '0 + STHr ,draw-char JSR |
|
354 |
+ |
|
355 |
+RTN |
|
356 |
+ |
|
351 | 357 |
@draw-str ( str* color -- ) |
352 | 358 |
|
353 | 359 |
AUTO-YADDR |
... | ... |
@@ -464,8 +470,13 @@ JMP2r |
464 | 470 |
~projects/library/check-rom.tal |
465 | 471 |
~projects/library/load-rom.tal |
466 | 472 |
|
467 |
-@strings |
|
468 |
- &you-said "You 20 "said 20 $1 |
|
473 |
+@week-txt |
|
474 |
+ "Sun $1 "Mon $1 "Tue $1 "Wed $1 "Thu $1 "Fri $1 |
|
475 |
+ "Sat $1 |
|
476 |
+ |
|
477 |
+@month-txt |
|
478 |
+ "Jan $1 "Feb $1 "Mar $1 "Apr $1 "May $1 "Jun $1 |
|
479 |
+ "Jul $1 "Aug $1 "Sep $1 "Oct $1 "Nov $1 "Dec $1 |
|
469 | 480 |
|
470 | 481 |
@cursor-icn |
471 | 482 |
aa55 aa55 aa55 aa55 aa55 aa55 aa55 aa55 |