A2osX/LIB/LIBPAK.S.IN.txt
2018-03-16 16:33:11 +00:00

72 lines
1.5 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
PREFIX /A2OSX.BUILD
AUTO 4,1
.LIST OFF
*--------------------------------------
Pak.In.Init >LDYA Pak.SrcPtr
>STYA ZPSrcPtr
lda Pak.Hdr+S.PAKHDR.LEN
eor #$ff
sta Pak.SrcCnt
lda Pak.Hdr+S.PAKHDR.LEN+1
eor #$ff
sta Pak.SrcCnt+1
rts
*--------------------------------------
Pak.In.GetRH lda #$ff
cmp Pak.SrcCnt+1 return 255 if not $ffxx
bne .1
lda Pak.SrcCnt
eor #$ff return !xx if $ffxx
.1 rts
*--------------------------------------
Pak.In.MoveFWA clc
adc ZPSrcPtr
sta ZPSrcPtr
bcc .8
inc ZPSrcPtr+1
.8 rts
*--------------------------------------
Pak.In.Get8Bits ldy #8
.HS 2C bit abs
Pak.In.Get4Bits ldy #4
lda #0 make sure to reset A before reading less than 8 bits only
.1 jsr Pak.In.GetBit and to exit with CC if even if 8 bits read
rol
dey
bne .1
rts always CC
*--------------------------------------
Pak.In.GetBit ldx Pak.In.Mask
bne .1
jsr Pak.In.NxtByte
ldx #8
.1 dex
stx Pak.In.GetBit+1
pha Don't trash A
lda (UnZPSrcPtr)
and Pak.In.BitMask,x
cmp #1 if 0:CC, i>0 CS
pla
rts Bit is in C
*--------------------------------------
Pak.In.GetByte lda (UnZPSrcPtr)
Pak.In.NxtByte inc UnZPSrcPtr
bne .8
inc UnZPSrcPtr+1
.8 rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/LIB/LIBPAK.S.IN
ASM