unsigned char pal[768];
int left,top,right,bottom,type,mode;
unsigned char blockbuf[256],colorbits;
int encodetable[TABLESIZES];
int initbits,runbits,shiftbits;
int clearcode,eofcode,encode;
int maxcodesize,bytecount;
unsigned long tempcode;
int linestart[]={0,4,2,1};
int rowcount[]={8,8,4,2};
struct svgainfo
{
unsigned char signature[4];
unsigned int version;
unsigned long far *OEMstringptr;
unsigned char capabilities[4];
unsigned long far *videomodeptr;
unsigned int videomemory;
unsigned char reserved[];
}vgainfo;
struct vesamodeinfo {
unsigned int modeattr;
unsigned char winaattr,winbattr;
unsigned int wingrain,winsize,
winaseg,winbseg;
unsigned long far *winfuncptr;
unsigned int bytesperscanline,width,height;
unsigned char charwidth,charheight,
numberofmemory;
unsigned char bitperpixel,
numberofbanks,memorymodel;
unsigned char banksize,
numberofimagepages;
unsigned char x[];
}modeinfo;
int byteperpixel,width,height;
unsigned char tlib[72];
int setmode(int mode)
{
union REGS in,out;
in.x.ax=0x4f02;
in.x.bx=mode;
int86(0x10,&in,&out);
return(out.h.ah);
}
struct svgainfo {
unsigned char signature[4];
unsigned int version;
unsigned long far *OEMstringptr;
unsigned char capabilities[4];
unsigned long far *videomodeptr;
unsigned int videomemory;
unsigned char reserved[];
}vgainfo;
struct vesamodeinfo {
unsigned int modeattr;
unsigned char winaattr,winbattr;
unsigned int wingrain,winsize,
winaseg,winbseg;
unsigned long far *winfuncptr;
unsigned int bytesperscanline,width,height;
unsigned char charwidth,charheight,
numberofmemory;
unsigned char bitperpixel,
numberofbanks,memorymodel;
unsigned char banksize,
numberofimagepages;
unsigned char x[];
}modeinfo;
struct chunkhead {
unsigned char type[4];
unsigned long size;
}riff,list,block,subblock;
struct aviheader {
unsigned long microsecperframe,
maxbytespersec,reserved1;
unsigned long flags,
totalframes,initialframes,streams;
unsigned long suggestedbuffersize,
width,height,reserved[4];
}avih;
struct avistreamheader {
unsigned char type[4];
unsigned long compression,
reserved1,reserved2,reserved3;
unsigned long streams,quality,
initialframes,totalframes;
unsigned long suggestedbuffersize,
samplesize,reserved[2];
unsigned int width,height;
}strh;
struct bitmapinfo {
unsigned long size,width,height;
unsigned int plane,bitsperpixel;
unsigned long compression,
imagesize,xpels,ypels;
unsigned long colorused,colorimportant;
}bmp;
int setmode(int mode)
{
union REGS in,out;
in.x.ax=0x4f02; in.x.bx=mode;
int86(0x10,&in,&out);
return(out.h.ah);
}