home *** CD-ROM | disk | FTP | other *** search
- { A quicky test program to show how it works }
- { Originally Written by Michael Day 23 August 1988 }
- { released to the public domain 23 August 1988 }
- { This version 2.0 as of 29 August 1988 }
- { (also released to the public domain) }
- program BiosTest;
- uses Graph,BiosCrt;
- var c,i, GrDriver, GrMode:integer;
- mx, my, ChSize, ChRow, GxMode : integer;
- BW:Text;
- begin
- BiosTextColor(White);
- BiosTextBackground(black);
- BiosWriteMode := 0;
- BiosGotoXY(0,0);
- writeln('Burp!'); {this should disappear from the screen}
- BiosClrScr;
-
- assignbiostext(BW);
- ReWrite(BW);
- BiosGotoXY(0,1);
- writeln(BW,'Attr:',biostextattr);
-
- ChSize := BiosCHarSize; {get some character infor from Bios}
- if ChSize = 0 then ChSize := 8; {CGA is normally 0 so force it}
- ChRow := succ(BiosMaxY);
- if ChRow = 1 then ChRow := 25;
-
- GrDriver := Detect; {detect what kind of display is out there}
- GrMode := 0;
- { Grdriver := CGA; } {for you EGA/VGA guys, you can force CGA}
- { Grmode := CGAC0; } {here to see what it will look like}
-
- InitGraph(Grdriver,grmode,'');
- If GraphResult <> GrOK then
- begin
- WriteLn('Ouch! something went wrong!');
- Halt(1);
- end;
-
- SetViewPort(0,15,GetMaxX,GetMaxY,true);
-
- writeln(BW,'Burp!'); {this should disappear from the screen}
- BiosTextColor(0); {note: in graph mode we have to turn both the}
- BiosTextBackGround(0); {foreground and background off to clear the screen}
- BiosClrScr; {remember to do the same for insert and delete line}
- BiosTextColor(white);
-
- {note that we use Pixel math the center the message here}
- BiosPixGoto((GetMaxX div 2) - 18*TextWidth('X'),0);
- Write(BW,'BiosPixGoto() = Pixel X,Y -> Char X,Y');
-
- {put some graphics on the screen just to prove we really are in graphics mode}
- SetColor(white);
- mx := GetMaxX div 4; {calculate relative screen information}
- my := GetMaxY div 4;
- rectangle(mx,my,mx*3,my*3);
- i := 10;
- while i < mx*2 do
- begin
- circle(mx*2,my*2,i);
- inc(i,10);
- end;
-
- {now show the three write modes}
- SetBiosWriteMode(0);
- BiosTextColor(1);
- BiosGotoXY((BiosMaxX div 2) - 13,ChRow div 8);
- Write(BW,' Bios Background Overwrite '); {as TFDD}
- BiosGotoXY((BiosMaxX div 2) - 11,Succ(ChRow div 8));
- BiosWrite(' - BiosWriteMode(0) - '); {or regular}
-
-
- SetBiosWriteMode(1);
- BiosTextColor(2);
- BiosGotoXY((BiosMaxX div 2) - 15,pred(ChRow div 2));
- Write(BW,'Bios Xor Foreground Only Write');
- BiosGotoXY((BiosMaxX div 2) - 11,ChRow div 2);
- BiosWrite(' - BiosWriteMode(1) - ');
-
-
- SetBiosWriteMode(2);
- BiosTextColor(0);
- BiosTextBackground(3);
- BiosGotoXY((BiosMaxX div 2) - 18,(ChRow div 8)*7);
- Write(BW,' Bios Temp New Background Overwrite ');
- BiosGotoXY((BiosMaxX div 2) - 11,Succ((ChRow div 8)*7));
- BiosWriteLn(' - BiosWriteMode(2) - ');
-
- ReadLn; {Wait for them to look at the screen}
- CloseGraph; {Go Home!}
- end.