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