.import incsp2
.importzp sp, sreg, ptr1, ptr2, ptr3, ptr4, tmp1
+ .macpack cpu
+
; --------------------------------------------------------------------------
;
; Constants
sta inputPointer
stx inputPointer+1
; outputPointer = dest
-.ifpc02
+.if (.cpu & CPU_ISET_65SC02)
lda (sp)
ldy #1
.else
; return outputPointer - dest;
lda outputPointer
-.ifpc02
+.if (.cpu & CPU_ISET_65SC02)
sbc (sp) ; C flag is set
ldy #1
.else
moveBlock:
ldy moveBlock_len
beq moveBlock_1
-.ifpc02
+.if (.cpu & CPU_ISET_65SC02)
.else
ldy #0
.endif
inc moveBlock_len+1
moveBlock_1:
lda (0,x)
-.ifpc02
+.if (.cpu & CPU_ISET_65SC02)
sta (outputPointer)
.else
sta (outputPointer),y
bne moveBlock_3
inc outputPointer+1
moveBlock_3:
-.ifpc02
+.if (.cpu & CPU_ISET_65SC02)
dey
.else
dec moveBlock_len
jsr fetchPrimaryCode
bcs inflateCodes_2
; Literal code
-.ifpc02
+.if (.cpu & CPU_ISET_65SC02)
sta (outputPointer)
.else
ldy #0
getBits:
cpx #0
beq getBits_ret
-.ifpc02
+.if (.cpu & CPU_ISET_65SC02)
stz getBits_tmp
dec getBits_tmp
.else
lsr getBit_hold
bne getBit_ret
pha
-.ifpc02
+.if (.cpu & CPU_ISET_65SC02)
lda (inputPointer)
.else
sty getBit_hold
bne getBit_1
inc inputPointer+1
getBit_1:
- ror a ; C flag is set
+ ror a ; (C flag was set)
sta getBit_hold
pla
getBit_ret:
; Sorted codes.
sortedCodes:
.res 256+1+29+30+2
-
-
-