decompress faster

This commit is contained in:
Peter Ferrie 2023-09-02 11:30:15 -07:00
parent c2bf0cd744
commit b258ed441a

View File

@ -33,8 +33,9 @@ DEBUG = 0
decomp !zone { decomp !zone {
jsr .chkdst jsr .chkdst
ldy #0 ; In lit loop Y must be zero ldy #0 ; In lit loop Y must be zero
sec
.fill1A jsr .getbt2 .fill1A jsr .getbt2
jmp .fill1B bne .fill1B ; always taken
.incdst inc pDst+1 .incdst inc pDst+1
.chkdst ldx pDst+1 .chkdst ldx pDst+1
@ -174,19 +175,19 @@ decomp !zone {
bne .gshift ; always taken bne .gshift ; always taken
; Get another 8 bits into our bit buffer. Destroys X. Preserves A. Requires Y=0. ; Get another 8 bits into our bit buffer. Destroys X. Preserves A. Requires Y=0.
; Carry is always set on entry, Z always clear on exit
; Alternately, use .getbt2 to preserve X and destroy A ; Alternately, use .getbt2 to preserve X and destroy A
.getbts tax .getbts tax
.getbt2 lda (pSrc),y .getbt2 lda (pSrc),y
inc pSrc
beq .src3A
.src3B sec
rol rol
sta bits sta bits
txa txa
inc pSrc
beq .src3A
rts rts
.src3A inc pSrc+1 .src3A inc pSrc+1
bne .src3B ; always taken rts
} ; end of zone } ; end of zone