main pita/uxn12 / etc / utils / m_pc.tal
   1( 54K . M/PC )
   2
   3|00 @System/vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1
   4|10 @Console/vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1
   5|20 @Screen/vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
   6|80 @Controller/vector $2 &button $1 &key $1
   7|90 @Mouse/vector $2 &x $2 &y $2 &state $1 &chord $1 &pad $4 &scrolly &scrolly-hb $1 &scrolly-lb $1
   8|a0 @File/vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
   9|b0 @File2/vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
  10|c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1
  11
  12(
  13@|Enums )
  14
  15|0050 @Varvara/version
  16|00fd @loader/entry
  17|0100 @loader/pagelen
  18|0080 @path/buflen
  19|0200 @bios/buflen
  20|0800 @dir/buflen
  21|0120 @meta/buflen
  22|ff00 @dict/cap
  23|0008 @bios/anchor-x
  24|0028 @bios/anchor-y
  25
  26|000
  27
  28	@input/buf $80
  29	@loader/buf
  30
  31|100
  32
  33@on-reset ( -> )
  34	;meta #06 DEO2
  35	theme/<load>
  36	;dict/home-path path/<set>
  37	window/<update>
  38	window/<draw-spacer>
  39	input/<bind>
  40	bios/<welcome>
  41	.Console/type DEI ?{ BRK }
  42	loader/<set-instant>
  43	BRK
  44
  45@meta 00
  46	( name ) "M/PC 0a
  47	( details ) "Monitor/Program 20 "Control 0a
  48	( author ) "By 20 "Devine 20 "Lu 20 "Linvega 0a
  49	( date ) "6 20 "Jul 20 "2026 00
  50	( . ) 03
  51	( - ) 56 =Varvara/version
  52	( - ) 83 =appicon
  53	( - ) a0 =manifest/dat
  54
  55@manifest/dat ( . )
  56	_{ =dict/m_pc
  57	( ) 10 00 =scroll/<up> =dict/scroll-up
  58	( ) 20 00 =scroll/<down> =dict/scroll-down
  59	( ) 40 00 =sel/<prev> =dict/sel-prev
  60	( ) 80 00 =sel/<next> =dict/sel-next
  61	( ) 01 00 =sel/<use> =dict/sel-pick
  62	( ) 02 00 =bios/<dir> =dict/directory }
  63	_{ =dict/input
  64	( ) 00 0d =input/<eval> =dict/eval
  65	( ) 04 0d =input/<eval-partial> =dict/eval-partial
  66	( ) 00 1b =input/<blank> =dict/clear }
  67	00
  68
  69%Screen/<set-pos> ( x* y* -- ) {
  70	.Screen/y DEO2
  71	.Screen/x DEO2 }
  72
  73(
  74@|Input )
  75
  76@input/on-controller ( -> )
  77	.Controller/button DEI2 DUP2 manifest/scan INC2k ORA ?{
  78		POP2
  79		( key ) /handle-input
  80		( button ) POP BRK }
  81	( * ) JSR2 POP2 BRK
  82
  83@input/on-console ( -> )
  84	.Console/read DEI
  85	( | mute arg spacers )
  86	[ LIT2 03 -Console/type ] DEI NEQ ?{ POP #20 }
  87	DUP LIT "\ NEQ ?{
  88		POP ;&on-console-escape .Console/vector DEO2
  89		BRK }
  90	/handle-input BRK
  91
  92@input/on-console-escape ( -> )
  93	.Console/read ] DEI DUP #0a EQU ?{
  94		LIT "\ /handle-input DUP /handle-input }
  95	;&on-console .Console/vector DEO2
  96	BRK
  97
  98@input/<bind> ( -- )
  99	;&on-controller .Controller/vector DEO2
 100	;&on-console .Console/vector DEO2 !/<redraw>
 101
 102@input/handle-input ( c -- )
 103	DUP ?{ POP JMP2r }
 104	DUP #08 EQU ?/on-bs
 105	DUP #09 EQU ?/on-tab
 106	DUP #0a EQU ?/on-enter
 107	DUP #7f EQU ?/on-del
 108	DUP #20 GTH ?{ POP #20 }
 109	sel/<reset-draw>
 110	/<push>
 111	autocomplete/<update> !/<redraw>
 112
 113	&on-bs ( c -- )
 114	POP /<pop>
 115	autocomplete/<reset> !/<redraw>
 116
 117	&on-tab ( c -- )
 118	POP autocomplete/get INC2k ORA ?{ POP2 JMP2r }
 119	/<push-str> !/<redraw>
 120
 121	&on-enter ( c -- )
 122	POP autocomplete/<reset> !/<eval>
 123
 124	&on-del ( c -- )
 125	POP !/<blank>
 126
 127@input/is-active ( -- t )
 128	[ LIT2 -&buf _&+ptr ] LDR NEQ JMP2r
 129
 130@input/get-length ( -- length* )
 131	[ LIT2 00 _&+ptr ] LDR .&buf SUB JMP2r
 132
 133@input/<reset> ( -- )
 134	#0000 .&buf STZ2
 135	[ LIT2 -&buf _&+ptr ] STR !autocomplete/<reset>
 136
 137@input/<push-str-quoted> ( str* -- )
 138	DUP2 str/is-word ?/<push-str>
 139	LIT "" /<push>
 140	/<push-str>
 141	LIT "" !/<push>
 142
 143@input/<push-str> ( str* -- )
 144	&>w
 145		LDAk DUP ?{ POP POP2 !/<redraw> }
 146		str/escape /<push>
 147		INC2 !/>w
 148
 149@input/<push> ( c -- )
 150	[ LIT2 00 &+ptr -&buf ] INCk ,&+ptr STR
 151	STZ2
 152	JMP2r
 153
 154@input/<pop> ( -- )
 155	,&+ptr LDR
 156	( cap ) DUP .&buf NEQ ?{ POP JMP2r }
 157	#01 SUB #00 OVR STZ
 158	,&+ptr STR
 159	JMP2r
 160
 161@input/<eval-partial> ( -- )
 162	;&buf LDAk ?{ POP2 !bios/<welcome> }
 163	bios/<parse-partial> !/<reset-draw>
 164
 165@input/<eval> ( -- )
 166	sel/is-active ?sel/<pick>
 167	( >> )
 168
 169@input/<eval-force> ( -- )
 170	;&buf LDAk ?{ POP2 !bios/<welcome> }
 171	bios/<parse> !/<reset-draw>
 172
 173@input/<blank> ( -- )
 174	sel/is-active ?sel/<reset-draw>
 175	bios/<redraw>
 176	( >> )
 177
 178@input/<reset-draw> ( -- )
 179	/<reset>
 180	( >> )
 181
 182@input/<redraw> ( -- )
 183	;bios/anchor-x #0018 Screen/<set-pos>
 184	[ LIT2 e0 -Screen/pixel ] DEO
 185	#0008 .Screen/y DEO2
 186	path/<draw>
 187	/get-origin #45 font/<draw-str-color>
 188	autocomplete/<draw>
 189	;&caret !font/<draw-sprite>
 190
 191@input/get-origin ( -- buf* )
 192	/get-length window/get-margin #03 SFT2 #0002 SUB2 LTH2k ?{
 193		( follow cursor ) SUB2 ;&buf ADD2 JMP2r }
 194	POP2 POP2 ;&buf JMP2r
 195
 196@autocomplete/get ( -- str* )
 197	,&addr LDR2 INC2k ORA ?{ JMP2r }
 198	;input/buf str/len ADD2 JMP2r
 199
 200@autocomplete/<reset> ( -- )
 201	#ffff ,&addr STR2
 202	JMP2r
 203
 204@autocomplete/<update> ( -- )
 205	;input/buf bios/find-seg INC2k ORA ?{ POP2 !/<reset> }
 206	LDA2 ,&addr STR2
 207	JMP2r
 208
 209@autocomplete/<draw> ( -- )
 210	[ LIT2 &addr $2 ] INC2k ORA ?{ POP2 JMP2r }
 211	input/get-length ADD2 #43 !font/<draw-str-color>
 212
 213(
 214@|Bios )
 215
 216@bios/<parse> ( str* -- )
 217	/<reset>
 218	dict/<reset>
 219	( >> )
 220
 221@bios/<parse-partial> ( str* -- )
 222	sel/<reset>
 223	str/walk-ws banner/<request>
 224	&>w
 225		/parse-symbol str/walk-ws LDAk ?/>w
 226	POP2 reader/is-bound ?{ !/<redraw> }
 227	JMP2r
 228
 229@bios/parse-symbol ( addr* -- next* )
 230	LDAk LIT "~ EQU ?/parse-include
 231	dict/alloc !/<push>
 232
 233@bios/parse-include ( addr* -- next* )
 234	INC2 dict/alloc path/make dir/load-temp !/<parse-partial>
 235
 236@bios/<welcome> ( -- )
 237	/<reset>
 238	banner/<request>
 239	now/<eval>
 240	;dict/ready2 /<push> !/<redraw>
 241
 242@bios/<dir> ( -- )
 243	sel/is-active ?sel/<reset-draw>
 244	input/is-active ?input/<reset-draw>
 245	/<reset>
 246	dir/<eval> !/<redraw>
 247
 248@bios/find-seg ( str* -- <res>* )
 249	,&t STR2
 250	;&+ptr LDA2 ;&buf
 251	&>lfs
 252		NEQ2k ?{
 253			POP2 #ffff &end NIP2 JMP2r }
 254		LDA2k [ LIT2 &t $2 ] str/seg ?/end
 255		INC2 INC2 !/>lfs
 256
 257@bios/get-symbol ( id -- sym* )
 258	#00 SWP DUP ADD ;&buf ADD2 LDA2 JMP2r
 259
 260@bios/get-depth ( -- depth* )
 261	,&+ptr LDR2 ;&buf SUB2 #01 SFT2 JMP2r
 262
 263@bios/is-empty ( -- fail )
 264	,&+ptr LDR2 ;&buf EQU2 JMP2r
 265
 266@bios/is-thtwo ( -- fail )
 267	/get-depth #0002 LTH2 JMP2r
 268
 269@bios/is-ththree ( -- fail )
 270	/get-depth #0003 LTH2 JMP2r
 271
 272@bios/<reset> ( -- )
 273	;&buf ,&+ptr STR2 !scroll/<reset>
 274
 275@bios/<run> ( str* cmd* -- )
 276	NIP2
 277	( get cmd ) LDA2
 278	( get eval ) INC2 INC2 LDA2
 279	( apply ) JMP2
 280
 281@bios/<push-bool> ( bool -- )
 282	?{ ;dict/f !/<push> }
 283	;dict/t
 284	( >> )
 285
 286@bios/<push> ( str* -- )
 287	DUP2 cmds/find INC2k ORA ?/<run>
 288	POP2
 289	( >> )
 290
 291@bios/<push-raw> ( str* -- )
 292	( | put on stack )
 293	[ LIT2 &+ptr =&buf ]
 294	( clamp ) DUP2 ;&cap NEQ2 ?{ POP2 POP2 JMP2r }
 295	INC2k INC2 ,&+ptr STR2
 296	STA2
 297	JMP2r
 298
 299@bios/pop ( -- addr* )
 300	,&+ptr LDR2 #0002 SUB2 LDA2k SWP2 ,&+ptr STR2
 301	JMP2r
 302
 303@bios/<push-err-underflow> ( -- )
 304	;dict/err-underflow !/<push>
 305
 306@bios/<push-err-missing> ( -- )
 307	;dict/err-missing !/<push>
 308
 309@bios/<push-err-binary> ( -- )
 310	;dict/err-binary !/<push>
 311
 312@bios/<redraw> ( -- )
 313	#0000 ;&anchor-y Screen/<set-pos>
 314	[ LIT2 c0 -Screen/pixel ] DEO
 315	;&anchor-y .Screen/y DEO2
 316	,&+ptr LDR2 ;&buf scroll/get STHk DUP2 ADD2 ADD2
 317	( | Draw scroll )
 318	scroll/<draw>
 319	&>l
 320		NEQ2k ?{ POP2 POP2 POPr !banner/<draw> }
 321		LDA2k symbol/make DUP2 /<draw-spacer>
 322		STHkr sel/is-unselected symbol/<draw>
 323		INCr INC2 INC2 !/>l
 324
 325@bios/<draw-spacer> ( symbol* -- )
 326	font/get-width .Screen/x DEI2 ADD2 window/get-margin LTH2 ?{ !font/<draw-lb> }
 327	.Screen/x DEI2k #0008 ADD2 ROT DEO2
 328	JMP2r
 329
 330@bios/<use> ( id -- )
 331	/get-symbol
 332	( | handlers )
 333	DUP2 str/is-dir ?/<use-mov>
 334	DUP2 str/is-icn ?/<use-icn>
 335	DUP2 str/is-rom ?/<use-run>
 336	DUP2 path/make file/is-text ?/<use-txt>
 337	POP2 JMP2r
 338
 339@bios/<use-mov> ( str* -- )
 340	input/<push-str>
 341	;&cmd-mov !input/<push-str>
 342	&cmd-mov 20 "mov 00
 343
 344@bios/<use-icn> ( str* -- )
 345	input/<push-str>
 346	;&cmd-icn !input/<push-str>
 347	&cmd-icn 20 "1 20 "icn 00
 348
 349@bios/<use-run> ( str* -- )
 350	input/<push-str>
 351	;&cmd-run !input/<push-str>
 352	&cmd-run 20 "run 00
 353
 354@bios/<use-txt> ( name* -- )
 355	input/<push-str>
 356	;&cmd-txt !input/<push-str>
 357	&cmd-txt 20 "0 20 "txt 00
 358
 359@symbol/<draw> ( str* unsel -- )
 360	?{
 361		DUP2 str/is-dir ?/<draw-dir>
 362		DUP2 str/is-rom ?/<draw-use>
 363		( selected ) #49 !font/<draw-str-color> }
 364	( unselected ) #45 !font/<draw-str-color>
 365
 366@symbol/<draw-dir> ( str* -- )
 367	#4d !font/<draw-str-color>
 368
 369@symbol/<draw-use> ( str* -- )
 370	#44 !font/<draw-str-color>
 371
 372@symbol/make ( str* -- sym* )
 373	;&buf DUP2 ,&+ptr STR2
 374	SWP2 [ LIT2r 1c00 ]
 375	&>w
 376		NEQkr STHr ?{
 377			[ LIT2 ".. ] /<push>
 378			/<push> !/end }
 379		LDAk DUP ?{
 380			POP &end POP2r POP2 #00 !/<push> }
 381		DUP #0a NEQ ?{ POP #20 }
 382		/<push>
 383		INCr INC2 !/>w
 384
 385@symbol/<push> ( c -- )
 386	#00 [ LIT2 &+ptr =&buf ] INC2k ,&+ptr STR2
 387	STA2
 388	JMP2r
 389
 390(
 391@|Path )
 392
 393@path/<move> ( str* -- )
 394	DUP2 ;dict/out-path str/cmp ?/<pop>
 395	( | Check if file is a folder )
 396	LITr _&+ptr LDR2r /<push-str>
 397	;&buf file/is-dir ?{
 398		#00 STH2kr STA
 399		LITr _&+ptr STR2r
 400		JMP2r }
 401	POP2r
 402	( | Add missing slash )
 403	/is-dir ?{ LIT "/ /<push> }
 404	JMP2r
 405
 406@path/is-home ( -- t )
 407	;&buf str/len #0002 EQU2 JMP2r
 408
 409@path/is-dir ( -- t )
 410	,&+ptr LDR2 #0001 SUB2 LDA LIT "/ EQU JMP2r
 411
 412@path/<pop> ( str* -- )
 413	POP2
 414	( | find last slash )
 415	;&buf ,&+ptr LDR2 #0001 SUB2
 416	&>lp
 417		#0001 SUB2 LDAk LIT "/ EQU ?{ LTH2k ?/>lp }
 418	INC2 #0000 OVR2 STA2
 419	,&+ptr STR2
 420	POP2 JMP2r
 421
 422@path/<set> ( str* -- )
 423	;&buf ,&+ptr STR2
 424	( >> )
 425
 426@path/<push-str> ( str* -- )
 427	&>w
 428		LDAk DUP ?{ POP POP2 JMP2r }
 429		/<push>
 430		INC2 !/>w
 431
 432@path/<push> ( str* -- )
 433	#00 [ LIT2 &+ptr =&buf ]
 434	( clamp ) DUP2 ;&cap NEQ2 ?{ POP2 POP POP2 JMP2r }
 435	INC2k ,&+ptr STR2
 436	STA2
 437	JMP2r
 438
 439@path/<draw> ( -- )
 440	;&buf #45 !font/<draw-str-color>
 441
 442@path/make ( str* -- path* )
 443	;&buf !dict/alloc-cat
 444
 445(
 446@|Selection )
 447
 448@sel/<use> ( -- )
 449	input/is-active ?input/<eval-force>
 450	,&id LDR INCk ?bios/<use>
 451	POP JMP2r
 452
 453@sel/<prev> ( -- )
 454	,&id LDR
 455	( clamp ) INCk ?{ POP JMP2r }
 456	#01 SUB #00 OVR scroll/<follow> !/<set>
 457
 458@sel/<next> ( -- )
 459	,&id LDR INC
 460	( clamp ) DUP bios/get-depth NIP LTH ?/<set>
 461	POP JMP2r
 462
 463@sel/has-meta ( -- t )
 464	,&id LDR INCk ?{ POP #00 JMP2r }
 465	bios/get-symbol DUP2 str/is-rom ?{ POP2 #00 JMP2r }
 466	path/make file/get-meta ORAk ?{ POP2 #00 JMP2r }
 467	meta/<load>
 468	#01 JMP2r
 469
 470@sel/is-active ( -- bool )
 471	#ff
 472	( >> )
 473
 474@sel/is-unselected ( id -- bool )
 475	[ LIT &id ff ] NEQ JMP2r
 476
 477@sel/<activate> ( -- )
 478	#00
 479	( >> )
 480
 481@sel/<set> ( id -- )
 482	DUP ,&id LDR NEQ ?{ POP JMP2r }
 483	,&id STR !bios/<redraw>
 484
 485@sel/<pick> ( -- )
 486	,&id LDR INCk ?{ POP JMP2r }
 487	bios/get-symbol
 488	( clamp ) DUP2 str/len #0040 LTH2 ?{ POP2 !input/<redraw> }
 489	input/<push-str-quoted>
 490	#20 input/<push> !input/<redraw>
 491
 492@sel/<reset> ( -- )
 493	[ LIT2 ff _&id ] STR
 494	JMP2r
 495
 496@sel/<reset-draw> ( -- )
 497	scroll/<reset>
 498	,&id LDR /<reset>
 499	,&id LDR NEQ ?bios/<redraw>
 500	JMP2r
 501
 502@sel/<follow> ( id -- )
 503	,&id LDR GTHk ?{ POP2 JMP2r }
 504	POP ,&id STR
 505	JMP2r
 506
 507(
 508@|Scroll )
 509
 510@scroll/<up> ( -- )
 511	,&+pos LDR2
 512	( clamp ) ORAk ?{ POP2 JMP2r }
 513	#0001 SUB2 /<set> !bios/<redraw>
 514
 515@scroll/<down> ( -- )
 516	sel/is-active ?{ !sel/<activate> }
 517	,&+pos LDR2
 518	( clamp ) INC2k bios/get-depth LTH2 ?{ POP2 JMP2r }
 519	INC2 DUP sel/<follow>
 520	/<set> !bios/<redraw>
 521
 522@scroll/<follow> ( id* -- )
 523	,&+pos LDR2 LTH2k ?{ POP2 POP2 JMP2r }
 524	POP2 !/<set>
 525
 526@scroll/<reset> ( -- )
 527	#0000
 528	( >> )
 529
 530@scroll/<set> ( id* -- )
 531	,&+pos STR2
 532	JMP2r
 533
 534@scroll/get ( -- id* )
 535	,&+pos LDR2 JMP2r
 536
 537@scroll/<draw> ( -- )
 538	[ LIT2 &+pos $2 ] ORAk ?{ POP2 JMP2r }
 539	;bios/anchor-x .Screen/x DEO2
 540	bios/get-depth SWP2 INC2 SUB2 dec/make #43 font/<draw-str-color>
 541	#09 !font/<draw-glyph>
 542
 543(
 544@|Reader )
 545
 546@reader/on-controller ( -> )
 547	.Controller/button DEI
 548	( | handlers )
 549	DUP #01 NEQ ?{ /<leave> }
 550	DUP #10 NEQ ?{ /<select-prev> }
 551	DUP #20 NEQ ?{ /<select-next> }
 552	POP .Controller/key DEI DUP ?{ POP BRK }
 553	/<leave>
 554	input/handle-input BRK
 555
 556@reader/<leave> ( -- )
 557	input/<bind> !bios/<redraw>
 558
 559@reader/is-bound ( -- t )
 560	.Controller/vector DEI2 ;&on-controller EQU2 JMP2r
 561
 562@reader/<bind> ( str* -- )
 563	.File/name DEO2
 564	;&on-controller .Controller/vector DEO2
 565	( col ) window/get-cols #0001 SUB2 ,&col STR
 566	POP
 567	( row ) window/get-rows #01 SFT2 #0003 SUB2 ,&row STR
 568	POP #0000 !/<select-line>
 569
 570@reader/<select-prev> ( -- )
 571	,&line LDR2 ORAk ?{ POP2 JMP2r }
 572	#0001 SUB2 !/<select-line>
 573
 574@reader/<select-next> ( -- )
 575	[ LIT2 &line $2 ] INC2
 576	( >> )
 577
 578@reader/<select-line> ( line* -- )
 579	DUP2 file/seek-line ?{ POP2 JMP2r }
 580	;bios/anchor-x ;bios/anchor-y Screen/<set-pos>
 581	[ LIT2 c0 -Screen/pixel ] DEO
 582	[ LIT2 15 -Screen/auto ] DEO
 583	#0001 .File/length DEO2
 584	( | Draw line number )
 585	[ LITr &col $1 ] DUP2 dec/make
 586	( store col ) DUP2 str/len #03 ADD STH
 587	POP #43 font/<draw-str-color>
 588	#09 font/<draw-glyph>
 589	#20 font/<draw-glyph>
 590	,&line STR2
 591	( | Render )
 592	#41 ;font/color STA
 593	( | Stream )
 594	[ LIT2 &row $1 00 ]
 595	&>s
 596		;&b .File/read DEO2
 597		.File/success-lb DEI ?{
 598			POP2 POP2r ;dict/eof #44 !font/<draw-str-color> }
 599		( | hard-wrap )
 600		GTHkr STHr ?{
 601			;bios/anchor-x .Screen/y DEI2 #0010 ADD2 Screen/<set-pos>
 602			INC POPr LITr 00 }
 603		[ LIT &b $1 ] DUP #0a NEQ ?{
 604			SWP INC SWP POPr LITr 00 }
 605		font/<draw-glyph>
 606		INCr GTHk ?/>s
 607	POP2 POP2r JMP2r
 608
 609(
 610@|Commands )
 611
 612@cmds/find ( str* -- <cmd>* )
 613	,&fn STR2
 614	;&lutend ;&lut
 615	&>l
 616		LDA2k LDA2 [ LIT2 &fn $2 ] str/cmp ?{
 617			INC2 INC2 GTH2k ?/>l
 618		POP2 #ffff }
 619	NIP2 JMP2r
 620
 621@cmds/lut [ =cmd/api ]
 622	&lut-clip [
 623	=dir/api =mov/api =now/api =run/api
 624	=icn/api =txt/api =len/api =put/api
 625	=get/api =cpy/api =era/api =ren/api
 626	=pop/api =dup/api =ovr/api =swp/api
 627	=rot/api =dec/api =hex/api =cat/api
 628	=add/api =sub/api =cmp/api =and/api
 629	=ora/api =rsz/api =out/api =bye/api
 630	&lutend ]
 631
 632@cmd/<eval> ( -- )
 633	;cmds/lutend ;cmds/lut-clip
 634	&>l
 635		LDA2k #0004 ADD2 bios/<push-raw>
 636		INC2 INC2 GTH2k ?/>l
 637	POP2 POP2 JMP2r
 638	&api =dict/cmd =&<eval> "<cmd> 20 "( 20 09 20 ") 00
 639
 640@dir/<eval> ( -- )
 641	;path/buf .File/name DEO2
 642	;&buflen .File/length DEO2
 643	;&buf .File/read DEO2
 644	path/is-home ?{ ;dict/out-path bios/<push-raw> }
 645	.File/success DEI2
 646	( | Handlers )
 647	DUP2 /<push-folders>
 648	DUP2 /<push-files> !/<push-dotfiles>
 649
 650@dir/find-wallpaper ( -- size* )
 651	;dict/home-path .File/name DEO2
 652	;&buflen .File/length DEO2
 653	;&buf .File/read DEO2
 654	/<explode>
 655	;&buf
 656	&>w
 657		str/is-wallpaper ?{
 658			str/cap INC2 LDAk ?/>w
 659		POP2 #ffff }
 660	JMP2r
 661
 662@dir/<explode> ( -- )
 663	;&buf
 664	&>we
 665		LDAk DUP ?{ POP POP2 JMP2r }
 666		#1f GTH ?{ LITr 00 STH2k STAr }
 667		INC2 !/>we
 668
 669@dir/<push-folders> ( length* -- )
 670	;&buf ADD2 ;&buf
 671	&>lfo
 672		LDAk LIT "- NEQ STH
 673		#0005 ADD2 STHr ?{
 674			LDAk LIT ". EQU ?{ dict/alloc-line bios/<push-raw> } }
 675		str/eol INC2 GTH2k ?/>lfo
 676	POP2 POP2 JMP2r
 677
 678@dir/<push-files> ( length* -- )
 679	;&buf ADD2 ;&buf
 680	&>lfi
 681		LDAk LIT "- EQU STH
 682		#0005 ADD2 STHr ?{
 683			LDAk LIT ". EQU ?{ dict/alloc-line bios/<push-raw> } }
 684		str/eol INC2 GTH2k ?/>lfi
 685	POP2 POP2 JMP2r
 686
 687@dir/<push-dotfiles> ( length* -- )
 688	;&buf ADD2 ;&buf
 689	&>ldf
 690		#0005 ADD2 LDAk LIT ". NEQ ?{ dict/alloc-line bios/<push-raw> }
 691		str/eol INC2 GTH2k ?/>ldf
 692	POP2 POP2 JMP2r
 693	&api =dict/dir =&<eval> "<dir> 20 "( 20 09 20 "[f] 20 ") 00
 694
 695@dir/load-temp ( addr* -- buf* )
 696	.File/name DEO2
 697	;&buflen .File/length DEO2
 698	;&buf DUP2 .File/read DEO2
 699	JMP2r
 700
 701@mov/<eval> ( -- )
 702	bios/is-empty ?bios/<push-err-underflow>
 703	bios/pop path/<move> !dir/<eval>
 704	&api =dict/mov =&<eval> "<mov> 20 "( 20 "path 20 09 20 "[f] 20 ") 00
 705
 706@now/<eval> ( -- )
 707	date/make bios/<push>
 708	time/make !bios/<push>
 709	&api =dict/now =&<eval> "<now> 20 "( 20 09 20 "date 20 "time 20 ") 00
 710
 711@run/<eval> ( -- )
 712	bios/is-empty ?bios/<push-err-underflow>
 713	bios/pop path/make
 714	( ? ) DUP2 file/exists ?loader/<bind>
 715	POP2 !bios/<push-err-missing>
 716	&api =dict/run =&<eval> "<run> 20 "( 20 "f.rom 20 09 20 "ok 20 ") 00
 717
 718@txt/<eval> ( -- )
 719	bios/is-thtwo ?bios/<push-err-underflow>
 720	( line* ) bios/pop
 721	( path* ) bios/pop path/make
 722	( ? ) DUP2 file/exists ?{ POP2 POP2 !bios/<push-err-missing> }
 723	( ? ) DUP2 file/is-text ?{ POP2 POP2 !bios/<push-err-binary> }
 724	reader/<bind>
 725	str/dec reader/<select-line>
 726	;dict/ok !bios/<push>
 727	&api =dict/txt =&<eval> "<txt> 20 "( 20 "f.txt 20 "line 20 09 20 "ok 20 ") 00
 728
 729@icn/<eval> ( -- )
 730	bios/is-empty ?bios/<push-err-underflow>
 731	( color ) bios/pop str/dec NIP
 732	( path ) bios/pop path/make
 733	( ? ) DUP2 file/exists ?{ POP2 POP !bios/<push-err-missing> }
 734	ROT /<draw>
 735	;dict/ok !bios/<push>
 736
 737@icn/<draw> ( name* blend -- )
 738	#0f AND ,&blend STR
 739	DUP2 .File/name DEO2
 740	( | depth )
 741	#0008 .File/length DEO2
 742	[ LIT2r &blend 03 -Screen/sprite ] ;&buf .Screen/addr DEO2
 743	( | size )
 744	/read-size
 745	( h ) #00 SWP SUBk ,&height STR
 746	( y ) #31 SFT2 window/get-middle SWP2 SUB2 .Screen/y DEO2
 747	( w ) #00 SWP SUBk ,&width STR
 748	( x ) #31 SFT2 window/get-center SWP2 SUB2 ,&anchor STR2
 749	( | draw )
 750	[ LIT2 01 -Screen/auto ] DEO
 751	[ LIT &height $1 ]
 752	&>v
 753		[ LIT2 &anchor $2 ] .Screen/x DEO2
 754		[ LIT &width $1 ]
 755		&>h
 756			;&buf .File/read DEO2
 757			DEOkr
 758			INC DUP ?/>h
 759		POP
 760		( lb ) .Screen/y DEI2k #0008 ADD2 ROT DEO2
 761		INC DUP ?/>v
 762	POP POP2r JMP2r
 763
 764@icn/read-size ( str* -- w h )
 765	str/cap #0009 SUB2
 766	( no size ) INC2k INC2 LDA [ LIT "x ] EQU ?{ POP2 #1010 JMP2r }
 767	LDA2k str/read-byte STH
 768	#0003 ADD2 LDA2 str/read-byte STHr SWP JMP2r
 769	&api =dict/icn =&<eval> "<icn> 20 "( 20 "f.icn 20 "blend 20 09 20 "ok 20 ") 00
 770
 771@put/<eval> ( -- )
 772	bios/is-thtwo ?bios/<push-err-underflow>
 773	bios/pop path/make .File/name DEO2
 774	bios/pop DUP2 str/len .File/length DEO2
 775	.File/write DEO2
 776	;dict/ok !bios/<push>
 777	&api =dict/put =&<eval> "<put> 20 "( 20 "body 20 "f 20 09 20 "ok 20 ") 00
 778
 779@get/<eval> ( -- )
 780	bios/is-empty ?bios/<push-err-underflow>
 781	bios/pop path/make
 782	( ? ) DUP2 file/exists ?{ POP2 !bios/<push-err-missing> }
 783	( ? ) DUP2 file/is-text ?{ POP2 !bios/<push-err-binary> }
 784	dict/alloc-file !bios/<push>
 785	&api =dict/get =&<eval> "<get> 20 "( 20 "f 20 09 20 "body 20 ") 00
 786
 787@cpy/<eval> ( -- )
 788	bios/is-thtwo ?bios/<push-err-underflow>
 789	( dst ) bios/pop path/make
 790	( src ) bios/pop path/make
 791	( ? ) DUP2 file/exists ?{ POP2 POP2 !bios/<push-err-missing> }
 792	SWP2 file/<cpy>
 793	;dict/ok !bios/<push>
 794	&api =dict/cpy =&<eval> "<cpy> 20 "( 20 "fsrc 20 "fdst 20 09 20 "ok 20 ") 00
 795
 796@era/<eval> ( -- )
 797	bios/is-empty ?bios/<push-err-underflow>
 798	bios/pop path/make
 799	( ? ) DUP2 file/exists ?{ POP2 !bios/<push-err-missing> }
 800	.File/name DEO2
 801	[ LIT2 01 -File/delete ] DEO
 802	;dict/ok !bios/<push>
 803	&api =dict/era =&<eval> "<era> 20 "( 20 "f 20 09 20 "ok 20 ") 00
 804
 805@ren/<eval> ( -- )
 806	bios/is-thtwo ?bios/<push-err-underflow>
 807	( dst ) bios/pop path/make
 808	( src ) bios/pop path/make
 809	( ? ) DUP2 file/exists ?{ POP2 POP2 !bios/<push-err-missing> }
 810	DUP2 ROT2 file/<cpy>
 811	.File/name DEO2
 812	[ LIT2 01 -File/delete ] DEO
 813	;dict/ok !bios/<push>
 814	&api =dict/ren =&<eval> "<ren> 20 "( 20 "fsrc 20 "fdst 20 09 20 "ok 20 ") 00
 815
 816@len/<eval> ( -- )
 817	bios/is-empty ?bios/<push-err-underflow>
 818	bios/pop path/make
 819	( ? ) DUP2 file/exists ?{ POP2 ;dict/zero !bios/<push> }
 820	.File/name DEO2
 821	#0004 .File/length DEO2
 822	;&buf .File/stat DEO2
 823	;&hb LDA2 str/read-byte ;&lb LDA2 str/read-byte hex/make dict/alloc NIP2 !bios/<push>
 824	&api =dict/len =&<eval> "<len> 20 "( 20 "f 20 09 20 "hex 20 ") 00
 825
 826@dup/<eval> ( -- )
 827	bios/is-empty ?bios/<push-err-underflow>
 828	bios/pop DUP2 bios/<push> !bios/<push>
 829	&api =dict/dup =&<eval> "<dup> 20 "( 20 "a 20 09 20 "a 20 "a 20 ") 00
 830
 831@ovr/<eval> ( -- )
 832	bios/is-thtwo ?bios/<push-err-underflow>
 833	( b ) bios/pop
 834	( a ) bios/pop DUP2 bios/<push>
 835	SWP2 bios/<push> !bios/<push>
 836	&api =dict/ovr =&<eval> "<ovr> 20 "( 20 "a 20 "b 20 09 20 "a 20 "b 20 "a 20 ") 00
 837
 838@pop/<eval> ( -- )
 839	bios/is-empty ?bios/<push-err-underflow>
 840	bios/pop POP2 JMP2r
 841	&api =dict/pop =&<eval> "<pop> 20 "( 20 "a 20 09 20 ") 00
 842
 843@swp/<eval> ( -- )
 844	bios/is-thtwo ?bios/<push-err-underflow>
 845	bios/pop bios/pop SWP2 bios/<push> !bios/<push>
 846	&api =dict/swp =&<eval> "<swp> 20 "( 20 "a 20 "b 20 09 20 "b 20 "a 20 ") 00
 847
 848@rot/<eval> ( -- )
 849	bios/is-ththree ?bios/<push-err-underflow>
 850	bios/pop bios/pop bios/pop ROT2 ROT2 bios/<push>
 851	bios/<push> !bios/<push>
 852	&api =dict/rot =&<eval> "<rot> 20 "( 20 "a 20 "b 20 "c 20 09 20 "b 20 "a 20 "c 20 ") 00
 853
 854@cat/<eval> ( -- )
 855	bios/is-thtwo ?bios/<push-err-underflow>
 856	bios/pop bios/pop dict/alloc-cat !bios/<push-raw>
 857	&api =dict/cat =&<eval> "<cat> 20 "( 20 "a 20 "b 20 09 20 "ab 20 ") 00
 858
 859@cmp/<eval> ( -- )
 860	bios/is-thtwo ?bios/<push-err-underflow>
 861	bios/pop bios/pop str/cmp !bios/<push-bool>
 862	&api =&cmd =&<eval> "<cmp> 20 "( 20 "a 20 "b 20 09 20 "bool 20 ") 00
 863	&cmd "cmp 00
 864
 865@and/<eval> ( -- )
 866	bios/is-thtwo ?bios/<push-err-underflow>
 867	( a ) bios/pop ;dict/t str/cmp
 868	( b ) bios/pop ;dict/t str/cmp AND !bios/<push-bool>
 869	&api =&cmd =&<eval> "<and> 20 "( 20 "a 20 "b 20 09 20 "bool 20 ") 00
 870	&cmd "and 00
 871
 872@ora/<eval> ( -- )
 873	bios/is-thtwo ?bios/<push-err-underflow>
 874	( a ) bios/pop ;dict/t str/cmp
 875	( b ) bios/pop ;dict/t str/cmp ORA !bios/<push-bool>
 876	&api =&cmd =&<eval> "<ora> 20 "( 20 "a 20 "b 20 09 20 "bool 20 ") 00
 877	&cmd "ora 00
 878
 879@add/<eval> ( -- )
 880	bios/is-thtwo ?bios/<push-err-underflow>
 881	( a ) bios/pop str/dec
 882	( b ) bios/pop str/dec ADD2 dec/make !bios/<push-raw>
 883	&api =&cmd =&<eval> "<add> 20 "( 20 "a 20 "b 20 09 20 "sum 20 ") 00
 884	&cmd "add 00
 885
 886@sub/<eval> ( -- )
 887	bios/is-thtwo ?bios/<push-err-underflow>
 888	( a ) bios/pop str/dec
 889	( b ) bios/pop str/dec SWP2 SUB2 dec/make !bios/<push-raw>
 890	&api =&cmd =&<eval> "<sub> 20 "( 20 "a 20 "b 20 09 20 "dif 20 ") 00
 891	&cmd "sub 00
 892
 893@dec/<eval> ( -- )
 894	bios/is-empty ?bios/<push-err-underflow>
 895	;&buf ,&+ptr STR2
 896	bios/pop str/hex /make !bios/<push>
 897
 898@dec/make ( value* -- str* )
 899	ORAk ?{ POP2 ;dict/zero JMP2r }
 900	;&buf ,&+ptr STR2
 901	OVR #80 AND #00 EQU ?/make-pos
 902	[ LIT "- ] /<push>
 903	#7fff AND2 #8000 SWP2 SUB2
 904	( >> )
 905
 906@dec/make-pos ( value* -- str* )
 907	#2710 [ LIT2r 00fb ]
 908	&>wpd
 909		DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{
 910			DUP LIT "0 ADD /<push>
 911			INCr }
 912		POP2 #000a DIV2 SWPr INCr STHkr ?/>wpd
 913	POP2r POP2 POP2 ;&buf JMP2r
 914
 915@dec/<push> ( c -- )
 916	#00 [ LIT2 &+ptr =&buf ] INC2k ,&+ptr STR2
 917	STA2
 918	JMP2r
 919	&api =&cmd =&<eval> "<dec> 20 "( 20 "hex 20 09 20 "dec 20 ") 00
 920	&cmd "dec 00
 921
 922@hex/<eval> ( -- )
 923	bios/is-empty ?bios/<push-err-underflow>
 924	bios/pop str/dec /make !bios/<push>
 925
 926@hex/make ( value* -- buf* )
 927	;&buf ,&+ptr STR2
 928	SWP /<push-byte>
 929	/<push-byte>
 930	;&buf !str/walk-zero
 931
 932@hex/<push-byte> ( byte -- )
 933	DUP #04 SFT /<push-nibble>
 934	( >> )
 935	&<push-nibble> ( byte -- )
 936	/chr #00 [ LIT2 &+ptr =&buf ] INC2k ,&+ptr STR2
 937	STA2
 938	JMP2r
 939	&api =&cmd =&<eval> "<hex> 20 "( 20 "dec 20 09 20 "hex 20 ") 00
 940	&cmd "hex 00
 941
 942@hex/chr ( hex -- char )
 943	#0f AND DUP #09 GTH #27 MUL ADD LIT "0 ADD JMP2r
 944
 945@rsz/<eval> ( -- )
 946	bios/is-thtwo ?bios/<push-err-underflow>
 947	( h* ) bios/pop str/dec
 948	( w* ) bios/pop str/dec SWP2k window/<set-size>
 949	.Screen/width DEI2 EQU2 ROT ROT .Screen/height DEI2 EQU2 AND !bios/<push-bool>
 950	&api =&cmd =&<eval> "<rsz> 20 "( 20 "w 20 "h 20 09 20 "bool 20 ") 00
 951	&cmd "rsz 00
 952
 953@out/<eval> ( -- )
 954	bios/is-empty ?bios/<push-err-underflow>
 955	bios/pop !str/<print>
 956	&api =&cmd =&<eval> "<out> 20 "( 20 "a 20 09 20 ") 00
 957	&cmd "out 00
 958
 959@bye/<eval> ( -- )
 960	;&callback !fade-out/<bind>
 961	&api =&cmd =&<eval> "<bye> 20 "( 20 09 20 ") 00
 962	&cmd "bye 00
 963
 964@bye/callback ( -> )
 965	#800f DEO
 966	BRK
 967
 968(
 969@|Dict )
 970
 971@dict/<reset> ( -- )
 972	;&buf ,&+ptr STR2
 973	JMP2r
 974
 975@dict/<push-escaped> ( addr* -- addr* )
 976	str/escape
 977	( >> )
 978
 979@dict/<push> ( c -- )
 980	[ LIT2 &+ptr =&buf ]
 981	( clamp ) DUP2 ;&cap NEQ2 ?{ POP2 POP JMP2r }
 982	INC2k ,&+ptr STR2
 983	STA
 984	JMP2r
 985
 986@dict/alloc ( str* -- str* addr* )
 987	LDAk LIT "" EQU ?/alloc-string
 988	LDAk LIT "( EQU ?/alloc-comment
 989	[ LITr _&+ptr ] LDR2r
 990	&>w
 991		LDAk DUP #20 GTH ?{ POP STH2r #00 !/<push> }
 992		/<push-escaped>
 993		INC2 !/>w
 994
 995@dict/alloc-file ( name* -- addr* )
 996	.File/name DEO2
 997	#0001 .File/length DEO2
 998	[ LITr _&+ptr ] LDR2r
 999	&>s
1000		;&b .File/read DEO2
1001		.File/success-lb DEI ?{ STH2r #00 !/<push> }
1002		[ LIT &b $1 ] /<push> !/>s
1003
1004@dict/alloc-cat ( a* b* -- addr* )
1005	[ LIT2r =&+ptr ] LDA2r
1006	&>wc1
1007		LDAk DUP ?{
1008			POP POP2
1009			&>wc2
1010				LDAk DUP ?{
1011					POP POP2 STH2r #00 !/<push> }
1012				/<push-escaped>
1013				INC2 !/>wc2 }
1014		/<push-escaped>
1015		INC2 !/>wc1
1016
1017@dict/alloc-string ( str* -- str* addr* )
1018	INC2 [ LIT2r =&+ptr ] LDA2r
1019	&>was
1020		LDAk DUP ?{ &end-s POP INC2 STH2r #00 !/<push> }
1021		DUP LIT "" EQU ?/end-s
1022		/<push-escaped>
1023		INC2 !/>was
1024
1025@dict/alloc-comment ( str* -- str* addr* )
1026	[ LIT2r =&+ptr ] LDA2r
1027	&>wac
1028		LDAk DUP ?{ &end-c /<push>
1029			INC2 STH2r #00 !/<push> }
1030		DUP LIT ") EQU ?/end-c
1031		/<push-escaped>
1032		INC2 !/>wac
1033
1034@dict/alloc-line ( str* -- str* addr* )
1035	[ LIT2r =&+ptr ] LDA2r
1036	&>wal
1037		LDAk DUP #1f GTH ?{ POP STH2r #00 !/<push> }
1038		/<push-escaped>
1039		INC2 !/>wal
1040
1041(
1042@|Font )
1043
1044@font/<draw-str-color> ( str* color -- )
1045	,&color STR
1046	( >> )
1047
1048@font/<draw-str> ( str* -- )
1049	[ LIT2 15 -Screen/auto ] DEO
1050	&>w
1051		LDAk DUP ?{ POP POP2 JMP2r }
1052		DUP LIT "< NEQ ?{ POP !kbd/<draw-str> }
1053		/<draw-glyph>
1054		INC2 !/>w
1055
1056@font/<draw-glyph> ( c -- )
1057	DUP #0a NEQ ?{ POP !/<draw-lb> }
1058	DUP #09 NEQ ?{ POP !/<draw-tab> }
1059	#00 SWP #20 SUB #40 SFT2 ;&glyphs ADD2
1060	( >> )
1061
1062@font/<draw-sprite> ( addr* -- )
1063	.Screen/addr DEO2
1064	[ LIT2 &color 45 -Screen/sprite ] DEO
1065	JMP2r
1066
1067@font/<draw-lb> ( -- )
1068	[ LIT2 &anchor =bios/anchor-x ] .Screen/y DEI2 #0010 ADD2 Screen/<set-pos>
1069	JMP2r
1070
1071@font/<draw-tab> ( -- )
1072	;&tab !/<draw-sprite>
1073
1074@font/get-width ( str* -- width* )
1075	[ LIT2r 0000 ]
1076	&>wgw
1077		LDAk ?{ POP2 STH2r JMP2r }
1078		LIT2r 0008 ADD2r INC2 !/>wgw
1079
1080@kbd/<draw-str> ( str* -- )
1081	INC2 [ LIT2 15 -Screen/auto ] DEO
1082	;&a font/<draw-sprite>
1083	&>w
1084		LDAk DUP ?{ POP POP2 JMP2r }
1085		DUP LIT "> NEQ ?{
1086			POP [ LIT2 15 -Screen/auto ] DEO
1087			;&c font/<draw-sprite>
1088			INC2 !font/<draw-str> }
1089		/<draw-glyph>
1090		INC2 !/>w
1091
1092@kbd/<draw-glyph> ( c -- )
1093	[ LIT2 05 -Screen/auto ] DEO
1094	[ LITr -Screen/x ] DEI2r .Screen/y DEI2 STH2k #0004 ADD2 .Screen/y DEO2
1095	#00 SWP #20 SUB #30 SFT2 ;&glyphs ADD2 font/<draw-sprite>
1096	[ LITr -Screen/y ] DEO2r
1097	[ LITr -Screen/x ] DEO2r
1098	[ LIT2 15 -Screen/auto ] DEO
1099	;&b !font/<draw-sprite>
1100
1101(
1102@|Loader )
1103
1104@loader/<load-expansion> ( -- )
1105	#ff00 file/<seek>
1106	;&pagelen .File/length DEO2
1107	;&page .File/read DEO2
1108	#0000
1109	&>s
1110		;&page .File/read DEO2
1111		.File/success DEI2 ORA ?{ POP2 JMP2r }
1112		DUP2k #80 SFT2 ,&a STR2
1113		#08 SFT2 INC2 ,&p STR2
1114		;&mmu-mov .System/expansion DEO2
1115		INC2 !/>s
1116
1117	&mmu-mov [ 01 =&pagelen 0000 =&page &p $2 &a $2 ]
1118
1119@loader/<bind> ( path* -- )
1120	;&buf ,&+ptr STR2
1121	&>w
1122		LDAk DUP ?{ POP POP2 !/<launch> }
1123		#00 [ LIT2 &+ptr =&buf ] INC2k ,&+ptr STR2
1124		STA2
1125		INC2 !/>w
1126
1127@loader/<set-instant> ( -- )
1128	[ LIT2 01 _loader/instant ] STR
1129	JMP2r
1130
1131@loader/<launch> ( -- )
1132	[ LIT &instant $1 ] ?{ ;&callback !fade-out/<bind> }
1133	;&callback .Screen/vector DEO2
1134	JMP2r
1135
1136@loader/callback ( -> )
1137	;&buf file/is-oversized #00 EQU ?{ /<load-expansion> }
1138	#0000 DUP2 Screen/<set-pos>
1139	( | Clear screen )
1140	[ LIT2 80 -Screen/pixel ] DEO
1141	[ LIT2 c0 -Screen/pixel ] DEO
1142	( | Blank vectors )
1143	#0000 #00 &l DEO2k #10 ADD DUP [ ?/l POP POP2 ]
1144	( | Blank arguments )
1145	[ LIT2 00 -Console/type ] DEO
1146	( | Setup file )
1147	;&buf .File/name DEO2
1148	#ff00 .File/length DEO2
1149	( | Copy loader )
1150	;&mmu .System/expansion DEO2
1151	( 0pg ) #00f5 .System/expansion
1152	( buf ) #0100 .File/read
1153	( 1pg ) #00f1 .System/expansion !/entry
1154
1155	&mmu [ 01 000f 0000 =&rom 0000 00f1 ]
1156	&rom [ 00ff 0000 0001 0000 0000 0000 3737 37 ]
1157
1158(
1159@|Fade )
1160
1161@fade-out/<bind> ( callback* -- )
1162	,&callback STR2
1163	;&on-frame .Screen/vector DEO2
1164	[ LIT2 00 _&f ] STR
1165	JMP2r
1166
1167@fade-out/on-frame ( -> )
1168	[ LIT &f $1 ] INCk ,&f STR
1169	DUP #20 LTH ?{
1170		POP [ LIT2 &callback $2 ] JMP2 }
1171	( | Fill )
1172	( color ) DUP #04 SFT #60 SFT
1173	( addr* ) #00 ROT #0f AND #30 SFT2 ;curtain/out-short ADD2 window/<fill>
1174	BRK
1175
1176@window/<set-size> ( w* h* -- )
1177	.Screen/height DEO2
1178	.Screen/width DEO2
1179	input/<redraw>
1180	/<update>
1181	( >> )
1182
1183@window/<draw-spacer> ( -- )
1184	#0000 #0018 Screen/<set-pos>
1185	;&wave .Screen/addr DEO2
1186	[ LIT2 01 -Screen/auto ] DEO
1187	/get-cols SUB [ LIT2r 41 -Screen/sprite ]
1188	&>l
1189		DEOkr
1190		INC DUP ?/>l
1191	POP POP2r JMP2r
1192
1193@window/<update> ( -- )
1194	.Screen/width DEI2 DUP2 #01 SFT2 ,&center STR2
1195	DUP2 #0010 SUB2 ,&margin STR2
1196	#03 SFT2 ,&cols STR2
1197	.Screen/height DEI2 DUP2 #01 SFT2 ,&middle STR2
1198	#03 SFT2 ,&rows STR2
1199	( | Load wallpaper )
1200	dir/find-wallpaper INC2k ORA ?{ POP2 JMP2r }
1201	#0009 ADD2 LDA2k ,&w STR2
1202	#0003 ADD2 LDA2 ,&h STR2
1203	;&path #03 !icn/<draw>
1204
1205	&get-center [ LIT2 &center $2 ] JMP2r
1206
1207	&get-cols [ LIT2 &cols $2 ] JMP2r
1208
1209	&get-middle [ LIT2 &middle $2 ] JMP2r
1210
1211	&get-rows [ LIT2 &rows $2 ] JMP2r
1212
1213	&get-margin [ LIT2 &margin $2 ] JMP2r
1214
1215	&path "wallpaper [ &w "00 "x &h "00 ] ".icn 00
1216
1217@window/<fill> ( color addr* -- )
1218	.Screen/addr DEO2
1219	STH
1220	[ LITr -Screen/sprite ]
1221	( | Draw )
1222	#0000 DUP2 Screen/<set-pos>
1223	[ LIT2 01 -Screen/auto ] DEO
1224	( h ) /get-cols SUB
1225	( v ) /get-rows SUB
1226	&>v
1227		OVR
1228		&>h
1229			DEOkr
1230			INC DUP ?/>h
1231		POP
1232		( | eos )
1233		#0000 .Screen/x DEO2
1234		.Screen/y DEI2k #0008 ADD2 ROT DEO2
1235		INC DUP ?/>v
1236	POP2 POP2r JMP2r
1237
1238(
1239@|Stdlib )
1240
1241@manifest/scan ( but key -- fn* )
1242	ORAk ?{ POP2 #ffff JMP2r }
1243	,&bk STR2
1244	;&dat
1245	&>cat
1246		DUP2 LDAk #00 SWP INC ADD2 SWP2 #0003 ADD2
1247		&>opt
1248			LDA2k [ LIT2 &bk $2 ] NEQ2 ?{
1249				NIP2 INC2 INC2 LDA2 JMP2r }
1250			#0006 ADD2 GTH2k ?/>opt
1251		POP2 INC2 LDAk ?/>cat
1252	POP2 #ffff JMP2r
1253
1254@file/get-meta ( path* -- addr* )
1255	#0000 ,&port-deo2 STR2
1256	( | lit2 addr* )
1257	.File/name DEO2
1258	#0001 .File/length DEO2
1259	;&lit2 .File/read DEO2
1260	#0002 .File/length DEO2
1261	;&addr .File/read DEO2
1262	.File/success-lb DEI ?{ #0000 JMP2r }
1263	( | lit port-deo2* )
1264	#0001 .File/length DEO2
1265	;&lit .File/read DEO2
1266	#0002 .File/length DEO2
1267	;&port-deo2 .File/read DEO2
1268	.File/success-lb DEI ?{ #0000 JMP2r }
1269	( a ) [ LIT2 &lit2 $1 &lit $1 ] #a080 EQU2
1270	( b ) [ LIT2 &port-deo2 $2 ] #0637 EQU2 AND ?{ #0000 JMP2r }
1271	[ LIT2 &addr $2 ] JMP2r
1272
1273@file/<seek> ( addr* -- )
1274	#0100 SUB2 .File/name DEI2k ROT DEO2
1275	#0000 INC2k .File/length DEO2
1276	&>lf
1277		;&b .File/read DEO2
1278		INC2 GTH2k ?/>lf
1279	POP2 POP2 JMP2r
1280
1281@file/seek-line ( line* -- not-eof )
1282	.File/name DEI2k ROT DEO2
1283	ORAk ?{ POP2 #01 JMP2r }
1284	#0001 .File/length DEO2
1285	[ LIT2r =&bs ] [ LITr -File/read ] #0000
1286	&>l
1287		DEO2kr
1288		[ LIT2 00 -File/success-lb ] DEI EQU ?{
1289			[ LIT2 &bs $1 0a ] NEQ ?{ INC2 }
1290			GTH2k ?/>l }
1291	POP2 POP2 POPr POP2r .File/success-lb DEI JMP2r
1292
1293@file/is-dir ( path* -- t )
1294	.File/name DEO2
1295	#0001 .File/length DEO2
1296	;&bf .File/stat DEO2
1297	[ LIT2 "- &bf $1 ] EQU JMP2r
1298
1299@file/is-oversized ( path* -- t )
1300	.File/name DEO2
1301	#0004 .File/length DEO2
1302	;&bufstat .File/stat DEO2
1303	;&bufstat LDA LIT "? EQU JMP2r
1304	&bufstat $5
1305
1306@file/is-text ( path* -- t )
1307	.File/name DEO2
1308	#0001 .File/length DEO2
1309	#00
1310	&>st
1311		;&b .File/read DEO2
1312		( | tests )
1313		.File/success-lb DEI ?{ JMP2r }
1314		POP #01 [ LIT &b $1 ] chr/is-ascii ?/>st
1315	POP #00 JMP2r
1316
1317@file/exists ( path* -- t )
1318	.File/name DEO2
1319	#0001 .File/length DEO2
1320	;&e .File/stat DEO2
1321	[ LIT &e $1 ]
1322	( not folder ) DUP LIT "- NEQ
1323	( not missing ) SWP LIT "! NEQ AND JMP2r
1324
1325@file/<cpy> ( src* dst* -- )
1326	.File2/name DEO2
1327	#0001 .File2/length DEO2
1328	.File/name DEO2
1329	#0001 .File/length DEO2
1330	&>s
1331		;&b .File/read DEO2
1332		.File/success-lb DEI ?{ JMP2r }
1333		;&b .File2/write DEO2 !/>s
1334
1335@chr/hex ( c -- val )
1336	( dec ) [ LIT "0 ] SUB DUP #09 GTH [ JMP JMP2r ]
1337	( hex ) #27 SUB DUP #0a SUB #05 GTH [ JMP JMP2r ]
1338	( nil ) POP #ff JMP2r
1339
1340@chr/n-0 ( c -- c )
1341	POP #00 JMP2r
1342
1343@chr/t-tab ( c -- c )
1344	POP #09 JMP2r
1345
1346@chr/n-lb ( c -- c )
1347	POP #0a JMP2r
1348
1349@chr/t-ws ( c -- c )
1350	POP #20 JMP2r
1351
1352@chr/is-ascii ( c -- t )
1353	DUP #08 GTH SWP #7f LTH AND JMP2r
1354
1355@str/read-byte ( a b -- byte )
1356	chr/hex SWP chr/hex #40 SFT ORA JMP2r
1357
1358@str/is-dir ( str* -- t )
1359	/cap #0001 SUB2 LDA LIT "/ EQU JMP2r
1360
1361@str/is-icn ( str* -- t )
1362	/cap #0004 SUB2 ;dict/icn-ext !/cmp
1363
1364@str/is-rom ( str* -- t )
1365	/cap #0004 SUB2 ;dict/rom-ext !/cmp
1366
1367@str/is-wallpaper ( str* -- str* t )
1368	DUP2 #0009 ;dict/wallpaper mem/cmp ?{ #00 JMP2r }
1369	DUP2 /is-icn ?{ #00 JMP2r }
1370	#01 JMP2r
1371
1372@str/<print> ( str* -- )
1373	LDAk DUP ?{ POP POP2 JMP2r }
1374	#18 DEO
1375	INC2 !/<print>
1376
1377@str/escape ( addr* c -- addr* c )
1378	DUP [ LIT "\ ] NEQ ?{
1379		POP INC2 LDAk
1380		( | handlers )
1381		DUP [ LIT "0 ] EQU ?chr/n-0
1382		DUP [ LIT "t ] EQU ?chr/t-tab
1383		DUP [ LIT "n ] EQU ?chr/n-lb
1384		DUP [ LIT "s ] EQU ?chr/t-ws }
1385	JMP2r
1386
1387@str/is-word ( str* -- t )
1388	&>wiw
1389		LDAk DUP ?{ POP POP2 #01 JMP2r }
1390		#20 GTH ?{ POP2 #00 JMP2r }
1391		INC2 !/>wiw
1392
1393@str/eol ( str* -- eol* )
1394	&>we
1395		LDAk DUP ?{ POP JMP2r }
1396		#0a NEQ ?{ JMP2r }
1397		INC2 !/>we
1398
1399@str/cap ( str* -- end* )
1400	LDAk ?{ JMP2r }
1401	INC2 !/cap
1402
1403@str/len ( str* -- len* )
1404	STH2k /cap STH2r SUB2 JMP2r
1405
1406@str/cmp ( a* b* -- f )
1407	STH2
1408	&>wc
1409		LDAk ?{ &d LDA LDAr STHr EQU JMP2r }
1410		LDAk LDAkr STHr NEQ ?/d
1411		INC2 INC2r !/>wc
1412
1413@str/hex ( str* -- value* )
1414	[ LIT2r 0000 ]
1415	&>wh
1416		[ LITr 40 ] SFT2r LDAk chr/hex [ LITr 00 ] STH
1417		ADD2r INC2 LDAk ?/>wh
1418	POP2 STH2r JMP2r
1419
1420@str/dec ( str* -- val* )
1421	LDAk [ LIT "- ] NEQ ?/dec-unsigned
1422	INC2 /dec-unsigned #0000 SWP2 SUB2 JMP2r
1423
1424@str/dec-unsigned ( str* -- val* )
1425	[ LIT2r 0000 ] !{
1426
1427	&>ldec
1428		[ LITr 00 ] STH
1429		MUL2r [ LITr 00 ] STH
1430		ADD2r INC2 }
1431	( str* . val* ) LDAk [ LIT "0 ] SUB #0a LTHk ?/>ldec
1432	POP2 POP2 STH2r JMP2r
1433
1434@str/walk-ws ( str* -- str* )
1435	&>ws
1436		LDAk ?{ JMP2r }
1437		LDAk #20 GTH ?{ INC2 LDAk ?/>ws }
1438	JMP2r
1439
1440@str/walk-zero ( str* -- str* )
1441	&>wz
1442		LDAk ?{ JMP2r }
1443		LDAk LIT "0 NEQ ?{ INC2 LDAk ?/>wz }
1444	JMP2r
1445
1446@str/seg ( str* seg* -- bool )
1447	DUP2 /len SWP2 !mem/cmp
1448
1449@mem/cmp ( a* length* b* -- t )
1450	STH2
1451	OVR2 ADD2 SWP2
1452	&>l
1453		EQU2k ?{
1454			LDAk LDAkr STHr NEQ ?{ INC2 INC2r !/>l } }
1455	POP2r EQU2 JMP2r
1456
1457@date/make ( -- str* )
1458	;&buf DUP2 ,&+ptr STR2
1459	( | Make string )
1460	[ LIT2 00 -DateTime/dotw ] DEI #20 SFT ;dict/days ADD2 /<push-str>
1461	[ LIT ", ] /<push>
1462	#20 /<push>
1463	[ LIT2 00 -DateTime/day ] DEI /<push-dec>
1464	#20 /<push>
1465	[ LIT2 00 -DateTime/month ] DEI #20 SFT ;dict/months ADD2 /<push-str>
1466	#20 /<push>
1467	.DateTime/year DEI2 !/<push-dec>
1468
1469@date/<push-dec> ( short* -- )
1470	#2710 [ LIT2r 00fb ]
1471	&>wpd
1472		DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{ DUP /<push-digit>
1473			INCr }
1474		POP2 #000a DIV2 SWPr INCr STHkr ?/>wpd
1475	POP2r POP2 POP2 JMP2r
1476
1477@date/<push-digit> ( d -- )
1478	LIT "0 ADD
1479	( >> )
1480
1481@date/<push> ( c -- )
1482	#00 [ LIT2 &+ptr =&buf ] INC2k ,&+ptr STR2
1483	STA2
1484	JMP2r
1485
1486@date/<push-str> ( str* -- )
1487	&>w
1488		LDAk DUP ?{ POP POP2 JMP2r }
1489		/<push>
1490		INC2 !/>w
1491
1492@time/make ( -- str* )
1493	;&buf DUP2 ,&+ptr STR2
1494	( | Make string )
1495	.DateTime/hour DEI /<push-dec>
1496	LIT ": /<push>
1497	.DateTime/minute DEI /<push-dec>
1498	LIT ": /<push>
1499	.DateTime/second DEI !/<push-dec>
1500
1501@time/<push-dec> ( u8 -- )
1502	DUP #0a DIV /<push-digit>
1503	#0a DIVk MUL SUB
1504	( >> )
1505
1506@time/<push-digit> ( d -- )
1507	LIT "0 ADD
1508	( >> )
1509
1510@time/<push> ( c -- )
1511	#00 [ LIT2 &+ptr =&buf ] INC2k ,&+ptr STR2
1512	STA2
1513	JMP2r
1514
1515@banner/<request> ( -- )
1516	[ LIT2 00 _&skip ] STR
1517	JMP2r
1518
1519@banner/<draw> ( -- )
1520	;bios/anchor-x DUP2 ,&x STR2
1521	.Screen/y DEI2 #0018 ADD2 DUP2 ,&y STR2
1522	Screen/<set-pos>
1523	sel/has-meta ?meta/<draw>
1524	[ LIT2 66 -Screen/auto ] DEO
1525	;&asset .Screen/addr DEO2
1526	[ LIT2 45 -Screen/sprite ] DEOk DEO
1527	.Screen/vector DEI2 ORA ?{
1528		[ LIT &skip 00 ] ?{
1529			[ LIT2 00 _&f ] STR
1530			[ LIT2 01 _&skip ] STR
1531			;&on-frame .Screen/vector DEO2 } }
1532	JMP2r
1533
1534@banner/on-frame ( -> )
1535	[ LIT &f $1 ] INCk ,&f STR
1536	DUP #20 LTH ?{
1537		POP #0000 .Screen/vector DEO2
1538		BRK }
1539	#01 SFT [ LIT2 &x $2 ] [ LIT2 &y $2 ] Screen/<set-pos>
1540	[ LIT2 66 -Screen/auto ] DEO
1541	;&asset .Screen/addr DEO2
1542	[ LIT2 45 -Screen/sprite ] DEOk DEO
1543	( | mask )
1544	.Screen/y DEI2k #0010 SUB2 ROT DEO2
1545	[ LIT2 15 -Screen/auto ] DEO
1546	#0010 ROT SUB #30 SFT2 ;curtain/out ADD2 .Screen/addr DEO2
1547	[ LIT2 40 -Screen/sprite ] DEOk DEOk DEOk DEOk DEOk DEOk DEO
1548	BRK
1549
1550@banner/<load> ( -- )
1551	#0070 .File/length DEO2
1552	;&asset .File/read DEO2
1553	JMP2r
1554
1555@meta/<load> ( addr* -- )
1556	file/<seek>
1557	;&buflen .File/length DEO2
1558	;&buf .File/read DEO2
1559	;&body str/cap INC2
1560	( | parse fields )
1561	[ LIT2 00 _&has-icon ] STR
1562	LDAk #00 SWP #0003 MUL2 OVR2 INC2 ADD2 SWP2 INC2
1563	&>l
1564		LDAk #83 NEQ ?{
1565			( | Load icon )
1566			INC2k LDA2 file/<seek>
1567			#0090 .File/length DEO2
1568			;&icon .File/read DEO2
1569			[ LIT2 90 -File/success-lb ] DEI EQU ,&has-icon STR }
1570		#0003 ADD2 GTH2k ?/>l
1571	POP2 POP2 JMP2r
1572
1573@meta/<draw> ( -- )
1574	/<draw-icon>
1575	.Screen/x DEI2 #0020 ADD2 .Screen/y DEI2 #0018 SUB2 Screen/<set-pos>
1576	#0028 ;font/anchor STA2
1577	;&body #41 font/<draw-str-color>
1578	;bios/anchor-x ;font/anchor STA2
1579	JMP2r
1580
1581@meta/<draw-icon> ( -- )
1582	[ LIT &has-icon $1 ] ?{
1583		;&no-icon .Screen/addr DEO2
1584		[ LIT2 22 -Screen/auto ] DEO
1585		[ LIT2 c5 -Screen/sprite ] DEOk DEOk DEO
1586		JMP2r }
1587	;&icon .Screen/addr DEO2
1588	[ LIT2 26 -Screen/auto ] DEO
1589	[ LIT2 c5 -Screen/sprite ] DEOk DEOk DEO
1590	JMP2r
1591
1592@theme/<reset> ( -- )
1593	#f0a8 #f0ec #f0b9
1594	( >> )
1595
1596@theme/<set> ( r* g* b* -- )
1597	.System/b DEO2
1598	.System/g DEO2
1599	.System/r DEO2
1600	JMP2r
1601
1602@theme/<load> ( -- )
1603	;&path .File/name DEO2
1604	#0002 .File/length DEO2
1605	;&r .File/read DEO2
1606	;&g .File/read DEO2
1607	;&b .File/read DEO2
1608	.File/success-lb DEI ?{ !/<reset> }
1609	banner/<load>
1610	[ LIT2 &r $2 ] [ LIT2 &g $2 ] [ LIT2 &b $2 ] !/<set>
1611
1612	&path ".theme 00
1613
1614(
1615@|Assets )
1616
1617@dict/m_pc "M/PC 00
1618	&ready2 "Type 20 "<cmd> 20 "to 20 "see 20 "options. 00
1619	&home-path "./ 00
1620	&sel-prev "Selection 20 "Previous 00
1621	&sel-next "Selection 20 "Next 00
1622	&sel-pick "Pick 20 "Selection 00
1623	&clear "Clear 20 "Input 00
1624	&directory "Directory 00
1625	&wallpaper "wallpaper 00
1626	&input "Input 00
1627	&eval "Run 00
1628	&eof "eof 00
1629	&scroll-up "Scroll 20 "Up 00
1630	&scroll-down "Scroll 20 "Down 00
1631	&eval-partial "Non-Destructive 20 "Run 00
1632	&out-path "../ 00
1633	&icn-ext ".icn 00
1634	&rom-ext ".rom 00
1635	&dir "dir 00
1636	&mov "mov 00
1637	&run "run 00
1638	&txt "txt 00
1639	&put "put 00
1640	&era "era 00
1641	&ren "ren 00
1642	&get "get 00
1643	&cmd "cmd 00
1644	&len "len 00
1645	&dup "dup 00
1646	&ovr "ovr 00
1647	&swp "swp 00
1648	&rot "rot 00
1649	&pop "pop 00
1650	&now "now 00
1651	&cat "cat 00
1652	&icn "icn 00
1653	&cpy "cpy 00
1654	&zero "0 00
1655	&t "<true> 00
1656	&f "<false> 00
1657	&ok "<ok> 00
1658	&err-underflow "<underflow> 00
1659	&err-missing "<missing> 00
1660	&err-binary "<binary> 00
1661	&months [
1662	"Jan $1 "Feb $1 "Mar $1 "Apr $1
1663	"May $1 "Jun $1 "Jul $1 "Aug $1
1664	"Sep $1 "Oct $1 "Nov $1 "Dec $1 ]
1665	&days [
1666	"Sun $1 "Mon $1 "Tue $1 "Wed $1
1667	"Thu $1 "Fri $1 "Sat $1 ]
1668
1669@window/wave [ 0000 0000 0070 8807 ]
1670
1671@input/caret [ 0020 2020 2020 2020 2020 2020 2020 0000 ]
1672
1673@curtain/out [
1674	0000 0000 0000 0000 0000 0000 0000 0000
1675	0000 0000 0000 0000 0000 0000 0000 0000
1676	0000 0000 0000 0000 0000 0000 0000 0000
1677	0000 0000 0000 0000 0000 0000 0000 0000
1678	0000 0000 0000 0000 0000 0000 0000 0000
1679	0000 0000 0000 0000 0000 0000 0000 0000
1680	0000 0000 0000 0002 0000 0000 0000 0002 ]
1681	&out-short [
1682	0000 0022 0000 0022 0000 0022 0000 0022
1683	0088 0022 0088 0022 0088 0022 0088 0022
1684	00aa 00aa 00aa 00aa 00aa 00aa 00aa 00aa
1685	44aa 11aa 44aa 11aa 44aa 11aa 44aa 11aa
1686	aa55 aa55 aa55 aa55 aa55 aa55 aa55 aa55
1687	aa77 aadd aa77 aadd aa77 aadd aa77 aadd
1688	aaff aaff aaff aaff aaff aaff aaff aaff
1689	bbff eeff bbff eeff bbff eeff bbff eeff
1690	bbff ffff bbff ffff bbff ffff bbff ffff
1691	ffff ffff ffff ffff ffff ffff ffff ffff ]
1692
1693@appicon [
1694	0000 0000 0000 0001 0000 0000 0000 0000
1695	0000 0000 0000 0080 0000 0000 0000 0000
1696	0000 0000 0000 0038 0000 0000 0000 0000
1697	070f 0f1f 1f0f 0f07 0000 0000 0000 0000
1698	e0f0 f0f8 f8f1 f1e3 0000 0000 0000 0000
1699	3870 70e0 e0c0 c080 0000 0000 0000 0000
1700	0100 0000 0000 0000 0000 0000 0000 0000
1701	8300 0000 0000 0000 0000 0000 0000 0000
1702	8000 0000 0000 0000 0000 0000 0000 0000 ]
1703
1704@banner/asset [
1705	000f 3f7f 7fff ffff 00c0 f0f8 f8fc fcfc
1706	000e 0e1c 1c38 3870 00ff ffff e0e0 e0e0
1707	00f0 fcfc 1e0e 0e1e 001f 7f7f f0e0 e0e0
1708	00f0 fcfc 1e0e 0e00 ffff ff7f 7f3f 0f00
1709	fcfc fcf9 f9f3 c300 70e0 e0c0 c080 8000
1710	ffff ffe0 e0e0 e000 fcfc f000 0000 0000
1711	e0e0 e0f0 7f7f 1f00 000e 0e1e fcfc f000 ]
1712
1713@meta/no-icon [ cccc 3333 cccc 3333 ]
1714
1715@font/glyphs [
1716	0000 0000 0000 0000 0000 0000 0000 0000
1717	0000 1010 1020 2020 2000 4040 0000 0000
1718	0000 0050 5000 0000 0000 0000 0000 0000
1719	0000 0024 24fc 4848 fc90 9000 0000 0000
1720	0000 083c 4a50 5030 2828 48f0 4000 0000
1721	0000 1129 2a14 0810 2854 9488 0000 0000
1722	0000 1824 2428 3052 9488 8876 0000 0000
1723	0000 0040 4000 0000 0000 0000 0000 0000
1724	0004 0808 1010 2020 2020 2010 1000 0000
1725	0020 2010 1010 1010 2020 4040 8000 0000
1726	0000 0024 187e 1824 0000 0000 0000 0000
1727	0000 0000 0010 107c 1010 0000 0000 0000
1728	0000 0000 0000 0000 0000 0020 2040 0000
1729	0000 0000 0000 007c 0000 0000 0000 0000
1730	0000 0000 0000 0000 0000 0010 0000 0000
1731	0001 0102 0404 0810 2020 4080 8000 0000
1732	0000 1824 4444 8484 8888 9060 0000 0000
1733	0000 0818 2810 1010 1020 2070 0000 0000
1734	0000 1c22 0204 0810 2040 80f8 0000 0000
1735	0000 1c22 0204 1804 0404 8870 0000 0000
1736	0000 0408 0810 2848 fc10 1010 0000 0000
1737	0000 3e20 2078 4404 0404 8870 0000 0000
1738	0000 0c10 2040 58e4 8484 8870 0000 0000
1739	0000 3e02 0408 1010 2020 4040 0000 0000
1740	0000 1c22 4244 3844 8484 8870 0000 0000
1741	0000 1c22 4242 463c 0408 1060 0000 0000
1742	0000 0000 0000 4000 0000 0040 0000 0000
1743	0000 0000 0000 2000 0000 0020 2040 0000
1744	0000 0000 0008 1020 4020 1008 0000 0000
1745	0000 0000 0000 007c 0000 7c00 0000 0000
1746	0000 0000 0040 2010 0810 2040 0000 0000
1747	0000 003c 4242 0408 1010 0010 0000 0000
1748	0000 0000 1e21 4e52 524f 201c 0000 0000
1749	0000 0c0c 1414 2424 7c44 8484 0000 0000
1750	0000 1e11 1122 3c22 2242 4478 0000 0000
1751	0000 0e11 2020 4040 4040 4438 0000 0000
1752	0000 3c22 2242 4242 4484 88f0 0000 0000
1753	0000 1f10 1020 3c20 2040 407c 0000 0000
1754	0000 1f10 1020 3c20 2040 4040 0000 0000
1755	0000 0e11 2020 404e 4244 443c 0000 0000
1756	0000 2121 2142 7e42 4284 8484 0000 0000
1757	0000 1f04 0408 0808 0810 107c 0000 0000
1758	0000 0702 0204 0404 0488 8870 0000 0000
1759	0000 2122 2448 7050 4888 8484 0000 0000
1760	0000 1010 1020 2020 2040 407c 0000 0000
1761	0000 2121 3356 5a5a 4284 8484 0000 0000
1762	0000 2121 3152 524a 4a8c 8484 0000 0000
1763	0000 0e11 2121 4141 4242 4438 0000 0000
1764	0000 1e11 1121 223c 2040 4040 0000 0000
1765	0000 0e11 2121 4141 4252 5438 0600 0000
1766	0000 1e11 1122 3c30 2848 4444 0000 0000
1767	0000 1e21 2020 1008 0404 8478 0000 0000
1768	0000 7f08 0810 1010 1020 2020 0000 0000
1769	0000 2121 4142 4242 8284 8478 0000 0000
1770	0000 2121 2222 2424 2828 3030 0000 0000
1771	0000 2121 2122 2a5a 6a6c 4444 0000 0000
1772	0000 2121 1214 1818 2848 8484 0000 0000
1773	0000 2121 1212 1408 0810 1010 0000 0000
1774	0000 3f01 0204 0810 2040 80fc 0000 0000
1775	001e 1010 1020 2020 2040 4040 7800 0000
1776	0040 4040 2020 2010 1010 0808 0800 0000
1777	0078 0808 0810 1010 1020 2020 e000 0000
1778	0000 0020 5000 0000 0000 0000 0000 0000
1779	0000 0000 0000 0000 0000 00f8 0000 0000
1780	0000 0040 2000 0000 0000 0000 0000 0000
1781	0000 0000 001e 2222 4444 4c32 0000 0000
1782	0000 3010 102c 3222 2244 4438 0000 0000
1783	0000 0000 001c 2220 4040 4438 0000 0000
1784	0000 0101 011e 2222 4244 4c32 0000 0000
1785	0000 0000 001c 2224 7840 4438 0000 0000
1786	0000 0304 0808 3e08 1010 1010 2020 4000
1787	0000 0000 001e 2222 4444 4c34 0848 7000
1788	0000 3010 102e 3222 2244 4446 0000 0000
1789	0000 0404 000c 1808 0810 121c 0000 0000
1790	0000 0404 000c 1808 0808 1010 1020 c000
1791	0000 1010 102e 3222 3c48 4442 0000 0000
1792	0000 0c04 0408 0808 0810 1418 0000 0000
1793	0000 0000 00b7 4949 4992 9293 0000 0000
1794	0000 0000 006e 3222 2244 4446 0000 0000
1795	0000 0000 001c 2222 4244 4438 0000 0000
1796	0000 0000 002c 7222 2244 4478 4080 8000
1797	0000 0000 001a 2622 4244 4c34 0808 0800
1798	0000 0000 0016 3a10 1020 2020 0000 0000
1799	0000 0000 001c 2220 1804 4438 0000 0000
1800	0000 0008 083e 0810 1010 2418 0000 0000
1801	0000 0000 0062 2222 4244 4c32 0000 0000
1802	0000 0000 0062 2222 2224 2830 0000 0000
1803	0000 0000 0061 2141 495a 6644 0000 0000
1804	0000 0000 0031 120c 0818 2446 0000 0000
1805	0000 0000 0062 2222 4444 4c34 0848 7000
1806	0000 0000 001d 2204 0810 2052 0c00 0000
1807	0006 0808 0810 6010 1020 2020 1800 0000
1808	0000 1010 1020 2020 2040 4040 0000 0000
1809	0030 0808 0810 100c 1020 2020 c000 0000
1810	0000 0000 0000 0032 4c00 0000 0000 0000 ]
1811	&tab [ 0000 0000 0008 0c7e 0c08 0000 0000 0000 ]
1812
1813@kbd/glyphs [
1814	0000 0000 0000 0000 0808 1010 1000 2000
1815	2448 0000 0000 0000 0a14 7e28 fc50 a000
1816	083c 5238 14a8 7020 44a8 4810 242a 4400
1817	1824 4862 9c88 7000 1020 0000 0000 0000
1818	0408 1020 2020 1008 2010 0808 0810 2040
1819	0050 2050 0000 0000 0000 2020 f820 2000
1820	0000 0000 0010 1020 0000 0000 7c00 0000
1821	0000 0000 0000 1000 0808 1010 2020 4040
1822	0c12 2242 4448 3000 0c04 0808 0810 1000
1823	0c12 0408 1020 7800 0e02 0418 0448 3000
1824	060a 1424 3e08 0800 1e20 3804 0448 3000
1825	0c12 2038 4448 3000 3e04 0810 2040 4000
1826	0c12 2418 2448 3000 0c12 221c 0448 3000
1827	0000 1000 0010 0000 0000 1000 0010 1020
1828	0000 0810 2010 0800 0000 7c00 7c00 0000
1829	0000 2010 0810 2000 3844 0418 2000 4000
1830	0c12 2e54 5844 3000 1c22 2244 7c88 8800
1831	3c22 4478 4488 f000 1c22 4040 8088 7000
1832	3c22 4244 4488 f000 3e20 4078 4080 f800
1833	3e20 4078 4080 8000 1c22 4040 9c88 7000
1834	2222 447c 4488 8800 1c08 1010 2020 7000
1835	0e04 0808 1090 6000 2224 4870 5090 8800
1836	1010 2020 2040 7c00 2236 4c44 4488 8800
1837	2222 6454 4c88 8800 1c22 4244 8488 7000
1838	3c22 4478 4080 8000 1c22 4244 9488 7400
1839	3c22 4478 4488 8800 1c22 4038 0488 7000
1840	7c10 2020 2040 4000 2222 4444 8888 7000
1841	4444 4448 5020 2000 2222 4454 a8a8 5000
1842	2224 2810 2848 8800 4448 5020 2040 4000
1843	3e04 0810 2040 f800 0c08 0810 1020 2030
1844	2020 2010 1008 0808 1808 1010 1020 2060
1845	2050 8800 0000 0000 0000 0000 0000 f800
1846	4020 1000 0000 0000 0000 1a24 4448 3400
1847	1020 3824 4448 3000 0000 1824 4048 3000
1848	0202 1a24 4448 3400 0000 1824 7840 3000
1849	0608 3c10 1020 20c0 0000 1a24 4838 9060
1850	1020 2834 2448 4800 0400 1808 1028 3000
1851	0400 1808 1010 20c0 1020 2834 2850 4800
1852	1808 1010 2028 3000 0000 542a 2a54 5400
1853	0000 2c32 2244 4400 0000 1824 4448 3000
1854	0000 2c12 2458 4040 0000 1a24 4c34 0408
1855	0000 2834 2040 4000 0000 1824 1048 3000
1856	0810 3c10 2028 3000 0000 2424 4858 2800
1857	0000 6424 4850 6000 0000 622a 5454 2800
1858	0000 2458 1034 4800 0000 2424 4838 9060
1859	0000 3448 1024 5800 0c10 1060 2040 4020
1860	1010 1010 1010 1010 0804 0408 0c10 1060
1861	0000 0032 4c00 0000 0000 0000 0000 0000 ]
1862	&a [ 0000 0001 0204 0810 1008 0402 0100 0000 ]
1863	&b [ 0000 ff00 0000 0000 0000 0000 00ff 0000 ]
1864	&c [ 0000 0080 4020 1008 0810 2040 8000 0000 ]
1865
1866(
1867@|Buffer )
1868
1869@len/buf &hb $2 &lb $2 00
1870
1871@dec/buf $6
1872
1873@hex/buf $6
1874
1875@icn/buf $8
1876
1877@date/buf $12
1878
1879@time/buf $a
1880
1881@symbol/buf $20
1882
1883@loader/page $&pagelen
1884
1885@meta/buf $1 &body $&buflen &cap 0000 &icon $90
1886
1887@path/buf $&buflen &cap 0000
1888
1889@dir/buf $&buflen 0000
1890
1891@bios/buf $&buflen &cap 0000
1892
1893@dict/buf
1894