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 1/3

DEFINT A-Z
DECLARE FUNCTION Getbit ()
DECLARE FUNCTION ReadCode (CodeSize)
DECLARE SUB PlotPixel (A)
True = -1
False = 0
DIM ByteBuffer AS STRING * 1
DIM Powers(8), Prefix(4096), Suffix(4096), Outcode(1024)
DIM MaxCodes(12), Powers2(16)
SHARED Xstart, Xend, True, False
FOR A = 1 TO 8: Powers(A) = 2 ^ (A - 1): NEXT
DATA 4,8,16,&h20,&h40,&h80,&h100,&h200,&h400,&h800,&h1000,8192
FOR A = 0 TO 11: READ MaxCodes(A): NEXT
DATA 1,3,7,15,31,63,127,255
FOR A = 1 TO 8: READ CodeMask(A): NEXT
DATA 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384
FOR A = 0 TO 14: READ Powers2(A): NEXT
F$="TMP.GIF"
OPEN F$ FOR BINARY AS #1 LEN = 1
IF LOF(1) = 0 THEN PRINT "File not found!": CLOSE : KILL F$: END
FOR A = 1 TO 6
    GET #1, , ByteBuffer: A$ = A$ + ByteBuffer
NEXT
IF A$  "GIF87a" THEN
    PRINT "Warning, the "; A$; " protocol is being used in this file."
    LINE INPUT "Proceed anyway(Y/N)?"; A$
    IF UCASE$(A$)  "Y" THEN END
END IF
GET #1, , TotalX
GET #1, , TotalY
PRINT TotalX;"x";TotalY;"x";
GET #1, , ByteBuffer: A = ASC(ByteBuffer)
BitsPixel = (A AND 7) + 1
GET #1, , ByteBuffer: Background = ASC(ByteBuffer)
GET #1, , ByteBuffer
IF ASC(ByteBuffer)  0 THEN
    PRINT "Bad file."
    END
END IF
PRINT 2^BitsPixel
GET$ 1, (2^BitsPixel)*3, Pal$
FOR I = 1 TO LEN(Pal$)
        Tmp? = ASC(MID$(Pal$,I,1))
        SHIFT RIGHT Tmp?,2
        MID$(Pal$,I,1)=CHR$(Tmp?)
NEXT I
GET #1, , ByteBuffer
IF ByteBuffer  "," THEN
    PRINT "Bad file."
    END
END IF
GET #1, , Xstart
GET #1, , Ystart
GET #1, , Xlength
GET #1, , Ylength
Xend = Xlength + Xstart - 1: Yend = Ylength + Ystart - 1
GET #1, , ByteBuffer
A = ASC(ByteBuffer)
IF (A AND 128) = 128 THEN
    PRINT "Local colormap encountered."
    END
ELSEIF (A AND 64) = 64 THEN
    PRINT "Image is interlaced!"
    END
END IF
GET #1, , ByteBuffer
CodeSize = ASC(ByteBuffer): ClearCode = Powers2(CodeSize)
EOFCode = ClearCode + 1: FirstFree = ClearCode + 2
FreeCode = FirstFree: CodeSize = CodeSize + 1
InitCodeSize = CodeSize: Maxcode = MaxCodes(CodeSize - 2)
Bitmask = CodeMask(BitsPixel)
(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™.