Progress in flexible file size

This commit is contained in:
neauoire 2023-11-27 14:43:50 -08:00
parent a80dfd2b04
commit 65bac442c5
1 changed files with 14 additions and 13 deletions

View File

@ -26,14 +26,14 @@
|0100 @on-reset ( -> ) |0100 @on-reset ( -> )
( theme ) ( | theme )
#26ae .System/r DEO2 #26ae .System/r DEO2
#26ae .System/g DEO2 #26ae .System/g DEO2
#26ae .System/b DEO2 #26ae .System/b DEO2
( size ) ( | size )
#0080 .Screen/width DEO2 #0080 .Screen/width DEO2
#0100 .Screen/height DEO2 #0100 .Screen/height DEO2
( wait ) ( | wait )
;await-src .Console/vector DEO2 ;await-src .Console/vector DEO2
BRK BRK
@ -64,24 +64,25 @@ BRK
@file-open-tga ( path* -- ) @file-open-tga ( path* -- )
( header ) ( | header )
DUP2 .File1/name DEO2 DUP2 .File1/name DEO2
#0012 .File1/length DEO2 #0012 .File1/length DEO2
;image .File1/read DEO2 ;image .File1/read DEO2
( flip endianness ) ( | flip endianness )
;image/w STH2k LDA2 SWP STH2r STA2 ;image/w STH2k LDA2 SWP STH2r STA2
;image/h STH2k LDA2 SWP STH2r STA2 ;image/h STH2k LDA2 SWP STH2r STA2
( | resize )
;image/w LDA2 #0040 ADD2 .Screen/width DEO2
;image/h LDA2 #0040 ADD2 .Screen/height DEO2
;image/w LDA2 #43 SFT2 .File2/length DEO2 ;image/w LDA2 #43 SFT2 .File2/length DEO2
( | print details )
( print details )
;src-txt pstr ;src-txt pstr
pstr pstr
LIT "( #18 DEO #00 LIT "( #18 DEO #00
;image/image-type LDA #10 SFT ;image-types ADD2 LDA2 pstr ;image/image-type LDA #10 SFT ;image-types ADD2 LDA2 pstr
LIT ") #18 DEO #0a18 DEO LIT ") #18 DEO #0a18 DEO
( get parser ) ( | get parser )
;image/image-type LDA ;image/image-type LDA
#02 NEQk NIP ?&no-raw-true #02 NEQk NIP ?&no-raw-true
;pixel-raw-true #0004 parse-tga POP JMP2r ;pixel-raw-true #0004 parse-tga POP JMP2r
@ -90,7 +91,7 @@ BRK
;pixel-raw-bw #0001 parse-tga POP JMP2r ;pixel-raw-bw #0001 parse-tga POP JMP2r
&no-raw-bw &no-raw-bw
( error ) ( | error )
;&err pstr #0a18 DEO ;&err pstr #0a18 DEO
JMP2r JMP2r
@ -99,8 +100,8 @@ JMP2r
@parse-tga ( filter* length* -- ) @parse-tga ( filter* length* -- )
#0020 .Screen/x DEO2 #0020 .Screen/x DEO2
#0040 .Screen/y DEO2 #0020 .Screen/y DEO2
#76 .Screen/auto DEO ;image/w LDA2 NIP #10 SFT #10 SUB #f0 AND #06 ORA .Screen/auto DEO
.File1/length DEO2 ,&filter STR2 .File1/length DEO2 ,&filter STR2
#0000 ,&x STR2 #0000 ,&x STR2
@ -132,7 +133,7 @@ JMP2r
STH STH
OVR2 SWP2 OVR2 SWP2
( get addr ) ( | get addr )
DUP2 #0007 AND2 DUP2 #0007 AND2
SWP2 #83 SFT2 ADD2 SWP2 #83 SFT2 ADD2
SWP2 #43 SFT2 ADD2 SWP2 #43 SFT2 ADD2