
  All Libraries for Turbo Pascal V7.0 by Jou-Nan Chen, 1995,1996
  unit Txt,SVGA256,SVGA16,VGA256,CMP,MOUSE,SHOW256/320

 Ŀ
  unit Txt 
 

  procedure CirclePalette(No,Count,Total,Delay1:integer;var Pal);
  procedure Conv1to8(var Buf1,Buf2;ByteCount,Fore,Back:integer);
  procedure Conv8to1(var Buf1,Buf2;ByteCount,Fore:integer);
  procedure Delay(Sec1000:integer);        { -1:File not exist }
   function FileLen(Filename:string;BlockSize:integer):longint;
  procedure FileRead(Filename:string;Start,Len,BlockSize:integer;var Buf);
  procedure FileWrite(Filename:string;Start,Len,BlockSize:integer;var Buf);
   function GetBit(B,No:byte):byte;
   function GetDate:string;
   function GetFontAddr(FontNo:byte):pointer;
  procedure GetPalette(No,Count:integer;var Buf);
  procedure GetPalette17(var Buf);
   function GetStr(St:string;No:integer):string;
   function GetTime:string;
   function HexByte(Num:byte):string;
   function HexInt(Num:integer):string;
   function Key:integer;
   function KeyPressed:boolean;
  procedure NoSound;
  procedure RandomRange(Start,N:integer;var Buf);
  procedure SetBit(var B:byte;No,OnOff:byte);
  procedure SetPalette(No,Count:integer;var Buf);
  procedure SetPalette17(var Buf);
  procedure Sound(Freq:integer);
  procedure SpeedKey;
  procedure SpeedUp;
  procedure VideoMode(No:integer);
   function WhichDay(Y,M,D:integer):integer;  { 0=Sun, 1..6=Mon..Sat }

   function GetAttr(X,Y:integer):byte;
   function GetChar(X,Y:integer):byte;
  procedure GetText(X,Y,LenX,LenY:integer;var Buf);
   function GetX:byte;
   function GetY:byte;                        { 0=Esc or '' }
   function InputText(X,Y,Len:integer;var St:string):integer;  
  procedure PrintAttr(X,Y,Color,Len:integer);
  procedure PrintBig(X,Y,LenX,LenY,Color:integer;Ch:char;St:string;var Font);
  procedure PrintBig2(X,Y,LenX,LenY,Color:integer;St:string;var Font);
  procedure PrintChar(X,Y:integer;Buf:string);
  procedure PrintNum(X,Y,Color,Num:integer);
  procedure PrintText(X,Y,Color:integer;Buf:string);
  procedure PutBig(X,Y,LenX,LenY,Color:integer;Ch:char;var Buf);
  procedure PutBig2(X,Y,LenX,LenY,Color:integer;var Buf);
  procedure PutText(X,Y,LenX,LenY:integer;var Buf);
  procedure ScrollText(Direct,X,Y,LenX,LenY,Count:integer);
  procedure SetCurPos(X,Y:byte);
  procedure SetCurShape(Top,Bottom:byte);
  procedure SetFlash(OnOff:byte);    { 0=Highlight back, 1=Flash }
  procedure SetTextFont(Height,First,Count:integer;var Buf);
  procedure TextBar(X,Y,LenX,LenY,Color:integer;Ch:char);
  procedure TextBox(X,Y,LenX,LenY,Color,Ty:integer);
  procedure TextShadow(X,Y,LenX,LenY:integer);
  procedure TextWindow1(X,Y,LenX,LenY,C,TitleC,BoxType:integer;Title:string);
  procedure TextWindow2(X,Y,LenX,LenY,C,TitleC:integer;Title:string);

  const
    TextMem:pointer=Ptr($B800,0);    { Mono=$B000, Color=$B800 }
    TextWidth:integer=160;

 Ŀ
  unit SVGA256 
 

  procedure Bar(X,Y,LenX,LenY,Color:integer);
  procedure Get(X,Y,LenX,LenY:integer;var Buf);
  procedure Put(X,Y,LenX,LenY:integer;var Buf);
   function GetDot(X,Y:integer):byte;
  procedure PutDot(X,Y,Color:integer);

  procedure AsmBar(var Buf,Table;Xsize,Ysize,Xcount,Ycount:integer);
  procedure AsmPic(var Buf1,Buf2,Table;Xsize,Ysize,Xcount,Ycount:integer);
  procedure Box(X,Y,LenX,LenY,Color:integer);
  procedure Circle(Xc,Yc,Xr,Yr,Color:integer);
  procedure Colorize(Ty,LenX,LenY,Color:integer;Count,CChange:byte;var Buf);
  procedure ColorRandom(LenX,LenY,Color,Count,CChange:integer;var Buf);
  procedure Fill(X,Y,Color:integer);
  procedure GetPart(var Buf1,Buf2;X,Y,LenX,LenY,Buf1Width:integer);
  procedure Line(X1,Y1,X2,Y2,Color:integer);
  procedure Mirror(Direct,X,Y,LenX,LenY:integer);
  procedure Mix(var Buf1,Buf2;Count,Color:word);
  procedure Scroll(Direct,X,Y,LenX,LenY,Count:integer);
  procedure SetMode(No:integer);
  procedure SetWindow(X1,Y1,X2,Y2:integer);
  procedure Shadow(X,Y,LenX,LenY:integer);
   function VESAInstall:boolean;
  procedure Window1(X,Y,LenX,LenY,CBar,CBox:integer);
  procedure ZoomBar(X,Y,LenX,LenY,Zx,Zy:integer;var Buf);
  procedure Zoom(var Buf1,Buf2;LenX,LenY,LenXX,LenYY:integer);

  procedure FontWidthTable(CharCount,Space:integer);
   function GetWidth(St:string):integer;
  procedure Input(X,Y,Color,BkColor,Len:integer;var St:string);
  procedure InstallFont(Ty,LenX,LenY,StartNo,Count,Space:integer;var Buf);
  procedure Print(X,Y,Color:integer;St:string);
  procedure Print2(X,Y,Color:integer;St:string);
  procedure Print3(Ty,X,Y,Color,Count:integer;St:string);
  procedure PrintNum(X,Y,Color,Num:integer);
  procedure PrintA(X,Y,Color,Spc:integer;St:string);
  procedure Print2A(X,Y,Color,Spc:integer;St:string);
  procedure Print3A(Ty,X,Y,Color,Count,Spc:integer;St:string);
  procedure PrintB(X,Y,Color,Center:integer;St:string);
  procedure Print2B(X,Y,Color,Center:integer;St:string);
  procedure Print3B(Ty,X,Y,Color,Center,Count:integer;St:string);
  procedure Print2C(X,Y,Color,Center:integer;St:string);
  procedure Print3C(Ty,X,Y,Color,Center,Count:integer;St:string);

  const SVGAMem:pointer=Ptr($A000,0);
	Width:integer=640;
	MinX:integer=0;   MinY:integer=0;
	MaxX:integer=639; MaxY:integer=479;
  var CharLenX,CharLenY,CharStart,CharSize:byte;
      Font:pointer;
      FontTable:array[0..255] of byte;

 Ŀ
  unit SVGA16 
 

  procedure Bar(X,Y,LenX,LenY,Color:integer);
  procedure Get(X,Y,LenX,LenY:integer;var Buf);
  procedure Put(X,Y,LenX,LenY:integer;var Buf);
  procedure PutX(X,Y,LenX,LenY,Color:integer;var Buf);
  procedure Bar1024(X,Y,LenX,LenY,Color:integer);
  procedure Get1024(X,Y,LenX,LenY:integer;var Buf);
  procedure Put1024(X,Y,LenX,LenY:integer;var Buf);
  procedure PutX1024(X,Y,LenX,LenY,Color:integer;var Buf);

  procedure Conv1to4(var Buf1,Buf2;ByteCount,Fore,Back:integer);
  procedure InstallFont(SizeX,SizeY,StartNo:integer;var Buf);
  procedure Print(X,Y,Fore,Back:integer;St:string);
  procedure Print1024(X,Y,Fore,Back:integer;St:string);
  procedure SetMode(No:integer);
   function VESAInstall:boolean;

  const Width:integer=80;
  var Font:pointer;
      CharLenX,CharLenY,CharSize,CharStart:integer;

 Ŀ
  unit VGA256 
 

   function GetDot(X,Y:integer):byte;
  procedure PutDot(X,Y,Color:integer);

 Ŀ
  unit Cmp 
 

  procedure CmpFile(Name1,Name2:string);
  procedure UncmpFile(Name1,Name2:string);
   function CmpPic(var Buf1,Buf2;ByteCount:integer):integer;
   function UncmpPic(var Buf1,Buf2;ByteCount:integer):integer;

 Ŀ
  unit Mouse 
 

   function MouseB:integer;                        { 1=Left, 2=Right, 4=Mid }
  procedure MouseCursor(OnOff:integer);            { 1=On, 2=Off }
  procedure MouseInit(X1,Y1,X2,Y2,Xm,Ym:integer);  { 8/m=pixels/per move }
   function MouseInstall:boolean;
   function MouseMove:boolean;
  procedure MousePos(X,Y:integer);
   function MouseX:integer;
   function MouseXm:integer;                       { Pixels/per move }
   function MouseY:integer;
   function MouseYm:integer;                       { Pixels/per move }

 Ŀ
  unit Show256/Show320 
 

  procedure CirclePic(Xc,Yc,R,LenX,S,O:integer);
  procedure LinePic(X1,Y1,X2,Y2,LenX,S,O:integer);
  procedure ShowBar   (X,Y,LenX,LenY,Delay1:integer;var Buf);
  procedure ShowBox   (Direct,X,Y,LenX,LenY,Delay1:integer;var Buf);
  procedure ShowCell  (X,Y,LenX,LenY,Xsize,Ysize,Delay1:integer;var Buf);
  procedure ShowCircle(Direct,X,Y,LenX,LenY,Number,Delay1:integer;var Buf);
  procedure ShowClkRnd(X,Y,LenX,LenY,Delay1:integer;var Buf);
  procedure ShowClock (X,Y,LenX,LenY,Delay1:integer;var Buf);
  procedure ShowClock2(X,Y,LenX,LenY,Delay1:integer;var Buf);
  procedure ShowColor (Ty,X,Y,LenX,LenY,Start,Count,Delay1:integer;var Buf);
  procedure ShowDot   (X,Y,LenX,LenY,Delay1:integer;var Buf);
  procedure ShowFall  (Direct,X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowFlow  (Direct,X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowIn    (X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowJam   (Direct,X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowLine  (Direct,X,Y,LenX,LenY,Delay1:integer;var Buf);
  procedure ShowMove  (Direct,X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowScroll(Direct,X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowShadow(X,Y,LenX,LenY,L,Delay1:integer;var Buf);
  procedure ShowSlope (X,Y,LenX,LenY,Delay1:integer;var Buf);
  procedure ShowSplit (Direct,X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowZoom  (X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowZoom2 (X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowZoom4 (Direct,X,Y,LenX,LenY,Count,Delay1:integer;var Buf);
  procedure ShowZoomXY(Direct,X,Y,LenX,LenY,Count,Delay1:integer;var Buf);

