'=========================================================================== ' Subject: FLIC PLAYER W/SCREEN BUFFER Date: 05-11-97 (16:42) ' Author: Cleber de Mattos Casali Code: QB, QBasic, PDS ' Origin: Landale@usa.net Packet: GRAPHICS.ABC '=========================================================================== DEFINT A-Z ' QBX/QB Flic Player ' Original Program by Carl Gorringe (thank you very very very much!!!) ' Reprogramed by LanDaLe (Cleber de Mattos Casali) ' CMC Soft. ' ' e-mail : rLanDaLe@geocities.com ' home page : www.geocities.com/siliconvalley/park/3019 ' ' Now featuring Screen Buffer (I really love Screen Buffers...) ' obs: No speed limiting, good stuff for my 3x86!!! ' DECLARE SUB PlayFLC (FileName$) TYPE FLIheaderType Size AS LONG ID AS INTEGER Frames AS INTEGER Xres AS INTEGER Yres AS INTEGER ColorBits AS INTEGER Flags AS INTEGER Speed AS INTEGER Reserved AS STRING * 110 END TYPE TYPE FLIframeChunkType Size AS LONG ID AS INTEGER Chunks AS INTEGER Reserved AS STRING * 8 END TYPE TYPE FLIdataChunkType Size AS LONG ID AS INTEGER END TYPE SCREEN 13 PlayFLC "c:\draw\giant.flc" SUB PlayFLC (FileName$) DIM Header AS FLIheaderType DIM FrameChunk AS FLIframeChunkType DIM DataChunk AS FLIdataChunkType DIM Byte AS STRING * 1 DIM flitela(1 TO 32002) AS INTEGER FileNum% = FREEFILE OPEN FileName$ FOR BINARY AS FileNum% GET #FileNum%, , Header IF Header.ID <> &HAF11 AND Header.ID <> &HAF12 THEN CLOSE FileNum% EXIT SUB END IF IF Header.Xres <> 320 OR Header.Yres <> 200 THEN CLOSE FileNum% EXIT SUB END IF flirotina: FOR timming = 0 TO Header.Frames STEP 1 DEF SEG = VARSEG(flitela(3)) FramePos& = LOC(FileNum%) GET #FileNum%, , FrameChunk IF FrameChunk.ID = &HF1FA THEN FOR Chunk% = 1 TO FrameChunk.Chunks DataPos& = LOC(FileNum%) GET #FileNum%, , DataChunk SELECT CASE DataChunk.ID CASE 4, 11 Index% = 0 GET #FileNum%, , PacketNum% FOR A% = 1 TO PacketNum% GET #FileNum%, , Byte: SkipByte% = ASC(Byte) GET #FileNum%, , Byte: ChangeByte% = ASC(Byte) Index% = Index% + SkipByte% IF ChangeByte% = 0 THEN ChangeByte% = 256 FOR B% = 1 TO ChangeByte% GET #FileNum%, , Byte: RedByte% = ASC(Byte) GET #FileNum%, , Byte: GreenByte% = ASC(Byte) GET #FileNum%, , Byte: BlueByte% = ASC(Byte) IF DataChunk.ID = 4 THEN OUT &H3C8, Index% OUT &H3C9, RedByte% \ 4 OUT &H3C9, GreenByte% \ 4 OUT &H3C9, BlueByte% \ 4 ELSE OUT &H3C8, Index% OUT &H3C9, RedByte% OUT &H3C9, GreenByte% OUT &H3C9, BlueByte% END IF Index% = Index% + 1 NEXT B% NEXT A% CASE 12 GET #FileNum%, , StartLine% GET #FileNum%, , Byte: NumLines% = ASC(Byte) LinePos& = StartLine% * 320& GET #FileNum%, , Byte: StartByte% = ASC(Byte) FOR Y% = 1 TO NumLines% GET #FileNum%, , Byte: PacketByte% = ASC(Byte) X% = StartByte% FOR A% = 1 TO PacketByte% GET #FileNum%, , Byte: SkipByte% = ASC(Byte) GET #FileNum%, , Byte: SizeByte% = ASC(Byte) X% = X% + SkipByte% IF SizeByte% > 127 THEN SizeByte% = -(SizeByte% OR &HFF00) GET #FileNum%, , Byte: PixelByte% = ASC(Byte) FOR B% = 1 TO SizeByte% POKE LinePos& + X%, PixelByte% X% = X% + 1 NEXT B% ELSE FOR B% = 1 TO SizeByte% GET #FileNum%, , Byte: PixelByte% = ASC(Byte) POKE LinePos& + X%, PixelByte% X% = X% + 1 NEXT B% END IF NEXT A% LinePos& = LinePos& + 320 NEXT Y% GET #FileNum%, , Byte CASE 7 LinePos& = 0 GET #FileNum%, , NumLines% FOR Y% = 1 TO NumLines% DO GET #FileNum%, , Word% WordType% = (Word% AND &HC000) SELECT CASE WordType% CASE 0: PacketCount% = Word% CASE &H8000: LastPixel% = (Word% AND &HFF) CASE &HC000: LinePos& = LinePos& + (Word% * -320&) END SELECT LOOP UNTIL WordType% = 0 X% = 0 FOR A% = 1 TO PacketCount% GET #FileNum%, , Byte: SkipByte% = ASC(Byte) GET #FileNum%, , Byte: SizeByte% = ASC(Byte) X% = X% + SkipByte% IF SizeByte% > 127 THEN SizeByte% = -(SizeByte% OR &HFF00) GET #FileNum%, , Byte: PixelByte1% = ASC(Byte) GET #FileNum%, , Byte: PixelByte2% = ASC(Byte) FOR B% = 1 TO SizeByte% POKE LinePos& + X%, PixelByte1% POKE LinePos& + X% + 1, PixelByte2% X% = X% + 2 NEXT B% ELSE FOR B% = 1 TO SizeByte% GET #FileNum%, , Byte: PixelByte1% = ASC(Byte) GET #FileNum%, , Byte: PixelByte2% = ASC(Byte) POKE LinePos& + X%, PixelByte1% POKE LinePos& + X% + 1, PixelByte2% X% = X% + 2 NEXT B% END IF NEXT A% LinePos& = LinePos& + 320 NEXT Y% CASE 15 LinePos& = 0 FOR Y% = 1 TO 200 GET #FileNum%, , Byte X% = 0 DO GET #FileNum%, , Byte: SizeByte% = ASC(Byte) IF SizeByte% > 127 THEN SizeByte% = -(SizeByte% OR &HFF00) FOR B% = 1 TO SizeByte% GET #FileNum%, , Byte: PixelByte% = ASC(Byte) POKE LinePos& + X%, PixelByte% X% = X% + 1 NEXT B% ELSE GET #FileNum%, , Byte: PixelByte% = ASC(Byte) FOR B% = 1 TO SizeByte% POKE LinePos& + X%, PixelByte% X% = X% + 1 NEXT B% END IF LOOP UNTIL X% >= 320 LinePos& = LinePos& + 320 NEXT Y% GET #FileNum%, , Byte CASE 16 FOR P& = 0 TO 64000 GET #FileNum%, , Byte: PixelByte% = ASC(Byte) POKE P&, PixelByte% NEXT P& CASE ELSE SEEK FileNum%, DataPos& + DataChunk.Size + 1 END SELECT NEXT Chunk% END IF SEEK FileNum%, FramePos& + FrameChunk.Size + 1 DEF SEG flitela(1) = 2560 flitela(2) = 200 PUT (0, 0), flitela, PSET IF INKEY$ = CHR$(27) THEN CLOSE FileNum%: EXIT SUB NEXT timming CLOSE FileNum%: EXIT SUB END SUB