[comp.lang.pascal] Turbo 3.0 - Monochrome/CGA support

d88-rjo@nada.kth.se (Rickard Jonsson) (09/27/89)

Hello Turbo 3.0 fans! (If some still exist in the free world)

  I am having a problem with getting my program to work on both
monochrome systems AND color system. The way it is now, it only works
properly on color systems.
  I have gotten the suggestion that I may not have the compiler set up
to work for both kind of systems. My question is - does setting up the
compiler with TINST affect the way my program is executed on different
machines?
  Another suggestion I have received is that I may be using different
DOS versions and this could cause the difference - could this be justified?
  I do not use direct access to video memory, and the problem which appears on
the monochrome systems is that my windowing with Window() does not work at all,
although some text comes out right.
  Any explanations for the phenomenon are appreciated, please reply by E-mail.

   Thanks.

====================================================
Rick Jonsson - Royal Institute of Technology, Sweden
E-Mail : d88-rjo@nada.kth.se
"Life goes fast, if you don't stop and look around once in a while-
 you might miss it!" - F.B.D.O.
====================================================

cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) (09/28/89)

Rickard Jonsson writes:
$  I am having a problem with getting my program to work on both
$monochrome systems AND color system. The way it is now, it only works
$properly on color systems.
$  I have gotten the suggestion that I may not have the compiler set up
$to work for both kind of systems. My question is - does setting up the
$compiler with TINST affect the way my program is executed on different
$machines?

   The only thing the setup with TINST affects is the initial video mode
your program starts up in (and, of course, the mode that TURBO itself
runs in, but we're not discussing problems getting the compiler itself
to run).  If you set it to the "default" mode, it should work on any
system; if you set it to one of the other modes, it will clear the screen
before running, and it may well not run on colour systems if you specify
the monochrome option and vice versa (I'm not sure, never having tried
it).

$  Another suggestion I have received is that I may be using different
$DOS versions and this could cause the difference - could this be justified?

   No, the version of DOS you're using shouldn't matter, as it doesn't handle
the screen functions itself (they end up being handled by the machine's BIOS).

$  I do not use direct access to video memory, and the problem which appears on
$the mono systems is that my windowing with Window() does not work at all,
$although some text comes out right.

   I've never had this problem.  I've written a fair number of programs in
Turbo that use windowing and other such nifty stuff, without writing direct
video access stuff (although I've done that on some other programs), and they
all work fine on Hercules, CGA, EGA and VGA machines.

-- 
Stephen M. Dunn                         cs4g6ag@maccs.dcss.mcmaster.ca
**********************************************************************
       <std_disclaimer.h> = "\nI'm only an undergraduate!!!\n";
"VM is like an orgasm:  the less you have to fake, the better." - S.C.

filbo@gorn.santa-cruz.ca.us (Bela Lubkin) (09/29/89)

In article <1794@draken.nada.kth.se> Rickard Jonsson writes:
>My question is - does setting up the
>compiler with TINST affect the way my program is executed on different
>machines?
Yes, in Turbo 3.0 it does.  Make sure the compiler is installed for "default".

>the problem which appears on the monochrome systems is that my windowing
>with Window() does not work at all, although some text comes out right.
I half-remember some sort of interaction between the Window and TextMode
procedures.  Calling TextMode with no arguments puts the monitor in text mode
but, on mono systems, stores some wrong values into some of the runtime
library's internal variables.  I >think< you must call TextMode(7) on mono
systems.  Also, I think I remember a function whose name is NOT GetTextMode,
but has that effect.  The proper thing to do is to call GetTextMode at the
beginning of the program, store its return into a variable, and always use
TextMode(OrigTextMode).

GetTextMode may not exist (and certainly has a different name), in which case
you should query the BIOS.  And TextMode(7) might also be wrong; be sure to
experiment.

Finally, Window doesn't work right for 1-line windows; be sure you're not
creating one of those.

Bela Lubkin     * *   filbo@gorn.santa-cruz.ca.us   CIS: 73047,1112
     @        * *     ...ucbvax!ucscc!gorn!filbo    ^^^  REALLY slow [months]
R Pentomino     *     Filbo @ Pyrzqxgl (408) 476-4633 & XBBS (408) 476-4945