TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: DAVE NAVARRO
date: 1995-10-21 18:53:00
subject: DECGIF.BAS for PowerB 2/3

(Continued from previous message)
GET #1, , ByteBuffer
BlockLength = ASC(ByteBuffer) + 1: Bitsin = 8
OutCount = 0
X = Xstart: Y = Ystart
I$=INPUT$(1)
Mode13 1
REG 1, &H1012
REG 2, 0
REG 3, 256
REG 4, STRPTR(Pal$)
REG 9, STRSEG(Pal$)
CALL INTERRUPT &H10
DO
    Code = ReadCode(CodeSize)
    IF Code  EOFCode THEN
        IF Code = ClearCode THEN
            CodeSize = InitCodeSize
            Maxcode = MaxCodes(CodeSize - 2): FreeCode = FirstFree
            Code = ReadCode(CodeSize): CurCode = Code
            OldCode = Code: FinChar = Code AND Bitmask
                                                PlotPixel FinChar
        ELSE
            CurCode = Code: InCode = Code
            IF Code >= FreeCode THEN
                CurCode = OldCode
                Outcode(OutCount) = FinChar
                OutCount = OutCount + 1
            END IF
            IF CurCode > Bitmask THEN
                DO
                    Outcode(OutCount) = Suffix(CurCode)
                    OutCount = OutCount + 1
                    CurCode = Prefix(CurCode)
                LOOP UNTIL CurCode <= Bitmask
            END IF
            FinChar = CurCode AND Bitmask
            Outcode(OutCount) = FinChar
            OutCount = OutCount + 1
            FOR I = OutCount - 1 TO 0 STEP -1
                                                                PlotPixel 
Outco
            NEXT
            OutCount = 0
            Prefix(FreeCode) = OldCode: Suffix(FreeCode) = FinChar
            OldCode = InCode: FreeCode = FreeCode + 1
            IF FreeCode >= Maxcode THEN
                IF CodeSize < 12 THEN
                    CodeSize = CodeSize + 1: Maxcode = Maxcode * 2
                END IF
            END IF
        END IF
    END IF
    A$ = INKEY$
LOOP UNTIL Code = EOFCode OR A$  ""
BEEP
IF A$ = "" THEN A$ = INPUT$(1)
Mode13 0
END
'This subprogram gets one bit from the data stream.
FUNCTION Getbit STATIC
    SHARED Powers(), Bitsin, BlockLength, Num
    DIM ByteBuffer AS SHARED STRING * 1
    Bitsin = Bitsin + 1
    IF Bitsin = 9 THEN
        GET #1, , ByteBuffer
        TempChar = ASC(ByteBuffer)
        Bitsin = 1
        Num = Num + 1
        IF Num = BlockLength THEN
            BlockLength = TempChar + 1
            GET #1, , ByteBuffer
            TempChar = ASC(ByteBuffer)
            Num = 1
        END IF
    END IF
    IF (TempChar AND Powers(Bitsin)) = 0 THEN Getbit = 0 ELSE Getbit = 1
END FUNCTION
'This subprogram plots one pixel on the display.
SUB PlotPixel (A) STATIC
                DEF SEG = &HA000
                        POKE Y*320+X, A
                DEF SEG
    X = X + 1
                IF X > Xend THEN
        X = Xstart
        Y = Y + 1
    END IF
END SUB
(Continued to next message)
---
 * QMPro 1.53 * WOMAN.ZIP - Great program, no documentation!
--- GEcho 1.20/Pro
---------------
* Origin: Toast House * (314) 994-0312 * (1:100/560)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.