mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-27 04:49:20 +00:00
72 lines
1.5 KiB
Plaintext
72 lines
1.5 KiB
Plaintext
NEW
|
||
PREFIX
|
||
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 USR/SRC/LIB/LIBPAK.S.IN
|
||
ASM
|