commit 6e08156
Devine Lu Linvega
·
2026-06-23 22:58:42 +0000 UTC
parent ad5af19
Pull M/PC operating system
2 files changed,
+1179,
-2
+1174,
-0
1@@ -0,0 +1,1174 @@
2+( 54K . M/PC )
3+
4+|00 @System/vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1
5+|10 @Console/vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1
6+|20 @Screen/vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
7+|80 @Controller/vector $2 &button $1 &key $1
8+|90 @Mouse/vector $2 &x $2 &y $2 &state $1 &chord $1 &pad $4 &scrolly &scrolly-hb $1 &scrolly-lb $1
9+|a0 @File/vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
10+|b0 @File2/vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
11+|c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1
12+
13+(
14+@|Enums )
15+
16+|0050 @Varvara/version
17+|0200 @dir/buflen
18+|0200 @dict/buflen
19+|0200 @dict/tmpbuflen
20+|0100 @path/buflen
21+|0200 @bios/buflen
22+|0028 @bios/anchor-y
23+|ffd6 @loader/entry
24+
25+|000
26+
27+ @input/buf
28+
29+|100
30+
31+@on-reset ( -> )
32+ ;meta #06 DEO2
33+ theme/<load>
34+ ;input/on-controller .Controller/vector DEO2
35+ ;input/on-console .Console/vector DEO2
36+ ;dict/home-path path/<set>
37+ wallpaper/<draw>
38+ spacer/<draw>
39+ input/<redraw>
40+ bios/<draw-welcome>
41+ BRK
42+
43+@meta 00
44+ ( name ) "M/PC 0a
45+ ( details ) "Monitor/Program 20 "Control 0a
46+ ( author ) "By 20 "Devine 20 "Lu 20 "Linvega 0a
47+ ( date ) "23 20 "Jun 20 "2026 00
48+ ( . ) 03
49+ ( - ) 56 =Varvara/version
50+ ( - ) 83 =appicon
51+ ( - ) a0 =manifest/dat
52+
53+@manifest/dat ( . )
54+ _{ =dict/m_pc
55+ ( ) 40 00 =sel/<prev> =dict/sel-prev
56+ ( ) 80 00 =sel/<next> =dict/sel-next
57+ ( ) 01 00 =sel/<pick> =dict/sel-pick }
58+ _{ =dict/input
59+ ( ) 00 0d =input/<eval> =dict/eval
60+ ( ) 04 0d =input/<eval-partial> =dict/eval-partial
61+ ( ) 00 1b =input/<blank> =dict/clear }
62+ 00
63+
64+(
65+@|Input )
66+
67+@input/on-controller ( -> )
68+ .Controller/button DEI2 DUP2 manifest/scan INC2k ORA ?{
69+ POP2
70+ ( key ) /handle-input
71+ ( button ) POP BRK }
72+ ( * ) JSR2 POP2 BRK
73+
74+@input/on-console ( -> )
75+ .Console/read DEI
76+ ( | mute arg spacers )
77+ [ LIT2 03 -Console/type ] DEI NEQ ?{ POP #20 }
78+ /handle-input BRK
79+
80+@input/handle-input ( c -- )
81+ DUP ?{ POP JMP2r }
82+ DUP #08 EQU ?/on-bs
83+ DUP #0a EQU ?/on-enter
84+ DUP #7f EQU ?/on-del
85+ DUP #20 GTH ?{ POP #20 }
86+ /<push> !/<redraw>
87+
88+ &on-bs ( c -- )
89+ POP /<pop> !/<redraw>
90+
91+ &on-enter ( c -- )
92+ POP ;&buf str/<print>
93+ #0a19 DEO !/<eval>
94+
95+ &on-del ( c -- )
96+ POP !/<blank>
97+
98+@input/<reset> ( -- )
99+ #0000 .&buf STZ2
100+ [ LIT2 -&buf _&ptr ] STR
101+ JMP2r
102+
103+@input/<push-str> ( str* -- )
104+ &>w
105+ LDAk DUP ?{ POP POP2 !/<redraw> }
106+ /<push>
107+ INC2 !/>w
108+
109+@input/<push> ( c -- )
110+ [ LIT2 00 &ptr -&buf ] INCk ,&ptr STR
111+ STZ2
112+ JMP2r
113+
114+@input/<pop> ( -- )
115+ ,&ptr LDR
116+ ( cap ) DUP .&buf NEQ ?{ POP JMP2r }
117+ #01 SUB #00 OVR STZ
118+ ,&ptr STR
119+ JMP2r
120+
121+@input/<eval> ( -- )
122+ ;&buf LDAk ?{ POP2 /<reset> !bios/<draw-welcome> }
123+ bios/<parse>
124+ /<reset> !/<redraw>
125+
126+@input/<eval-partial> ( -- )
127+ ;&buf LDAk ?{ POP2 /<reset> !bios/<draw-welcome> }
128+ bios/<parse-partial>
129+ /<reset> !/<redraw>
130+
131+@input/<blank> ( -- )
132+ sel/<reset>
133+ /<reset>
134+ bios/<draw>
135+ ( >> )
136+
137+@input/<redraw> ( -- )
138+ #0008 .Screen/x DEO2
139+ #0018 .Screen/y DEO2
140+ [ LIT2 e0 -Screen/pixel ] DEO
141+ #0008 .Screen/y DEO2
142+ path/<draw>
143+ ;&buf font/<draw-str>
144+ .&buf LDZ ?{ ;&full !font/<draw-sprite> }
145+ ;&hash !font/<draw-sprite>
146+
147+@input/hash [ 4020 4020 4020 4020 4020 4020 4020 4020 ]
148+ &full [ 6060 6060 6060 6060 6060 6060 6060 6060 ]
149+
150+@spacer/<draw> ( -- )
151+ #0000 .Screen/x DEO2
152+ #0018 .Screen/y DEO2
153+ ;&wave .Screen/addr DEO2
154+ [ LIT2 01 -Screen/auto ] DEO
155+ .Screen/width DEI2 #03 SFT2 SUB [ LIT2r 41 -Screen/sprite ]
156+ &>l
157+ DEOkr
158+ INC DUP ?/>l
159+ POP POP2r JMP2r
160+
161+(
162+@|Bios )
163+
164+@bios/<draw-welcome> ( -- )
165+ #0008 .Screen/x DEO2
166+ ;&anchor-y .Screen/y DEO2
167+ [ LIT2 c0 -Screen/pixel ] DEO
168+ ;&anchor-y .Screen/y DEO2
169+ ;dict/info font/<draw-str>
170+ ( | logo )
171+ [ LIT2 66 -Screen/auto ] DEO
172+ ;&logo .Screen/addr DEO2
173+ [ LIT2 45 -Screen/sprite ] DEOk DEO
174+ JMP2r
175+
176+@bios/get-symbol ( id -- sym* )
177+ #00 SWP DUP ADD ;&buf ADD2 LDA2 JMP2r
178+
179+@bios/get-depth ( -- depth )
180+ ,&ptr LDR2 ;&buf SUB2 #01 SFT2 NIP JMP2r
181+
182+@bios/<parse> ( str* -- )
183+ /<reset>
184+ dict/<reset>
185+ ( >> )
186+
187+@bios/<parse-partial> ( str* -- )
188+ sel/<reset>
189+ str/walk-ws
190+ &>w
191+ dict/alloc /<push>
192+ str/walk-ws LDAk ?/>w
193+ POP2 !/<draw>
194+
195+@bios/<reset> ( -- )
196+ ;&buf ,&ptr STR2
197+ JMP2r
198+
199+@bios/<run> ( str* cmd* -- )
200+ NIP2
201+ ( get cmd ) LDA2
202+ ( get eval ) INC2 INC2 LDA2
203+ ( apply ) JMP2
204+
205+@bios/<push-bool> ( bool -- )
206+ ?{ ;dict/f !/<push> }
207+ ;dict/t
208+ ( >> )
209+
210+@bios/<push> ( str* -- )
211+ DUP2 cmds/find INC2k ORA ?/<run>
212+ POP2
213+ ( >> )
214+
215+@bios/<push-raw> ( str* -- )
216+ ( | put on stack )
217+ [ LIT2 &ptr =&buf ] INC2k INC2 ,&ptr STR2
218+ STA2
219+ JMP2r
220+
221+@bios/pop ( -- addr* )
222+ ,&ptr LDR2 #0002 SUB2 LDA2k SWP2 ,&ptr STR2
223+ JMP2r
224+
225+@bios/<push-err-un1> ( -- )
226+ ;dict/err-un !/<push>
227+
228+@bios/<push-err-un2> ( -- )
229+ ;dict/err-un !/<push>
230+
231+@bios/<push-err-404> ( -- )
232+ ;dict/err-404 !/<push>
233+
234+@bios/<push-err-bin> ( -- )
235+ ;dict/err-bin !/<push>
236+
237+@bios/<draw> ( -- )
238+ #0008 .Screen/x DEO2
239+ ;&anchor-y .Screen/y DEO2
240+ [ LIT2 c0 -Screen/pixel ] DEO
241+ ;&anchor-y .Screen/y DEO2
242+ ,&ptr LDR2 ;&buf [ LITr 00 ]
243+ &>l
244+ NEQ2k ?{ POP2 POP2 POPr JMP2r }
245+ LDA2k
246+ ( | wrap )
247+ DUP2 font/get-width .Screen/x DEI2 ADD2 .Screen/width DEI2 LTH2 ?{
248+ ( ) font/<draw-lb> }
249+ STHkr /<draw-symbol>
250+ #2045 font/<draw-glyph-color>
251+ INCr INC2 INC2 !/>l
252+
253+@bios/<draw-symbol> ( symbol* id -- )
254+ sel/is-unselected #44 ADD !font/<draw-str-color>
255+
256+(
257+@|Path )
258+
259+@path/is-folder ( -- t )
260+ ,&ptr LDR2 #0001 SUB2 LDA LIT "/ EQU JMP2r
261+
262+@path/<move> ( str* -- )
263+ DUP2 ;dict/out-path str/cmp ?/<pop>
264+ ( | Check if file is a folder )
265+ LITr _&ptr LDR2r /<push-str>
266+ ;&buf file/is-folder ?{
267+ #00 STH2kr STA
268+ LITr _&ptr STR2r
269+ JMP2r }
270+ POP2r
271+ ( | Add missing slash )
272+ /is-folder ?{ LIT "/ /<push> }
273+ JMP2r
274+
275+@path/<pop> ( str* -- )
276+ POP2
277+ ( | find last slash )
278+ ;&buf ,&ptr LDR2 #0001 SUB2
279+ ( clamp ) DUP2 ;&buf INC2 NEQ2 ?{ POP2 POP2 JMP2r }
280+ &>lp
281+ #0001 SUB2 LDAk LIT "/ EQU ?{ LTH2k ?/>lp }
282+ INC2 #0000 SWP2 STA2
283+ POP2 JMP2r
284+
285+@path/<set> ( str* -- )
286+ ;&buf ,&ptr STR2
287+ ( >> )
288+
289+@path/<push-str> ( str* -- )
290+ &>w
291+ LDAk DUP ?{ POP POP2 JMP2r }
292+ /<push>
293+ INC2 !/>w
294+
295+@path/<push> ( str* -- )
296+ #00 [ LIT2 &ptr =&buf ] INC2k ,&ptr STR2
297+ STA2
298+ JMP2r
299+
300+@path/<draw> ( -- )
301+ ;&buf !font/<draw-str>
302+
303+@path/make ( str* -- path* )
304+ ;&buf !dict/alloc-cat
305+
306+(
307+@|Selection )
308+
309+@sel/is-unselected ( id -- bool )
310+ [ LIT &id $1 ] NEQ JMP2r
311+
312+@sel/<prev> ( -- )
313+ ,&id LDR
314+ ( clamp ) INCk ?{ POP JMP2r }
315+ #01 SUB !/<set>
316+
317+@sel/<next> ( -- )
318+ ,&id LDR INC
319+ ( clamp ) DUP bios/get-depth LTH ?/<set>
320+ POP JMP2r
321+
322+@sel/<set> ( -- )
323+ ,&id STR !bios/<draw>
324+
325+@sel/<pick> ( -- )
326+ ,&id LDR INCk ?{ POP JMP2r }
327+ bios/get-symbol input/<push-str>
328+ #20 input/<push> !input/<redraw>
329+
330+@sel/<reset> ( -- )
331+ [ LIT2 ff _&id ] STR
332+ JMP2r
333+
334+(
335+@|Commands )
336+
337+@cmds/find ( str* -- <cmd>* )
338+ ,&fn STR2
339+ ;&lutend ;&lut
340+ &>l
341+ LDA2k LDA2 [ LIT2 &fn $2 ] str/cmp ?{
342+ INC2 INC2 GTH2k ?/>l
343+ POP2 #ffff }
344+ NIP2 JMP2r
345+
346+@cmds/lut [ =cmd/api ]
347+ &lut-clip [
348+ =dir/api =mov/api =now/api =run/api
349+ =icn/api =len/api =put/api =get/api
350+ =cpy/api =era/api =ren/api =pop/api
351+ =dup/api =ovr/api =swp/api =dec/api
352+ =hex/api =cat/api =cmp/api =and/api
353+ =ora/api =out/api =bye/api &lutend ]
354+
355+@cmd/<eval> ( -- )
356+ ;cmds/lutend ;cmds/lut-clip
357+ &>l
358+ LDA2k #0004 ADD2 bios/<push-raw>
359+ INC2 INC2 GTH2k ?/>l
360+ POP2 POP2 JMP2r
361+ &api =dict/cmd =&<eval> "<cmd> 20 "( 20 09 20 ") 00
362+
363+@dir/<eval> ( -- )
364+ ;path/buf .File/name DEO2
365+ ;&buflen .File/length DEO2
366+ ;&buf .File/read DEO2
367+ ;&buf DUP2 .File/success DEI2 ADD2 SWP2
368+ &>l
369+ LDAk ?{ POP2 POP2 JMP2r }
370+ #0005 ADD2 dict/alloc-line bios/<push-raw>
371+ INC2 !/>l
372+ &api =dict/dir =&<eval> "<dir> 20 "( 20 09 20 "[f] 20 ") 00
373+
374+@mov/<eval> ( -- )
375+ bios/get-depth ?{ !bios/<push-err-un1> }
376+ bios/pop path/<move> !dir/<eval>
377+ &api =dict/mov =&<eval> "<mov> 20 "( 20 "path 20 09 20 "[f] 20 ") 00
378+
379+@now/<eval> ( -- )
380+ date/make bios/<push>
381+ time/make !bios/<push>
382+ &api =dict/now =&<eval> "<now> 20 "( 20 09 20 "date 20 "time 20 ") 00
383+
384+@run/<eval> ( -- )
385+ bios/get-depth ?{ !bios/<push-err-un1> }
386+ bios/pop path/make
387+ ( ? ) DUP2 file/exists ?loader/<run>
388+ POP2 !bios/<push-err-404>
389+ &api =dict/run =&<eval> "<run> 20 "( 20 "f.rom 20 09 20 "ok 20 ") 00
390+
391+@icn/<eval> ( -- )
392+ bios/get-depth ?{ !bios/<push-err-un1> }
393+ bios/pop path/make
394+ ( ? ) DUP2 file/exists ?{ POP2 !bios/<push-err-404> }
395+ ;dict/ok bios/<push>
396+ ( >> )
397+
398+@icn/<draw> ( name* -- )
399+ DUP2 .File/name DEO2
400+ ( | depth )
401+ #0008 .File/length DEO2
402+ [ LIT2r 03 -Screen/sprite ]
403+ ( | size )
404+ /read-size
405+ ( h ) #00 SWP SUB ,&height STR
406+ ( w ) #00 SWP SUB ,&width STR
407+ ;&buf .Screen/addr DEO2
408+ #0000 DUP2 .Screen/x DEO2
409+ .Screen/y DEO2
410+ ( | draw )
411+ [ LIT2 01 -Screen/auto ] DEO
412+ [ LIT &height $1 ]
413+ &>v
414+ #0000 .Screen/x DEO2
415+ [ LIT &width $1 ]
416+ &>h
417+ ;&buf .File/read DEO2
418+ [ LIT2 00 -File/success-lb ] DEI EQU ?{ DEOkr
419+ INC DUP ?/>h }
420+ POP
421+ ( lb ) .Screen/y DEI2 #0008 ADD2 .Screen/y DEO2
422+ INC DUP ?/>v
423+ POP POP2r JMP2r
424+
425+@icn/read-size ( str* -- w h )
426+ str/cap #0009 SUB2
427+ ( no size ) INC2k INC2 LDA [ LIT "x ] EQU ?{ POP2 #1010 JMP2r }
428+ LDA2k /read-byte STH
429+ #0003 ADD2 LDA2 /read-byte STHr SWP JMP2r
430+
431+@icn/read-byte ( a b -- byte )
432+ chr/hex SWP chr/hex #40 SFT ORA JMP2r
433+ &api =dict/icn =&<eval> "<icn> 20 "( 20 "f.icn 20 09 20 "ok 20 ") 00
434+
435+@put/<eval> ( -- )
436+ bios/get-depth #02 LTH ?bios/<push-err-un2>
437+ bios/pop path/make .File/name DEO2
438+ bios/pop DUP2 str/len .File/length DEO2
439+ .File/write DEO2
440+ ;dict/ok !bios/<push>
441+ &api =dict/put =&<eval> "<put> 20 "( 20 "body 20 "f 20 09 20 "ok 20 ") 00
442+
443+@get/<eval> ( -- )
444+ bios/get-depth ?{ !bios/<push-err-un1> }
445+ bios/pop path/make
446+ ( ? ) DUP2 file/exists ?{ POP2 !bios/<push-err-404> }
447+ ( ? ) DUP2 file/is-text ?{ POP2 !bios/<push-err-bin> }
448+ dict/alloc-file !bios/<push>
449+ &api =dict/get =&<eval> "<get> 20 "( 20 "f 20 09 20 "body 20 ") 00
450+
451+@cpy/<eval> ( -- )
452+ bios/get-depth #02 LTH ?bios/<push-err-un2>
453+ ( dst ) bios/pop path/make
454+ ( src ) bios/pop path/make
455+ ( ? ) DUP2 file/exists ?{ POP2 POP2 !bios/<push-err-404> }
456+ SWP2 file/<cpy>
457+ ;dict/ok !bios/<push>
458+ &api =dict/cpy =&<eval> "<cpy> 20 "( 20 "fsrc 20 "fdst 20 09 20 "ok 20 ") 00
459+
460+@era/<eval> ( -- )
461+ bios/get-depth ?{ !bios/<push-err-un1> }
462+ bios/pop path/make
463+ ( ? ) DUP2 file/exists ?{ POP2 !bios/<push-err-404> }
464+ .File/name DEO2
465+ [ LIT2 01 -File/delete ] DEO
466+ ;dict/ok !bios/<push>
467+ &api =dict/era =&<eval> "<era> 20 "( 20 "f 20 09 20 "ok 20 ") 00
468+
469+@ren/<eval> ( -- )
470+ bios/get-depth #02 LTH ?bios/<push-err-un2>
471+ ( dst ) bios/pop path/make
472+ ( src ) bios/pop path/make
473+ ( ? ) DUP2 file/exists ?{ POP2 POP2 !bios/<push-err-404> }
474+ DUP2 ROT2 file/<cpy>
475+ .File/name DEO2
476+ [ LIT2 01 -File/delete ] DEO
477+ ;dict/ok !bios/<push>
478+ &api =dict/ren =&<eval> "<ren> 20 "( 20 "fsrc 20 "fdst 20 09 20 "ok 20 ") 00
479+
480+@len/<eval> ( -- )
481+ bios/get-depth ?{ !bios/<push-err-un1> }
482+ bios/pop path/make
483+ ( ? ) DUP2 file/exists ?{ POP2 ;dict/zero !bios/<push> }
484+ .File/name DEO2
485+ #0004 .File/length DEO2
486+ ;&buf .File/stat DEO2
487+ ;&buf dict/alloc NIP2 !bios/<push>
488+ &buf $5 &api =dict/len =&<eval> "<len> 20 "( 20 "f 20 09 20 "hex 20 ") 00
489+
490+@dup/<eval> ( -- )
491+ bios/get-depth ?{ !bios/<push-err-un1> }
492+ bios/pop DUP2 bios/<push> !bios/<push>
493+ &api =dict/dup =&<eval> "<dup> 20 "( 20 "a 20 09 20 "a 20 "a 20 ") 00
494+
495+@ovr/<eval> ( -- )
496+ bios/get-depth ?{ !bios/<push-err-un1> }
497+ ( b ) bios/pop
498+ ( a ) bios/pop DUP2 bios/<push>
499+ SWP2 bios/<push> !bios/<push>
500+ &api =dict/ovr =&<eval> "<ovr> 20 "( 20 "a 20 "b 20 09 20 "a 20 "b 20 "a 20 ") 00
501+
502+@pop/<eval> ( -- )
503+ bios/get-depth ?{ !bios/<push-err-un1> }
504+ bios/pop POP2 JMP2r
505+ &api =dict/pop =&<eval> "<pop> 20 "( 20 "a 20 09 20 ") 00
506+
507+@swp/<eval> ( -- )
508+ bios/get-depth #02 LTH ?bios/<push-err-un2>
509+ bios/pop bios/pop SWP2 bios/<push> !bios/<push>
510+ &api =dict/swp =&<eval> "<swp> 20 "( 20 "a 20 "b 20 09 20 "b 20 "a 20 ") 00
511+
512+@cat/<eval> ( -- )
513+ bios/get-depth #02 LTH ?bios/<push-err-un2>
514+ bios/pop bios/pop dict/alloc-cat !bios/<push-raw>
515+ &api =dict/cat =&<eval> "<cat> 20 "( 20 "a 20 "b 20 09 20 "ab 20 ") 00
516+
517+@cmp/<eval> ( -- )
518+ bios/get-depth #02 LTH ?bios/<push-err-un2>
519+ bios/pop bios/pop str/cmp !bios/<push-bool>
520+ &api =dict/cmp =&<eval> "<cmp> 20 "( 20 "a 20 "b 20 09 20 "bool 20 ") 00
521+
522+@and/<eval> ( -- )
523+ bios/get-depth #02 LTH ?bios/<push-err-un2>
524+ ( a ) bios/pop ;dict/t str/cmp
525+ ( b ) bios/pop ;dict/t str/cmp AND !bios/<push-bool>
526+ &api =dict/and =&<eval> "<and> 20 "( 20 "a 20 "b 20 09 20 "bool 20 ") 00
527+
528+@ora/<eval> ( -- )
529+ bios/get-depth #02 LTH ?bios/<push-err-un2>
530+ ( a ) bios/pop ;dict/t str/cmp
531+ ( b ) bios/pop ;dict/t str/cmp ORA !bios/<push-bool>
532+ &api =dict/ora =&<eval> "<ora> 20 "( 20 "a 20 "b 20 09 20 "bool 20 ") 00
533+
534+@dec/<eval> ( -- )
535+ bios/get-depth ?{ !bios/<push-err-un1> }
536+ ;&buf ,&ptr STR2
537+ bios/pop str/hex
538+ ( | dec str )
539+ #2710 [ LIT2r 00fb ]
540+ &>wpd
541+ DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{ DUP /<push-digit>
542+ INCr }
543+ POP2 #000a DIV2 SWPr INCr STHkr ?/>wpd
544+ POP2r POP2 POP2 ;&buf !bios/<push>
545+
546+@dec/<push-digit> ( d -- )
547+ LIT "0 ADD #00 [ LIT2 &ptr =&buf ] INC2k ,&ptr STR2
548+ STA2
549+ JMP2r
550+ &buf $6 &api =dict/dec =&<eval> "<dec> 20 "( 20 "hex 20 09 20 "dec 20 ") 00
551+
552+@hex/<eval> ( -- )
553+ bios/get-depth ?{ !bios/<push-err-un1> }
554+ ;&buf ,&ptr STR2
555+ bios/pop str/dec /<push-short>
556+ ;&buf str/walk-zero !bios/<push>
557+
558+@hex/<push-short> ( short* -- )
559+ SWP /<push-byte>
560+ ( >> )
561+
562+@hex/<push-byte> ( byte -- )
563+ DUP #04 SFT /<push-nibble>
564+ ( >> )
565+ &<push-nibble> ( byte -- )
566+ /chr #00 [ LIT2 &ptr =&buf ] INC2k ,&ptr STR2
567+ STA2
568+ JMP2r
569+ &buf $6 &api =dict/hex =&<eval> "<hex> 20 "( 20 "dec 20 09 20 "hex 20 ") 00
570+
571+@hex/chr2 ( byte -- hn ln )
572+ DUP #04 SFT /chr SWP
573+ ( >> )
574+
575+@hex/chr ( hex -- char )
576+ #0f AND DUP #09 GTH #27 MUL ADD LIT "0 ADD JMP2r
577+
578+@out/<eval> ( -- )
579+ bios/get-depth ?{ !bios/<push-err-un1> }
580+ bios/pop !str/<print>
581+ &api =dict/out =&<eval> "<out> 20 "( 20 "a 20 09 20 ") 00
582+
583+@bye/<eval> ( -- )
584+ #800f DEO
585+ JMP2r
586+ &api =dict/bye =&<eval> "<bye> 20 "( 20 09 20 ") 00
587+
588+(
589+@|Dict )
590+
591+@dict/alloc-cat ( a* b* -- addr* )
592+ [ LIT2r =&ptr ] LDA2r
593+ &>wc1
594+ LDAk DUP ?{
595+ POP POP2
596+ &>wc2
597+ LDAk DUP ?{
598+ POP POP2 STH2r #00 !/<push> }
599+ /<push>
600+ INC2 !/>wc2 }
601+ /<push>
602+ INC2 !/>wc1
603+
604+@dict/alloc ( str* -- str* addr* )
605+ LDAk LIT "" EQU ?/alloc-string
606+ [ LITr _&ptr ] LDR2r
607+ &>w
608+ LDAk DUP #20 GTH ?{ POP STH2r #00 !/<push> }
609+ /<push>
610+ INC2 !/>w
611+
612+@dict/alloc-string ( str* -- str* addr* )
613+ INC2 [ LITr _&ptr ] LDR2r
614+ &>was
615+ LDAk DUP ?{ &end POP INC2 STH2r #00 !/<push> }
616+ DUP LIT "" EQU ?/end
617+ /<push>
618+ INC2 !/>was
619+
620+@dict/alloc-line ( str* -- str* addr* )
621+ [ LITr _&ptr ] LDR2r
622+ &>wal
623+ LDAk DUP #1f GTH ?{ POP STH2r #00 !/<push> }
624+ /<push>
625+ INC2 !/>wal
626+
627+@dict/<push> ( c -- )
628+ [ LIT2 &ptr =&buf ] INC2k ,&ptr STR2
629+ STA
630+ JMP2r
631+
632+@dict/<reset> ( -- )
633+ ;&buf ,&ptr STR2
634+ JMP2r
635+
636+@dict/alloc-file ( name* -- addr* )
637+ .File/name DEO2
638+ ;&tmpbuflen .File/length DEO2
639+ ;&tmpbuf DUP2 .File/read DEO2
640+ [ LITr _&ptr ] LDR2r
641+ &>waf
642+ LDAk DUP ?{
643+ POP POP2 STH2r #00 !/<push> }
644+ /<push>
645+ INC2 !/>waf
646+
647+(
648+@|Font )
649+
650+@font/<draw-str-color> ( str* color -- )
651+ ,&color STR
652+ ( >> )
653+
654+@font/<draw-str> ( str* -- )
655+ [ LIT2 15 -Screen/auto ] DEO
656+ &>w
657+ LDAk DUP ?{ POP POP2 JMP2r }
658+ DUP LIT "< NEQ ?{ POP !kbd/<draw-str> }
659+ /<draw-glyph>
660+ INC2 !/>w
661+
662+@font/<draw-glyph-color> ( c color -- )
663+ ,&color STR
664+ ( >> )
665+
666+@font/<draw-glyph> ( c -- )
667+ DUP #0a NEQ ?{ POP !/<draw-lb> }
668+ DUP #09 NEQ ?{ POP !/<draw-tab> }
669+ #00 SWP #20 SUB #40 SFT2 ;&glyphs ADD2
670+ ( >> )
671+
672+@font/<draw-sprite> ( addr* -- )
673+ .Screen/addr DEO2
674+ [ LIT2 &color 45 -Screen/sprite ] DEO
675+ JMP2r
676+
677+@font/<draw-lb> ( -- )
678+ #0008 .Screen/x DEO2
679+ .Screen/y DEI2 #0010 ADD2 .Screen/y DEO2
680+ JMP2r
681+
682+@font/<draw-tab> ( -- )
683+ ;&tab !/<draw-sprite>
684+
685+@font/get-width ( str* -- width* )
686+ [ LIT2r 0000 ]
687+ &>wgw
688+ LDAk ?{ POP2 STH2r JMP2r }
689+ LIT2r 0008 ADD2r INC2 !/>wgw
690+
691+@kbd/<draw-str> ( str* -- )
692+ INC2 [ LIT2 15 -Screen/auto ] DEO
693+ ;&a font/<draw-sprite>
694+ &>w
695+ LDAk DUP ?{ POP POP2 JMP2r }
696+ DUP LIT "> NEQ ?{
697+ POP [ LIT2 15 -Screen/auto ] DEO
698+ ;&c font/<draw-sprite>
699+ INC2 !font/<draw-str> }
700+ /<draw-glyph>
701+ INC2 !/>w
702+
703+@kbd/<draw-glyph> ( c -- )
704+ [ LIT2 05 -Screen/auto ] DEO
705+ [ LITr -Screen/x ] DEI2r .Screen/y DEI2 STH2k #0004 ADD2 .Screen/y DEO2
706+ #00 SWP #20 SUB #30 SFT2 ;&glyphs ADD2 font/<draw-sprite>
707+ [ LITr -Screen/y ] DEO2r
708+ [ LITr -Screen/x ] DEO2r
709+ [ LIT2 15 -Screen/auto ] DEO
710+ ;&b !font/<draw-sprite>
711+
712+(
713+@|Wallpaper )
714+
715+@wallpaper/<draw> ( -- )
716+ .Screen/width DEI2 #03 SFT2 hex/chr2 ,&w STR2
717+ POP .Screen/height DEI2 #03 SFT2 hex/chr2 ,&h STR2
718+ POP ;&path !icn/<draw>
719+
720+ &path "wallpaper [ &w "00 "x &h "00 ] ".icn 00
721+
722+(
723+@|Loader )
724+
725+@loader/<run> ( path* -- )
726+ ,&path STR2
727+ ;&on-frame .Screen/vector DEO2
728+ JMP2r
729+
730+@loader/on-frame ( -> )
731+ #0000 DUP2 .Screen/vector DEO2
732+ DUP2 .Screen/x DEO2
733+ .Screen/y DEO2
734+ [ LIT2 80 -Screen/pixel ] DEO
735+ [ LIT2 c0 -Screen/pixel ] DEO
736+ [ LIT2 &path $2 ] .File/name DEO2
737+ #fe00 .File/length DEO2
738+ ;&mmu .System/expansion DEO2 !/entry
739+
740+ &mmu [ 01 0029 0000 =loader/rom 0000 =&entry ]
741+
742+(
743+@|Stdlib )
744+
745+@manifest/scan ( but key -- fn* )
746+ ORAk ?{ POP2 #ffff JMP2r }
747+ ,&bk STR2
748+ ;&dat
749+ &>cat
750+ DUP2 LDAk #00 SWP INC ADD2 SWP2 #0003 ADD2
751+ &>opt
752+ LDA2k [ LIT2 &bk $2 ] NEQ2 ?{
753+ NIP2 INC2 INC2 LDA2 JMP2r }
754+ #0006 ADD2 GTH2k ?/>opt
755+ POP2 INC2 LDAk ?/>cat
756+ POP2 #ffff JMP2r
757+
758+@file/is-folder ( path* -- t )
759+ .File/name DEO2
760+ #0001 .File/length DEO2
761+ ;&bf .File/stat DEO2
762+ [ LIT2 "- &bf $1 ] EQU JMP2r
763+
764+@file/is-text ( path* -- t )
765+ .File/name DEO2
766+ #0001 .File/length DEO2
767+ &>st
768+ ;&b .File/read DEO2
769+ ( | tests )
770+ .File/success-lb DEI ?{ #01 JMP2r }
771+ [ LIT &b $1 ] chr/is-ascii ?/>st
772+ #00 JMP2r
773+
774+@file/exists ( path* -- t )
775+ .File/name DEO2
776+ #0001 .File/length DEO2
777+ ;&b .File/read DEO2
778+ .File/success-lb DEI JMP2r
779+
780+@file/<cpy> ( src* dst* -- )
781+ .File2/name DEO2
782+ #0001 .File2/length DEO2
783+ .File/name DEO2
784+ #0001 .File/length DEO2
785+ &>s
786+ ;&b .File/read DEO2
787+ .File/success-lb DEI ?{ JMP2r }
788+ ;&b .File2/write DEO2 !/>s
789+
790+@chr/hex ( c -- val )
791+ ( dec ) [ LIT "0 ] SUB DUP #09 GTH [ JMP JMP2r ]
792+ ( hex ) #27 SUB DUP #0a SUB #05 GTH [ JMP JMP2r ]
793+ ( nil ) POP #ff JMP2r
794+
795+@chr/is-ascii ( c -- t )
796+ DUP #08 GTH SWP #7f LTH AND JMP2r
797+
798+@str/<print> ( str* -- )
799+ LDAk DUP ?{ POP POP2 JMP2r }
800+ #18 DEO
801+ INC2 !/<print>
802+
803+@str/cap ( str* -- end* )
804+ LDAk ?{ JMP2r }
805+ INC2 !/cap
806+
807+@str/len ( str* -- len* )
808+ STH2k /cap STH2r SUB2 JMP2r
809+
810+@str/cmp ( a* b* -- f )
811+ STH2
812+ &>wc
813+ LDAk ?{ &d LDA LDAr STHr EQU JMP2r }
814+ LDAk LDAkr STHr NEQ ?/d
815+ INC2 INC2r !/>wc
816+
817+@str/hex ( str* -- value* )
818+ [ LIT2r 0000 ]
819+ &>wh
820+ [ LITr 40 ] SFT2r LDAk chr/hex [ LITr 00 ] STH
821+ ADD2r INC2 LDAk ?/>wh
822+ POP2 STH2r JMP2r
823+
824+@str/dec ( str* -- val* )
825+ [ LIT2r 0000 ] !{
826+
827+ &>ldec
828+ [ LITr 00 ] STH
829+ MUL2r [ LITr 00 ] STH
830+ ADD2r INC2 }
831+ ( str* . val* ) LDAk [ LIT "0 ] SUB #0a LTHk ?/>ldec
832+ POP2 POP2 STH2r JMP2r
833+
834+@str/walk-ws ( str* -- str* )
835+ &>ww
836+ LDAk ?{ JMP2r }
837+ LDAk #20 GTH ?{ INC2 LDAk ?/>ww }
838+ JMP2r
839+
840+@str/walk-zero ( str* -- str* )
841+ &>wz
842+ LDAk ?{ JMP2r }
843+ LDAk LIT "0 NEQ ?{ INC2 LDAk ?/>wz }
844+ JMP2r
845+
846+@date/make ( -- str* )
847+ ;&buf DUP2 ,&ptr STR2
848+ ( | Make string )
849+ [ LIT2 00 -DateTime/dotw ] DEI #20 SFT ;dict/days ADD2 /<push-str>
850+ [ LIT ", ] /<push>
851+ #20 /<push>
852+ [ LIT2 00 -DateTime/day ] DEI /<push-dec2>
853+ #20 /<push>
854+ [ LIT2 00 -DateTime/month ] DEI #20 SFT ;dict/months ADD2 /<push-str>
855+ #20 /<push>
856+ .DateTime/year DEI2 !/<push-dec2>
857+
858+@date/<push-dec2> ( short* -- )
859+ #2710 [ LIT2r 00fb ]
860+ &>wpd
861+ DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{ DUP /<push-digit>
862+ INCr }
863+ POP2 #000a DIV2 SWPr INCr STHkr ?/>wpd
864+ POP2r POP2 POP2 JMP2r
865+
866+@date/<push-digit> ( d -- )
867+ LIT "0 ADD
868+ ( >> )
869+
870+@date/<push> ( c -- )
871+ #00 [ LIT2 &ptr =&buf ] INC2k ,&ptr STR2
872+ STA2
873+ JMP2r
874+
875+@date/<push-str> ( str* -- )
876+ &>w
877+ LDAk DUP ?{ POP POP2 JMP2r }
878+ /<push>
879+ INC2 !/>w
880+
881+@time/make ( -- str* )
882+ ;&buf DUP2 ,&ptr STR2
883+ ( | Make string )
884+ .DateTime/hour DEI /<push-dec>
885+ LIT ": /<push>
886+ .DateTime/minute DEI /<push-dec>
887+ LIT ": /<push>
888+ .DateTime/second DEI !/<push-dec>
889+
890+@time/<push-dec> ( u8 -- )
891+ DUP #0a DIV /<push-digit>
892+ #0a DIVk MUL SUB
893+ ( >> )
894+
895+@time/<push-digit> ( d -- )
896+ LIT "0 ADD
897+ ( >> )
898+
899+@time/<push> ( c -- )
900+ #00 [ LIT2 &ptr =&buf ] INC2k ,&ptr STR2
901+ STA2
902+ JMP2r
903+
904+@theme/<reset> ( -- )
905+ #f0a8 #f0ec #f0b9
906+ ( >> )
907+
908+@theme/<set> ( r* g* b* -- )
909+ .System/b DEO2
910+ .System/g DEO2
911+ .System/r DEO2
912+ JMP2r
913+
914+@theme/<load> ( -- )
915+ ;&path .File/name DEO2
916+ #0002 .File/length DEO2
917+ ;&r .File/read DEO2
918+ ;&g .File/read DEO2
919+ ;&b .File/read DEO2
920+ .File/success-lb DEI ?{ !/<reset> }
921+ [ LIT2 &r $2 ] [ LIT2 &g $2 ] [ LIT2 &b $2 ] !/<set>
922+
923+ &path ".theme 00
924+
925+(
926+@|Assets )
927+
928+@dict/m_pc "M/PC 00
929+ &info "M/PC 20 "is 20 "ready. 0a
930+ ( ) "Type 20 "<cmd> 20 "to 20 "see 20 "options. 0a0a 00
931+ &home-path "./ 00
932+ &sel-prev "Selection 20 "Previous 00
933+ &sel-next "Selection 20 "Next 00
934+ &sel-pick "Pick 20 "Selection 00
935+ &clear "Clear 20 "Input 00
936+ &input "Input 00
937+ &eval "Run 00
938+ &eval-partial "Non-Destructive 20 "Run 00
939+ &out-path ".. 00
940+ &dir "dir 00
941+ &mov "mov 00
942+ &run "run 00
943+ &put "put 00
944+ &era "era 00
945+ &ren "ren 00
946+ &get "get 00
947+ &cmd "cmd 00
948+ &len "len 00
949+ &dup "dup 00
950+ &ovr "ovr 00
951+ &swp "swp 00
952+ &pop "pop 00
953+ &now "now 00
954+ &dec "dec 00
955+ &hex "hex 00
956+ &cat "cat 00
957+ &cmp "cmp 00
958+ &and "and 00
959+ &ora "ora 00
960+ &icn "icn 00
961+ &out "out 00
962+ &cpy "cpy 00
963+ &bye "bye 00
964+ &zero "0 00
965+ &t "<true> 00
966+ &f "<false> 00
967+ &ok "<ok> 00
968+ &err-un "<Underflow> 00
969+ &err-404 "<Not 20 "Found> 00
970+ &err-bin "<binary> 00
971+ &months [
972+ "Jan $1 "Feb $1 "Mar $1 "Apr $1
973+ "May $1 "Jun $1 "Jul $1 "Aug $1
974+ "Sep $1 "Oct $1 "Nov $1 "Dec $1 ]
975+ &days [
976+ "Sun $1 "Mon $1 "Tue $1 "Wed $1
977+ "Thu $1 "Fri $1 "Sat $1 ]
978+
979+@spacer/wave [ 0000 0000 0070 8807 ]
980+
981+@font/glyphs [
982+ 0000 0000 0000 0000 0000 0000 0000 0000
983+ 0000 1010 1020 2020 2000 4040 0000 0000
984+ 0000 0050 5000 0000 0000 0000 0000 0000
985+ 0000 0024 24fc 4848 fc90 9000 0000 0000
986+ 0000 083c 4a50 5030 2828 48f0 4000 0000
987+ 0000 1129 2a14 0810 2854 9488 0000 0000
988+ 0000 1824 2428 3052 9488 8876 0000 0000
989+ 0000 0040 4000 0000 0000 0000 0000 0000
990+ 0004 0808 1010 2020 2020 2010 1000 0000
991+ 0020 2010 1010 1010 2020 4040 8000 0000
992+ 0000 0024 187e 1824 0000 0000 0000 0000
993+ 0000 0000 0010 107c 1010 0000 0000 0000
994+ 0000 0000 0000 0000 0000 0020 2040 0000
995+ 0000 0000 0000 007c 0000 0000 0000 0000
996+ 0000 0000 0000 0000 0000 0010 0000 0000
997+ 0001 0102 0404 0810 2020 4080 8000 0000
998+ 0000 1824 4444 8484 8888 9060 0000 0000
999+ 0000 0818 2810 1010 1020 2070 0000 0000
1000+ 0000 1c22 0204 0810 2040 80f8 0000 0000
1001+ 0000 1c22 0204 1804 0404 8870 0000 0000
1002+ 0000 0408 0810 2848 fc10 1010 0000 0000
1003+ 0000 3e20 2078 4404 0404 8870 0000 0000
1004+ 0000 0c10 2040 58e4 8484 8870 0000 0000
1005+ 0000 3e02 0408 1010 2020 4040 0000 0000
1006+ 0000 1c22 4244 3844 8484 8870 0000 0000
1007+ 0000 1c22 4242 463c 0408 1060 0000 0000
1008+ 0000 0000 0000 4000 0000 0040 0000 0000
1009+ 0000 0000 0000 2000 0000 0020 2040 0000
1010+ 0000 0000 0008 1020 4020 1008 0000 0000
1011+ 0000 0000 0000 007c 0000 7c00 0000 0000
1012+ 0000 0000 0040 2010 0810 2040 0000 0000
1013+ 0000 003c 4242 0408 1010 0010 0000 0000
1014+ 0000 0000 1e21 4e52 524f 201c 0000 0000
1015+ 0000 0c0c 1414 2424 7c44 8484 0000 0000
1016+ 0000 1e11 1122 3c22 2242 4478 0000 0000
1017+ 0000 0e11 2020 4040 4040 4438 0000 0000
1018+ 0000 3c22 2242 4242 4484 88f0 0000 0000
1019+ 0000 1f10 1020 3c20 2040 407c 0000 0000
1020+ 0000 1f10 1020 3c20 2040 4040 0000 0000
1021+ 0000 0e11 2020 404e 4244 443c 0000 0000
1022+ 0000 2121 2142 7e42 4284 8484 0000 0000
1023+ 0000 1f04 0408 0808 0810 107c 0000 0000
1024+ 0000 0702 0204 0404 0488 8870 0000 0000
1025+ 0000 2122 2448 7050 4888 8484 0000 0000
1026+ 0000 1010 1020 2020 2040 407c 0000 0000
1027+ 0000 2121 3356 5a5a 4284 8484 0000 0000
1028+ 0000 2121 3152 524a 4a8c 8484 0000 0000
1029+ 0000 0e11 2121 4141 4242 4438 0000 0000
1030+ 0000 1e11 1121 223c 2040 4040 0000 0000
1031+ 0000 0e11 2121 4141 4252 5438 0600 0000
1032+ 0000 1e11 1122 3c30 2848 4444 0000 0000
1033+ 0000 1e21 2020 1008 0404 8478 0000 0000
1034+ 0000 7f08 0810 1010 1020 2020 0000 0000
1035+ 0000 2121 4142 4242 8284 8478 0000 0000
1036+ 0000 2121 2222 2424 2828 3030 0000 0000
1037+ 0000 2121 2122 2a5a 6a6c 4444 0000 0000
1038+ 0000 2121 1214 1818 2848 8484 0000 0000
1039+ 0000 2121 1212 1408 0810 1010 0000 0000
1040+ 0000 3f01 0204 0810 2040 80fc 0000 0000
1041+ 001e 1010 1020 2020 2040 4040 7800 0000
1042+ 0040 4040 2020 2010 1010 0808 0800 0000
1043+ 0078 0808 0810 1010 1020 2020 e000 0000
1044+ 0000 0020 5000 0000 0000 0000 0000 0000
1045+ 0000 0000 0000 0000 0000 00f8 0000 0000
1046+ 0000 0040 2000 0000 0000 0000 0000 0000
1047+ 0000 0000 001e 2222 4444 4c32 0000 0000
1048+ 0000 3010 102c 3222 2244 4438 0000 0000
1049+ 0000 0000 001c 2220 4040 4438 0000 0000
1050+ 0000 0101 011e 2222 4244 4c32 0000 0000
1051+ 0000 0000 001c 2224 7840 4438 0000 0000
1052+ 0000 0304 0808 3e08 1010 1010 2020 4000
1053+ 0000 0000 001e 2222 4444 4c34 0848 7000
1054+ 0000 3010 102e 3222 2244 4446 0000 0000
1055+ 0000 0404 000c 1808 0810 121c 0000 0000
1056+ 0000 0404 000c 1808 0808 1010 1020 c000
1057+ 0000 1010 102e 3222 3c48 4442 0000 0000
1058+ 0000 0c04 0408 0808 0810 1418 0000 0000
1059+ 0000 0000 00b7 4949 4992 9293 0000 0000
1060+ 0000 0000 006e 3222 2244 4446 0000 0000
1061+ 0000 0000 001c 2222 4244 4438 0000 0000
1062+ 0000 0000 002c 7222 2244 4478 4080 8000
1063+ 0000 0000 001a 2622 4244 4c34 0808 0800
1064+ 0000 0000 0016 3a10 1020 2020 0000 0000
1065+ 0000 0000 001c 2220 1804 4438 0000 0000
1066+ 0000 0008 083e 0810 1010 2418 0000 0000
1067+ 0000 0000 0062 2222 4244 4c32 0000 0000
1068+ 0000 0000 0062 2222 2224 2830 0000 0000
1069+ 0000 0000 0061 2141 495a 6644 0000 0000
1070+ 0000 0000 0031 120c 0818 2446 0000 0000
1071+ 0000 0000 0062 2222 4444 4c34 0848 7000
1072+ 0000 0000 001d 2204 0810 2052 0c00 0000
1073+ 0006 0808 0810 6010 1020 2020 1800 0000
1074+ 0000 1010 1020 2020 2040 4040 0000 0000
1075+ 0030 0808 0810 100c 1020 2020 c000 0000
1076+ 0000 0032 4c00 0000 0000 0000 0000 0000 ]
1077+ &tab [ 0000 0000 0010 18fc 1810 0000 0000 0000 ]
1078+
1079+@kbd/glyphs [
1080+ 0000 0000 0000 0000 0808 1010 1000 2000
1081+ 2448 0000 0000 0000 0a14 7e28 fc50 a000
1082+ 083c 5238 14a8 7020 44a8 4810 242a 4400
1083+ 1824 4862 9c88 7000 1020 0000 0000 0000
1084+ 0408 1020 2020 1008 2010 0808 0810 2040
1085+ 0050 2050 0000 0000 0000 2020 f820 2000
1086+ 0000 0000 0010 1020 0000 0000 7c00 0000
1087+ 0000 0000 0000 1000 0808 1010 2020 4040
1088+ 0c12 2242 4448 3000 0c04 0808 0810 1000
1089+ 0c12 0408 1020 7800 0e02 0418 0448 3000
1090+ 060a 1424 3e08 0800 1e20 3804 0448 3000
1091+ 0c12 2038 4448 3000 3e04 0810 2040 4000
1092+ 0c12 2418 2448 3000 0c12 221c 0448 3000
1093+ 0000 1000 0010 0000 0000 1000 0010 1020
1094+ 0000 0810 2010 0800 0000 7c00 7c00 0000
1095+ 0000 2010 0810 2000 3844 0418 2000 4000
1096+ 0c12 2e54 5844 3000 1c22 2244 7c88 8800
1097+ 3c22 4478 4488 f000 1c22 4040 8088 7000
1098+ 3c22 4244 4488 f000 3e20 4078 4080 f800
1099+ 3e20 4078 4080 8000 1c22 4040 9c88 7000
1100+ 2222 447c 4488 8800 1c08 1010 2020 7000
1101+ 0e04 0808 1090 6000 2224 4870 5090 8800
1102+ 1010 2020 2040 7c00 2236 4c44 4488 8800
1103+ 2222 6454 4c88 8800 1c22 4244 8488 7000
1104+ 3c22 4478 4080 8000 1c22 4244 9488 7400
1105+ 3c22 4478 4488 8800 1c22 4038 0488 7000
1106+ 7c10 2020 2040 4000 2222 4444 8888 7000
1107+ 4444 4448 5020 2000 2222 4454 a8a8 5000
1108+ 2224 2810 2848 8800 4448 5020 2040 4000
1109+ 3e04 0810 2040 f800 0c08 0810 1020 2030
1110+ 2020 2010 1008 0808 1808 1010 1020 2060
1111+ 2050 8800 0000 0000 0000 0000 0000 f800
1112+ 4020 1000 0000 0000 0000 1a24 4448 3400
1113+ 1020 3824 4448 3000 0000 1824 4048 3000
1114+ 0202 1a24 4448 3400 0000 1824 7840 3000
1115+ 0608 3c10 1020 20c0 0000 1a24 4838 9060
1116+ 1020 2834 2448 4800 0400 1808 1028 3000
1117+ 0400 1808 1010 20c0 1020 2834 2850 4800
1118+ 1808 1010 2028 3000 0000 542a 2a54 5400
1119+ 0000 2c32 2244 4400 0000 1824 4448 3000
1120+ 0000 2c12 2458 4040 0000 1a24 4c34 0408
1121+ 0000 2834 2040 4000 0000 1824 1048 3000
1122+ 0810 3c10 2028 3000 0000 2424 4858 2800
1123+ 0000 6424 4850 6000 0000 622a 5454 2800
1124+ 0000 2458 1034 4800 0000 2424 4838 9060
1125+ 0000 3448 1024 5800 0c10 1060 2040 4020
1126+ 1010 1010 1010 1010 0804 0408 0c10 1060
1127+ 0000 0032 4c00 0000 0000 0000 0000 0000 ]
1128+ &a [ 0000 0001 0204 0810 1008 0402 0100 0000 ]
1129+ &b [ 0000 ff00 0000 0000 0000 0000 00ff 0000 ]
1130+ &c [ 0000 0080 4020 1008 0810 2040 8000 0000 ]
1131+
1132+@appicon [
1133+ 0000 0000 0000 0001 0000 0000 0000 0000
1134+ 0000 0000 0000 0080 0000 0000 0000 0000
1135+ 0000 0000 0000 0038 0000 0000 0000 0000
1136+ 070f 0f1f 1f0f 0f07 0000 0000 0000 0000
1137+ e0f0 f0f8 f8f1 f1e3 0000 0000 0000 0000
1138+ 3870 70e0 e0c0 c080 0000 0000 0000 0000
1139+ 0100 0000 0000 0000 0000 0000 0000 0000
1140+ 8300 0000 0000 0000 0000 0000 0000 0000
1141+ 8000 0000 0000 0000 0000 0000 0000 0000 ]
1142+
1143+@loader/rom [
1144+ 8000 8000 0711 0106 20ff f702 a001 00af
1145+ 80ac 37a0 ffd5 80a2 36ef 38af 8000 6f15
1146+ 21aa 20ff f622 226f 2c00 ]
1147+
1148+@bios/logo [
1149+ 000f 3f7f 7fff ffff 00c0 f0f8 f8fc fcfc
1150+ 000e 0e1c 1c38 3870 00ff ffff e0e0 e0e0
1151+ 00f0 fcfc 1e0e 0e1e 001f 7f7f f0e0 e0e0
1152+ 00f0 fcfc 1e0e 0e00 ffff ff7f 7f3f 0f00
1153+ fcfc fcf9 f9f3 c300 70e0 e0c0 c080 8000
1154+ ffff ffe0 e0e0 e000 fcfc f000 0000 0000
1155+ e0e0 e0f0 7f7f 1f00 000e 0e1e fcfc f000 ]
1156+
1157+(
1158+@|Buffer )
1159+
1160+@icn/buf $8
1161+
1162+@date/buf $20
1163+
1164+@time/buf $20
1165+
1166+@path/buf $&buflen
1167+
1168+@bios/buf $&buflen
1169+
1170+@dict/tmpbuf $&tmpbuflen
1171+
1172+@dict/buf $&buflen
1173+
1174+@dir/buf $&buflen
1175+
M
makefile
+5,
-2
1@@ -2,8 +2,8 @@ RELEASE_flags=-DNDEBUG -O2 -g0 -s
2 DEBUG_flags=-std=c99 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined
3 PREFIX=${HOME}/.local
4
5-run: bin/uxn11 bin/perifs.rom
6- bin/uxn11 bin/perifs.rom
7+run: bin/uxn11 bin/m_pc.rom bin/perifs.rom
8+ bin/uxn11 bin/m_pc.rom bin/perifs.rom run
9 gui: bin/uxn11 bin/screen.rom
10 bin/uxn11 bin/screen.rom
11 test: bin/uxn11-debug tests
12@@ -29,6 +29,7 @@ grab:
13 cp ../drifblim/etc/drifblim.rom.txt etc/utils/
14 cp ../uxn-utils/cli/opctest/src/opctest.tal etc/tests/
15 cp ../uxn-utils/gui/perifs/src/perifs.tal etc/tests/
16+ cp ../m_pc/src/m_pc.tal etc/utils/
17 archive:
18 cp src/uxn11.c ../oscean/etc/uxn11.c.txt
19 cp doc/man/uxntal.7 ../oscean/etc/uxntal.7.txt
20@@ -51,6 +52,8 @@ bin/uxn11-debug: src/uxn11.c
21
22 bin/drifblim.rom: bin/uxn11 etc/utils/drifblim.rom.txt
23 @ cat etc/utils/drifblim.rom.txt | bin/uxn11 etc/utils/xh.rom > bin/drifblim.rom
24+bin/m_pc.rom: bin/uxn11 bin/drifblim.rom etc/utils/m_pc.tal
25+ @ bin/uxn11 bin/drifblim.rom etc/utils/m_pc.tal bin/m_pc.rom
26
27 # Tests
28