[comp.lang.pascal] TP DetectGraph on ATT 6300

dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) (11/13/90)

I am running Turbo Pascal 5.5 on an ATT 6300.  When I execute the following
program, DetectGraph tells me that I have a CGA graphics driver, when, in fact,
I have an ATT400 graph driver:
     Uses Graph;
     var
       GraphDriver,GraphMode: Integer;
     Begin
       DetectGraph(GraphDriver,GraphMode);
       WriteLn( 'GraphDriver GraphMode =', GraphDriver:2, GraphMode:2 );
     End.
INFOPLUS 1.35 also uses DetectGraph and claims I have a CGA.

How can a program figure out which graphics driver is installed?  Ideally, the
code would call an interrupt to determine the driver.  If that is not possible,
determining that the PC is an ATT would be sufficient.

Thank you,
Daniel Lewart
d-lewart@uiuc.edu

GJM@SLACVM.SLAC.STANFORD.EDU (Greg Mushial) (11/16/90)

having lived w/ a 6300 for 7 years now i understand your frustration. i use
the following code to detect a 6300:

found:= true;
i:= 0;
while (found) and (i <= 7) do begin
  if chr(mem[$fc00:($0050+i)]) = copy('OLIVETTI',i+1,1)
  then inc(i)
  else found:= false;
end;
if found then begin
  GrfDrvr:= Att400;
  GrfMode:= Att400Hi;
end;

please note: the new tos 1100 and 1200s support the 6300 standard - the string
you're looking for in these cases is "(C) Copyright Award Software Inc."

good luck,
-greg        (415.926.3772)
gjm@slacvm.slac.stanford.edu

nuge@ctmed@gemed.ge.com (James A. Nugent) (11/17/90)

In article <1990Nov12.205905.27226@ux1.cso.uiuc.edu>
dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) writes:

> I am running Turbo Pascal 5.5 on an ATT 6300.  When I execute the
> following program, DetectGraph tells me that I have a CGA graphics
> driver, when, in fact, I have an ATT400 graph driver:

        This behavior is well known. I believe the TP manual says (or
I learned somewhere) that the only thing to do is to explicitly set
the driver type and mode if you want the special AT&T modes.  This is
because the 6300 does such a good job of being CGA compatible it is
difficult to tell it apart from the real thing.

> How can a program figure out which graphics driver is installed?  Ideally, the
> code would call an interrupt to determine the driver.  If that is not possible,
> determining that the PC is an ATT would be sufficient.

        It may be that if you call int 10 and try to set an AT&T
specific mode, the return value would tell you (failure => not ATT);
you could do this first, then call detectgraph only if no AT&T board
was found.
--
Jim Nugent

GJM@SLACVM.SLAC.STANFORD.EDU (Greg Mushial) (11/20/90)

w/re the Nugent posting on detecting AT&T 640x400 by trying to set an AT&T
specific graphics mode and assuming that a rc of 0 implies that said mode is
supported - fails in too many cases...  i've learned the hard way, having been
the pc graphics support person here at SLAC for the last several years - there
are too many vendor specific BIOSs out there that when confused return a 0 rc -
the safest way i've found is to look at the BIOS copyright - see my posting of
last week.
-greg mushial  gjm@slacvm.slac.stanford.edu

dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) (11/26/90)

Thanks to everyone who helped me!  Below is the code that I now use to
determine the graphics driver and mode.

Daniel Lewart
d-lewart@uiuc.edu

-------------------------------------------------------------------------------

Uses Graph;

procedure DetectGraph(var GraphDriver,GraphMode: Integer);
const
  ATTLogo = 'OLIVETTI';
  ATTLen  = Length(ATTLogo);
var
  RomId: array[1..ATTLen] of Char absolute $FC00:$0050;
begin
  if RomId <> ATTLogo then
    Graph.DetectGraph(GraphDriver,GraphMode)
  else
  begin
    GraphDriver := ATT400;
    GraphMode   := ATT400Hi;
  end;
end;

var
  GraphDriver,GraphMode: Integer;
Begin
  DetectGraph(GraphDriver,GraphMode);
End.