Board index » delphi » Help - Video mode question

Help - Video mode question

I have recently 'inherited' a pascal program which runs fine on
some computers but give a strange screen on others.  
I suspect it may be something to do with the video drivers - but I
may be completely wrong - I am a beginner as far as pascal goes.

The 'offending' part of the code may be the way initgraph is being
used :

-------------------------
uses crt,graph;
var
 gd,gm:integer;

gd:=detect;
initgraph(gd,gm,'');

-------------------------
gm is not assigned a value anywhere in the program.

The problem I see is that on some systems the menu which follows
the above code comes up fine - but on other systems the text is smaller
and offset making the program almost unusable.  It functions correctly
but the display is incorrect.   All the systems are VGA but I am sure
that they have different video cards.  

Any ideas ?

Thanks,
Chris McKeown
cmcke...@ti.com

 

Re:Help - Video mode question


Try this.

uses crt,graph;
var
 gd,gm:integer;

detectgraph(gd, gm);    {autodetects driver and mode}
initgraph(gd,gm,'');

Regards

Harald Kaada
haral...@stud.ntnu.no

Re:Help - Video mode question


In article <01bcf401$a461f8c0$5771f181@intro217>,

Quote
Harald Kaada <haral...@stud.ntnu.no> wrote:
>Try this.

>uses crt,graph;
>var
> gd,gm:integer;

>detectgraph(gd, gm);        {autodetects driver and mode}
>initgraph(gd,gm,'');

That's basically same thing. Assigning device as detect performs the auto
detection.

Osmo

Re:Help - Video mode question


Quote
>Subject: Help - Video mode question
>From: cmcke...@ti.com
>Date: Mon, Nov 17, 1997 14:43 EST
>Message-id: <34709E63.3...@ti.com>

>I have recently 'inherited' a pascal program which runs fine on
>some computers but give a strange screen on others.  
>I suspect it may be something to do with the video drivers - but I
>may be completely wrong - I am a beginner as far as pascal goes.

>The 'offending' part of the code may be the way initgraph is being
>used :

>-------------------------
>uses crt,graph;
>var
> gd,gm:integer;

>gd:=detect;
>initgraph(gd,gm,'');

>-------------------------
>gm is not assigned a value anywhere in the program.

>The problem I see is that on some systems the menu which follows
>the above code comes up fine - but on other systems the text is smaller
>and offset making the program almost unusable.  It functions correctly
>but the display is incorrect.   All the systems are VGA but I am sure
>that they have different video cards.  

>Any ideas ?

Apparently your program's written for a specific graphics mode only, so the
 size of objects come out all wrong in a different mode.

- Show quoted text -

Quote
>Thanks,
>Chris McKeown
>cmcke...@ti.com

Re:Help - Video mode question


Quote
>Subject: Help - Video mode question
>From: cmcke...@ti.com
>Date: Mon, Nov 17, 1997 14:43 EST
>Message-id: <34709E63.3...@ti.com>

>I have recently 'inherited' a pascal program which runs fine on
>some computers but give a strange screen on others.  
>I suspect it may be something to do with the video drivers - but I
>may be completely wrong - I am a beginner as far as pascal goes.

>The 'offending' part of the code may be the way initgraph is being
>used :

>-------------------------
>uses crt,graph;
>var
> gd,gm:integer;

>gd:=detect;
>initgraph(gd,gm,'');

>-------------------------
>gm is not assigned a value anywhere in the program.

That's fine. The above is asking Pascal to autodetect the graphics card and go
 to the "best" graphics mode of the card.

Quote

>The problem I see is that on some systems the menu which follows
>the above code comes up fine - but on other systems the text is smaller
>and offset making the program almost unusable.  It functions correctly
>but the display is incorrect.   All the systems are VGA but I am sure
>that they have different video cards.  

>Any ideas ?

It appears that the program you have is designed for a specific mode only, so
 the dimensions became all wrong in another mode.
 To see what graphics driver and graphics mode the program's using, change the
 code you have above to this:

Quote
>uses crt,graph;
>var
> gd,gm:integer;

DetectGraph (gd, gm);  {find graphics driver and graphics mode InitGraph will
 use}
Writeln;
Writeln  (gd, '  ', gm);
Readln;

Quote
> InitGraph (gd, gm, '');  {switch to graphics mode}

Take note of the 2 pairs of numbers you get in the 2 different machines.  If
 they're not the same pair of numbers, then pick one of the pair and change the
 instructions to the following:

Quote
>uses crt,graph;
>var
> gd,gm:integer;

gd := first number of the pair;
gm := second number of the pair;

Quote
> InitGraph (gd, gm, '');  {switch to the specific graphics driver & mode}

Now test the program.  If the pair doesn't work then try the other pair.  Good
 luck and hope it helps.

- Show quoted text -

Quote
>Thanks,
>Chris McKeown
>cmcke...@ti.com

Re:Help - Video mode question


I tried the following to detect the values of GD and GM and it detected the
same values (GD=9, GM=2) for both systems.   Still, my program runs fine on

one system and screwed up on the other.  Any grahics functions appear to
work OK (it draws some boxes the same on both systems) but when it comes
to making text on the screen I get different results - and on one of them
the text is almost impossible to read.

The interesting thing is that the two computer systems are almost identical
- both 486 Gateway PCs, both have the exact same video card (ATI Mach32),
the exact same monitor.    I am going to try the latest video card drivers
from ATI to see if that makes a difference .

Thanks for your help though !!

Chris McKeown - cmcke...@ti.com

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

Quote
cbongc...@aol.com (CBongChan) wrote:
> To see what graphics driver and graphics mode the program's using, change the
> code you have above to this:
>>uses crt,graph;
>>var
>> gd,gm:integer;

>DetectGraph (gd, gm);  {find graphics driver and graphics mode InitGraph will
> use}
>Writeln;
>Writeln  (gd, '  ', gm);
>Readln;
>> InitGraph (gd, gm, '');  {switch to graphics mode}

Re:Help - Video mode question


Quote
c...@ti.com wrote:
> I tried the following to detect the values of GD and GM and it detected the
> same values (GD=9, GM=2) for both systems.   Still, my program runs fine on
> one system and screwed up on the other.  Any grahics functions appear to
> work OK (it draws some boxes the same on both systems) but when it comes
> to making text on the screen I get different results - and on one of them
> the text is almost impossible to read.

> The interesting thing is that the two computer systems are almost identical
> - both 486 Gateway PCs, both have the exact same video card (ATI Mach32),
> the exact same monitor.    I am going to try the latest video card drivers
> from ATI to see if that makes a difference .

You don't mention what kind of monitors they are.  If they're digital
multisynch monitors, maybe the digital settings for that mode on one of
them is off?  You might want to pull out the manual and possibly do some
settings?  I have a Mag Innovision DX15T, and when you press one of the
adjustment buttons, a control window comes up on screen which also shows
horizontal and vertical refresh rates.

Don't know if that's the solution, but it's a thought.  :-)

Quote
> Thanks for your help though !!

> Chris McKeown - cmcke...@ti.com

--
Scott Earnest        | We now return you to our regularly |
set...@ix.netcom.com | scheduled chaos and mayhem. . . .  |

Re:Help - Video mode question


Quote
In article <654ajs$6i...@tilde.csc.ti.com>,  <c...@ti.com> wrote:

>I tried the following to detect the values of GD and GM and it detected the
>same values (GD=9, GM=2) for both systems.   Still, my program runs fine on

>one system and screwed up on the other.  Any grahics functions appear to
>work OK (it draws some boxes the same on both systems) but when it comes
>to making text on the screen I get different results - and on one of them
>the text is almost impossible to read.

It uses Outtext()? Have you made sure that same font-files are available
to both. If they are not then copy them. (One can distribute graphics
drivers and font files with programs that use them)

Osmo

Other Threads