Added meta

This commit is contained in:
neauoire 2023-11-27 15:27:49 -08:00
parent 40dfc6e25b
commit c037f6d9a1
2 changed files with 37 additions and 15 deletions

View File

@ -2,12 +2,12 @@
ID="tgachr" ID="tgachr"
ASM="uxncli $HOME/roms/drifblim.rom" ASM="uxncli $HOME/roms/drifblim.rom"
EMU="uxncli" EMU="uxnemu"
LIN="uxncli $HOME/roms/uxnlin.rom" LIN="uxncli $HOME/roms/uxnlin.rom"
SRC="${ID}.tal" SRC="${ID}.tal"
DST="${ID}.rom" DST="${ID}.rom"
CPY="$HOME/roms" CPY="$HOME/roms"
ARG="pict.tga" ARG="pict3.tga"
if [[ "$*" == *"--lint"* ]] if [[ "$*" == *"--lint"* ]]
then then

View File

@ -17,6 +17,7 @@
|0100 |0100
@on-reset ( -> ) @on-reset ( -> )
;meta #06 DEO2
( | theme ) ( | theme )
#26ae .System/r DEO2 #26ae .System/r DEO2
#26ae .System/g DEO2 #26ae .System/g DEO2
@ -28,6 +29,13 @@
;await-src .Console/vector DEO2 ;await-src .Console/vector DEO2
BRK BRK
@meta $1
( name ) "Tgachr 0a
( desc ) "TGA 20 "to 20 "CHR 20 "Converter 0a
( auth ) "By 20 "Devine 20 "Lu 20 "Linvega 0a
( date ) "27 20 "Nov 20 "2023 $1
( exts ) $1
( (
@|vectors ) @|vectors )
@ -41,10 +49,7 @@
#0a18 DEO #0a18 DEO
BRK BRK
@hexc ( hex -- char ) @<write-size> ( str* -- )
#0f AND DUP #09 GTH #27 MUL ADD #30 ADD JMP2r
@write-size ( str* -- )
STH2 STH2
;image/w LDA2 #03 SFT2 NIP ;image/w LDA2 #03 SFT2 NIP
( ) DUP #04 SFT hexc STH2kr STA ( ) DUP #04 SFT hexc STH2kr STA
@ -69,7 +74,7 @@
;image/h STH2k LDA2 SWP STH2r STA2 ;image/h STH2k LDA2 SWP STH2r STA2
( | output path ) ( | output path )
;src ;dst scpy ;dst ;src ;dst scpy ;dst
( ) DUP2 scap/ #0004 SUB2 write-size ( ) DUP2 scap/ #0004 SUB2 <write-size>
( ) { ".chr 00 } ( ) { ".chr 00 }
STH2r SWP2 scap/ scpy ;dst .File2/name DEO2 STH2r SWP2 scap/ scpy ;dst .File2/name DEO2
( | resize ) ( | resize )
@ -85,19 +90,32 @@
#0a18 DEO #0a18 DEO
( | get parser ) ( | get parser )
;image/image-type LDA #02 NEQk NIP ?{ ;image/image-type LDA #02 NEQk NIP ?{
;pixel-raw-true #0004 parse-tga POP JMP2r } ;pixel-raw-true #0004 <parse-tga>
POP JMP2r }
#03 NEQk NIP ?{ #03 NEQk NIP ?{
;pixel-raw-bw #0001 parse-tga POP JMP2r } ;pixel-raw-bw #0001 <parse-tga>
POP JMP2r }
( | error ) ( | error )
;&err <pstr> ;&err <pstr>
#0a18 DEO #0a18 DEO
JMP2r JMP2r
&err "Unsupported 20 "tga-type: 20 $1 &err "Unsupported 20 "tga-type: 20 $1
@parse-tga ( filter* length* -- ) @<draw-row> ( -- )
#2000
&l ( -- )
#81 .Screen/sprite DEO
INC GTHk ?&l
POP2
( | move down )
#0020 .Screen/x DEO2
.Screen/y DEI2k #0008 ADD2 ROT DEO2
JMP2r
@<parse-tga> ( filter* length* -- )
#0020 .Screen/x DEO2 #0020 .Screen/x DEO2
#0020 .Screen/y DEO2 #0020 .Screen/y DEO2
;image/w LDA2 NIP #10 SFT #10 SUB #f0 AND #06 ORA .Screen/auto DEO #05 .Screen/auto DEO
.File1/length DEO2 .File1/length DEO2
,&filter STR2 ,&filter STR2
#0000 ,&x STR2 #0000 ,&x STR2
@ -110,11 +128,11 @@
;image/w LDA2 NEQ2 ?&no-line ;image/w LDA2 NEQ2 ?&no-line
#0000 ,&x STR2 #0000 ,&x STR2
,&y LDR2 INC2 ,&y STR2 ,&y LDR2 INC2 ,&y STR2
( on row ) ,&y LDR2 #0007 AND2 ORA ?&no-row ( on row ) ,&y LDR2 #0007 AND2 ORA ?&no-line
;buffer DUP2 .Screen/addr DEO2 ;buffer DUP2 .Screen/addr DEO2
.File2/write DEO2 .File2/write DEO2
#81 .Screen/sprite DEO <draw-row>
&no-row &no-line .File1/success DEI2 ORA ?&stream &no-line .File1/success DEI2 ORA ?&stream
JMP2r JMP2r
&pixel $4 &pixel $4
@ -127,7 +145,8 @@
( | get addr ) ( | get addr )
DUP2 #0007 AND2 SWP2 #83 SFT2 ADD2 SWP2 #43 SFT2 ADD2 ;buffer ADD2 DUP2 #0007 AND2 SWP2 #83 SFT2 ADD2 SWP2 #43 SFT2 ADD2 ;buffer ADD2
( ch1 ) OVR2 OVR2 STHkr #00 toggle-pixel ( ch1 ) OVR2 OVR2 STHkr #00 toggle-pixel
( ch2 ) #0008 ADD2 STHr #01 toggle-pixel JMP2r ( ch2 ) #0008 ADD2 STHr #01
( >> )
@toggle-pixel ( x* addr* color -- ) @toggle-pixel ( x* addr* color -- )
STH2 STH2
@ -185,6 +204,9 @@
POP2 #00 STH2r STA POP2 #00 STH2r STA
JMP2r JMP2r
@hexc ( hex -- char )
#0f AND DUP #09 GTH #27 MUL ADD #30 ADD JMP2r
( (
@|assets ) @|assets )