diff --git a/cli/lz/ako10x10.chr b/cli/lz/ako10x10.chr new file mode 100644 index 0000000..571b2d0 Binary files /dev/null and b/cli/lz/ako10x10.chr differ diff --git a/cli/lz/ako10x10.chr.ulz b/cli/lz/ako10x10.chr.ulz new file mode 100644 index 0000000..4c1162a Binary files /dev/null and b/cli/lz/ako10x10.chr.ulz differ diff --git a/cli/lz/build.sh b/cli/lz/build.sh index dbbc581..11a2cad 100755 --- a/cli/lz/build.sh +++ b/cli/lz/build.sh @@ -52,9 +52,15 @@ echo "Result(Uxn):" cat b.bin echo "" +echo "" +echo "Image Encoding" +./ulzenc ako10x10.chr ako10x10.chr.ulz +uxncli ulzenc.rom ako10x10.chr ako10x10.chr.ulz + rm ./ulzdec rm ./ulzenc rm ./a.ulz rm ./b.bin rm ./ulzdec.rom +rm ./ulzenc.rom rm *.sym diff --git a/cli/lz/ulzenc.tal b/cli/lz/ulzenc.tal index e52bfa1..4ac1d5e 100644 --- a/cli/lz/ulzenc.tal +++ b/cli/lz/ulzenc.tal @@ -5,9 +5,9 @@ |0000 + @pad $2 @src $30 @dst $30 - @ptr $1 @match-len $2 @output-ptr $2 @match-ctl $2 @@ -55,9 +55,9 @@ ;compressed .File/write DEO2 ( | summary ) ;dict/decompressed - ;src + ;src / ;dict/spacer - ;dst + ;dst / [ LIT2 "( 18 ] DEO .output-ptr LDZ2 ;compressed SUB2 ;dict/bytes @@ -101,6 +101,7 @@ ( res ) LDA STHr NEQ ?&end-for2 INC2 ORAk ?&for2 &end-for2 ( | i > match_len ) + DUP2 .match-len LDZ2 LTH2 ?{ DUP2 .match-len STZ2 .dict-data LDZ2 .dict-best STZ2 } @@ -172,11 +173,6 @@ STA JMP2r -@getc ( -- b ) - #0001 .File/length DEO2 - ;&b .File/read DEO2 - [ LIT &b $1 ] JMP2r - @ ( str* -- ) &w LDAk #18 DEO INC2 & LDAk ?&w @@ -204,7 +200,8 @@ &spacer 20 "-> 20 $1 &bytes 20 "bytes $1 -@raw $4000 +@raw $8000 + +@compressed -@compressed $4000