diff --git a/asm/6502/decompress_faster_v1.asm b/asm/6502/decompress_faster_v1.asm index 76d1b59..2e29c5d 100644 --- a/asm/6502/decompress_faster_v1.asm +++ b/asm/6502/decompress_faster_v1.asm @@ -7,7 +7,7 @@ ; ; This code is written for the ACME assembler. ; -; The code is 169 bytes for the small version, and 193 bytes for the normal. +; The code is 167 bytes for the small version, and 192 bytes for the normal. ; ; Copyright John Brandwood 2021. ; @@ -37,16 +37,15 @@ LZSA_SMALL_SIZE = 0 ; *************************************************************************** ; *************************************************************************** ; -; Data usage is last 7 bytes of zero-page. +; Data usage is last 8 bytes of zero-page. ; +lzsa_length = $F8 ; 1 byte. lzsa_cmdbuf = $F9 ; 1 byte. lzsa_winptr = $FA ; 1 word. lzsa_srcptr = $FC ; 1 word. lzsa_dstptr = $FE ; 1 word. -lzsa_offset = lzsa_winptr - LZSA_SRC_LO = $FC LZSA_SRC_HI = $FD LZSA_DST_LO = $FE @@ -61,6 +60,7 @@ LZSA_DST_HI = $FF ; ; Args: lzsa_srcptr = ptr to compessed data ; Args: lzsa_dstptr = ptr to output buffer +; Uses: lots! ; DECOMPRESS_LZSA1_FAST: @@ -95,14 +95,19 @@ lzsa1_unpack: ldy #0 ; Initialize source index. lsr lsr cmp #$07 ; Extended length? - bcc .cp_got_len + bcc .inc_cp_len - jsr .get_length ; X=0, CS from CMP, returns CC. - stx .cp_npages + 1 ; Hi-byte of length. + jsr .get_length ; CS from CMP, X=0. -.cp_got_len: tax ; Lo-byte of length. + ora #0 ; Check the lo-byte of length + beq .put_cp_len ; without effecting CC. -.cp_byte: lda (lzsa_srcptr),y ; CC throughout the execution of +.inc_cp_len: inx ; Increment # of pages to copy. + +.put_cp_len: stx