home *** CD-ROM | disk | FTP | other *** search
- uses FastVGA,FastFonts,FastTimer,Crt;
-
- var x,y:Integer;
- P:PaletteType;
- Er:Byte;
-
- procedure Intro;
- procedure EnWhite (n:Byte); { Procedure to fade a given color to white }
- var C:PaletteType;
- Done:Boolean;
-
- begin
- C[n][RGBRed]:=63; { Set color "n" of palette "C" to white }
- C[n][RGBGreen]:=63;
- C[n][RGBBlue]:=63;
- repeat
- StartTimer;
- PullToPalette (P,C,n,n,Done);
- SetActivePalette (P,n,n);
- WaitFor (25);
- until Done;
- end;
-
- procedure RevealLine (y:Integer; c:Byte; S:String);
- var x:Integer;
-
- begin
- VGAColor:=c;
- x:=(320-Length(S)*9) div 2;
- Font16Write (x,y,S);
- EnWhite (c);
- end;
-
- begin
- FillChar (P,SizeOf(P),0);
- SetActivePalette (P,0,255);
- RevealLine ( 50, 1,'Hello, and welcome to the FastVGA');
- RevealLine ( 66, 2,'Fonts demo. This short and simple');
- RevealLine ( 82, 3,'demo will show you just some of');
- RevealLine ( 98, 4,'the things you can do with the');
- RevealLine (114, 5,'FastFonts unit of FastVGA. Watch');
- RevealLine (130, 6,'and enjoy!');
- ReadKey;
- end;
-
- procedure Welcome;
- begin
- GoVGA256; { Restore the original color palette }
- for x:=0 to 130 do
- begin
- VGAColor:=x;
- Font16Write (x,x,'Welcome to FastVGA!');
- end;
- VGAColor:=15; { Final time, in pure white: }
- Font16Write (131,131,'Welcome to FastVGA!');
- ReadKey;
- end;
-
- procedure SineWave;
- const S:String = ' Sine Wave!■';
-
- var Ch,Line:Byte;
- Rad:Integer;
-
- begin
- Rad:=-75;
- while Rad<=80 do
- begin
- Ch:=1;
- Line:=0;
- VGAColor:=30-Abs(Rad div 10);
- for x:=0 to 319 do
- begin
- y:=100+Round(Rad*Sin(x*Pi/180));
- if Line<>0 then Font16VLine (x,y,S[Ch],Line);
- Inc (Line);
- if Line=9 then
- begin
- Line:=0;
- Inc (Ch);
- if Ch>Length(S) then Ch:=1;
- end;
- end;
- Inc (Rad,15);
- ReadKey;
- end;
- end;
-
- procedure Scroll;
- const S:String ='Scrolling ';
-
- var Ch,Line:Byte;
-
- begin
- Ch:=1;
- Line:=0;
- repeat
- VGAColor:=15;
- if Line<>0 then
- begin
- Font16VLine (319,120,S[Ch],Line);
- Font16VLine (0,80,S[Ch],Line);
- end;
- VSync; { Wait for syncronization - important for scrolling! }
- ScrollLeft (0,120,319,135);
- VSync;
- ScrollRight (0,80,319,95);
- VGAColor:=0;
- VLine (319,120,135);
- VLine (0,80,95);
- Inc (Line);
- if Line=9 then
- begin
- Line:=0;
- Inc (Ch);
- if Ch>Length(S) then Ch:=1;
- end;
- until KeyPressed;
- end;
-
- begin
- if TestVGA=0 then
- begin
- WriteLn ('This program requires a VGA/MCGA card.');
- Halt;
- end;
- GoVGA256;
- InstallFastTimer;
- Font16Init;
- LoadBIN16 (ActiveFont16^,'COMPUTER.BIN',Er);
- Intro;
- {$IFNDEF DPMI}
- LoadSystemFont16 (ActiveFont16^); { Restore default font, if we are NOT in
- protected mode }
- {$ENDIF}
- Welcome;
- ClrVGAScr;
- SineWave;
- ClrVGAScr;
- Scroll;
- Font16Done;
- RestoreTimer;
- TextMode (Co80);
- WriteLn ('That''s all folks!');
- WriteLn;
- end.
-