Faster decoder

This commit is contained in:
neauoire 2023-11-15 15:12:21 -08:00
parent 4bee5597a3
commit 3730f98dc4
1 changed files with 7 additions and 10 deletions

View File

@ -41,6 +41,7 @@ BRK
@decode_ulz_byte ( byte -- )
DUP #80 AND ?op-dict
@op-lit ( byte -- )
#00 SWP INC2
DUP2 .File/length DEO2
@ -48,22 +49,17 @@ BRK
DUP2 .File/read DEO2
ADD2 .ptr STZ2
JMP2r
@op-dict ( byte )
#7f AND
DUP #40 AND ?&dict2
( length ) #00 SWP #0004 ADD2
!do-copy
#00 SWP !do-copy
&dict2 ( byte -- )
( hb )
#3f AND
( lb )
#0001 .File/length DEO2
;&b .File/read DEO2 [ LIT &b $1 ] #0004 ADD2
!do-copy
#3f AND getc
@do-copy ( length* -- )
( offset ) ;&b .File/read DEO2 [ LIT &b $1 ] INC
( +4 ) #0004 ADD2
( +1 ) getc INC
#00 SWP #0000 SWP2 SUB2 .ptr LDZ2 ADD2 STH2
#0000
&l
@ -82,5 +78,6 @@ JMP2r
@skey ( key buf -- proc ) OVR #21 LTH ?&eval #00 SWP sput #00 JMP2r &eval POP2 #01 JMP2r
@scap ( str* -- end* ) LDAk ?&w JMP2r &w INC2 LDAk ?&w JMP2r
@sput ( chr str* -- ) scap INC2k #00 ROT ROT STA STA JMP2r
@getc ( -- b ) #0001 .File/length DEO2 ;&b .File/read DEO2 [ LIT &b $1 ] JMP2r
@mem