(meta) General improvements

This commit is contained in:
neauoire 2023-11-17 11:19:58 -08:00
parent 40fd28b1d8
commit 2c6e19ed2f
1 changed files with 50 additions and 43 deletions

View File

@ -19,35 +19,34 @@
#0150 .Screen/width DEO2 #0150 .Screen/width DEO2
#0050 .Screen/height DEO2 #0050 .Screen/height DEO2
;await-src .Console/vector DEO2 ;await-src .Console/vector DEO2
;dict/input <pstr> ;dict/input <pstr-ln>
BRK BRK
@meta @meta
00 00
( name ) "Meta 0a ( name ) "Meta 0a
( details ) "A 20 "ROM 20 "metadata 20 "viewer 0a ( details ) "A 20 "Metadata 20 "Viewer 0a
( author ) "By 20 "Devine 20 "Lu 20 "Linvega 0a ( author ) "By 20 "Devine 20 "Lu 20 "Linvega 0a
( date ) "Apr 20 "4, 20 "2023 00 01 ( date ) "17 20 "Nov 20 "2023 $1
03
( skip ) 00 abcd
( skip ) 01 ef01
( icon ) 83 =appicon ( icon ) 83 =appicon
( (
@|vectors ) @|vectors )
@await-src ( -> ) @await-src ( -> )
.Console/read DEI .src skey ?on-ready .Console/read DEI .src skey ?{ BRK }
BRK ;src has-metadata ?{
@on-ready ( -> )
;src DUP2 <pstr>
#0a18 DEO
has-metadata ?&>has-metadata
#004c .Screen/x DEO2 #004c .Screen/x DEO2
#0024 .Screen/y DEO2 #0024 .Screen/y DEO2
;dict/empty <draw-txt> ;dict/empty <draw-txt>
POP2 BRK &>has-metadata BRK }
load-metadata ;metadata/body <pstr> <load-metadata>
#0a18 DEO ;metadata/body DUP2
<draw-metadata> ( cli ) <pstr-ln>
( gui ) <draw-metadata>
BRK BRK
( (
@ -59,8 +58,8 @@
;metadata/header .File/read DEO2 ;metadata/header .File/read DEO2
;metadata/deo LDA2 #0637 EQU2 JMP2r ;metadata/deo LDA2 #0637 EQU2 JMP2r
@load-metadata ( -- ) @<load-metadata> ( -- )
;metadata/start LDA2 #0100 SUB2 seek ;metadata/start LDA2 #0100 SUB2 <seek>
( | version ) ( | version )
#0001 .File/length DEO2 #0001 .File/length DEO2
;metadata/version .File/read DEO2 ;metadata/version .File/read DEO2
@ -71,7 +70,7 @@
INC2r LDA ?&s INC2r LDA ?&s
POP2r POP2r
( | fields ) ( | fields )
;metadata/fields DUP2 .File/read DEO2 ;metadata/length DUP2 .File/read DEO2
LDAk #03 MUL #00 SWP .File/length DEO2 LDAk #03 MUL #00 SWP .File/length DEO2
INC2 .File/read DEO2 INC2 .File/read DEO2
JMP2r JMP2r
@ -79,29 +78,30 @@
( (
@|drawing ) @|drawing )
@<draw-metadata> ( -- ) @<draw-metadata> ( body* -- )
#004c .Screen/x DEO2 #004c .Screen/x DEO2
#0012 .Screen/y DEO2 #0012 .Screen/y DEO2
;metadata/body <draw-txt> <draw-txt>
POP2
( | find picture ) ( | find picture )
;metadata/fields LDAk LITr 00 STH INC2 DUP2 STH2r ADD2 SWP2 ;metadata/length LDA #00
&l ( -- ) &l ( -- )
LDAk #83 NEQ ?&>no-pict [ LIT2 09 18 ] DEO
INC2k LDA2 #0100 SUB2 <draw-icon> &>no-pict #00 OVR #03 MUL ;metadata/fields ADD2
INC2 GTH2k ?&l ( icon ) LDAk #83 NEQ ?{ INC2k LDA2 <draw-icon> }
POP2 POP2 JMP2r ( byte ) LDAk phex/b #2018 DEO
( shorts ) INC2 LDA2 phex #0a18 DEO
INC GTHk ?&l
POP2 JMP2r
@<draw-icon> ( location* -- ) @<draw-icon> ( location* -- )
seek #0090 .File/length DEO2 #0100 SUB2 <seek>
#0090 .File/length DEO2
;metadata/icon DUP2 .File/read DEO2 ;metadata/icon DUP2 .File/read DEO2
.Screen/addr DEO2 .Screen/addr DEO2
[ LIT2 26 -Screen/auto ] DEO [ LIT2 26 -Screen/auto ] DEO
#001c DUP2 .Screen/x DEO2 #001c DUP2 .Screen/x DEO2
.Screen/y DEO2 .Screen/y DEO2
[ LIT2 81 -Screen/sprite ] DEOk [ LIT2 81 -Screen/sprite ] DEOk DEOk DEO
DEOk
DEO
JMP2r JMP2r
@<draw-txt> ( txt* -- end* ) @<draw-txt> ( txt* -- end* )
@ -110,16 +110,16 @@
&w ( -- ) &w ( -- )
LDAk #20 SUB #00 SWP #30 SFT2 ;font ADD2 .Screen/addr DEO2 LDAk #20 SUB #00 SWP #30 SFT2 ;font ADD2 .Screen/addr DEO2
[ LIT2 02 -Screen/sprite ] DEO [ LIT2 02 -Screen/sprite ] DEO
LDAk #0a NEQ ?&>no-lb LDAk #0a NEQ ?{
[ LIT2 &anchor $2 ] .Screen/x DEO2 [ LIT2 &anchor $2 ] .Screen/x DEO2
.Screen/y DEI2k #000c ADD2 ROT DEO2 &>no-lb .Screen/y DEI2k #000c ADD2 ROT DEO2 }
INC2 LDAk ?&w INC2 LDAk ?&w
JMP2r POP2 JMP2r
( (
@|stdlib ) @|stdlib )
@seek ( length* -- ) @<seek> ( length* -- )
.File/name DEI2k ROT DEO2 .File/name DEI2k ROT DEO2
#0000 INC2k .File/length DEO2 #0000 INC2k .File/length DEO2
&l ( -- ) &l ( -- )
@ -129,13 +129,12 @@
&b $1 &b $1
@scap ( str* -- end* ) @scap ( str* -- end* )
!&a
&w ( -- ) &w ( -- )
INC2 &a LDAk ?&w INC2 & LDAk ?&w
JMP2r JMP2r
@sput ( chr str* -- ) @sput ( chr str* -- )
scap STA scap/ STA
JMP2r JMP2r
@skey ( key buf -- proc ) @skey ( key buf -- proc )
@ -143,11 +142,20 @@
#00 SWP sput #00 JMP2r #00 SWP sput #00 JMP2r
&eval POP2 #01 JMP2r &eval POP2 #01 JMP2r
@<pstr> ( str* -- ) @phex ( short* -- )
SWP phex/b
&b ( -- )
DUP #04 SFT phex/c
&c ( -- )
#0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO
JMP2r
@<pstr-ln> ( str* -- )
&w ( -- ) &w ( -- )
LDAk #18 DEO LDAk #18 DEO
INC2 LDAk ?&w INC2 LDAk ?&w
POP2 JMP2r POP2 #0a18 DEO
JMP2r
( (
@|assets ) @|assets )
@ -155,8 +163,7 @@
@dict &input "Input(.tal): 20 $1 @dict &input "Input(.tal): 20 $1
&empty "Metadata 20 "Missing $1 &empty "Metadata 20 "Missing $1
@appicon ( 3x3 ) @appicon [
[
0000 3f20 2020 2020 ffff ffff ffff ffff 0000 3f20 2020 2020 ffff ffff ffff ffff
0000 ff18 0000 0000 ffff ffff ffff ffff 0000 ff18 0000 0000 ffff ffff ffff ffff
0000 fc04 0404 0404 ffff ffff ffff ffff 0000 fc04 0404 0404 ffff ffff ffff ffff
@ -167,8 +174,7 @@
0000 0000 18ff 0000 ffff ffff ffff ffff 0000 0000 18ff 0000 ffff ffff ffff ffff
0404 0404 04fc 0000 ffff ffff ffff ffff ] 0404 0404 04fc 0000 ffff ffff ffff ffff ]
@font ( atari8 ) @font [
[
0000 0000 0000 0000 6060 6060 6000 6000 0000 0000 0000 0000 6060 6060 6000 6000
6666 6600 0000 0000 006c fe6c 6cfe 6c00 6666 6600 0000 0000 006c fe6c 6cfe 6c00
183e 603c 067c 1800 0066 6c18 3066 4600 183e 603c 067c 1800 0066 6c18 3066 4600
@ -223,6 +229,7 @@
&deo $2 &deo $2
&version $1 &version $1
&body $100 &body $100
&fields $100 &length $1
&fields $ff
&icon $90 &icon $90