[From Bruce Abbott (990831.1430 EST)]
Crowd modelers:
Bill distributed a BGI driver, SVGA.BGI, for use in the Crowd project, and a
Turbo Pascal unit, SetSVGA.pas that initializes the SVGA.BGI driver. This
driver is supposed to allow one to access the higher-resolution SVGA display
adaptor modes, but I found that it did not work on my computer system. For
this reason, I have written a replacement unit, called SetVGA.pas, that
substitutes for SetSVGA.pas and uses the standard Borland VGA driver,
EGAVGA.BGI, which is distributed with Turbo Pascal.
To use this in, for example, Bill's "Motion.pas" program, complie SetVGA.pas
to your TPU directory. Then simply replace the reference to "setsvga" near
the top of the Motion.pas program within the "uses" statement. Finally,
within procedure InitProgram, change "initSVGA(4)" to "initVGA(2)". This
will provide a screen resolution of 640 X 480 pixels.
With this "fix," I've been able to run Motion.pas and it looks and works
just fine.
The source code for the SetVGA.pas unit appears immediately below.
Bruce
···
-----------------------------------------------------------------------
unit SetVGA;
interface
uses graph;
procedure InitVGA(mode: integer);
{ mode in argument of initVGA:
0 = 320 X 200
1 = 640 X 200
2 = 640 x 480
}
const BGIDIR = '\bp\bgi'; {directory in which bgi files are found}
var GraphMode,GraphDriver: integer; {THESE ARE GLOBAL FOR CALLING PROGRAM}
hsize,vsize,maxcolor: integer;
{ -------------------------------------------------------------------------}
implementation
procedure InitVGA(mode: integer);
var i: integer;
begin
graphdriver := 0; graphmode := 0;
detectgraph(graphdriver,graphmode);
initgraph(graphdriver,graphmode, BGIDIR);
graphmode := getmaxmode;
if mode > graphmode then mode := graphmode;
setgraphmode(mode);
hsize := getmaxx + 1; vsize := getmaxy + 1;
maxcolor := getmaxcolor;
end;
begin
end.