[comp.sys.ibm.pc.programmer] PORTABLE Direct Screen access?

dgl292@pallas.athenanet.com (Doug Lee) (03/25/90)

There has been some discussion in this group recently on the subject of
direct screen access.  I am attempting to write a program which, if possible,
must directly access text display memory while remaining portable across a
wide variety of DOS machines.

I am specifically interested in reliable ways to determine the location of
screen memory for a given system and in ways of handling the possibility of
non-80X25 displays.  I will use BIOS calls if necessary, but I am attempting
to avoid the apparent headache of saving/restoring video states (I
initially thought one could simply save/restore the cursor position, but the
only code example I have also directly accesses registers of EGA
(I think) boards where applicable for an unknown purpose).

Information and advice would be MOST appreciated.  If it is easier to do this
using BIOS calls, I would also be interested to know what (if anything) I
must do in addition to saving the cursor position to insure success with
the various adapters in current--and, hopefully, future--use.

Thanks in advance!

Doug Lee  (dgl292@athenanet.com or uunet!pallas!dgl292)

cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) (03/27/90)

   Well, you can always do the brute force method - figure out where screen
memory is likely to be (usually either segment B000 or B800 will do), then
clear the screen and print something, and look in the possible screen memory
locations to see if it's there.  If so, you can then find out how many
characters are in a line by printing CR followed by something else, and noticing
how much farther on in memory the something else appears.  As for the
number of lines, you can keep printing different things at the start of each
line and see how many times you can do this before the screen scrolls.

   If you do this all in black-on-black text, the user won't really notice
it.
-- 
               More half-baked ideas from the oven of:
****************************************************************************
Stephen M. Dunn                               cs4g6ag@maccs.dcss.mcmaster.ca
     <std_disclaimer.h> = "\nI'm only an undergraduate ... for now!\n";

frotz@drivax.UUCP (Frotz) (03/29/90)

dgl292@pallas.athenanet.com (Doug Lee) writes:

] There has been some discussion in this group recently on the subject of
] direct screen access.  I am attempting to write a program which, if possible,
] must directly access text display memory while remaining portable across a
] wide variety of DOS machines.

] I am specifically interested in reliable ways to determine the location of
] screen memory for a given system and in ways of handling the possibility of
] non-80X25 displays.  I will use BIOS calls if necessary, but I am attempting
] to avoid the apparent headache of saving/restoring video states (I
] initially thought one could simply save/restore the cursor position, but the
] only code example I have also directly accesses registers of EGA
] (I think) boards where applicable for an unknown purpose).

] Information and advice would be MOST appreciated.  If it is easier to do this
] using BIOS calls, I would also be interested to know what (if anything) I
] must do in addition to saving the cursor position to insure success with
] the various adapters in current--and, hopefully, future--use.

Well, I am about half done with the 1.4/1.5 PCcurses merge... (should
be around another 2-3 weeks...;-(  Then I still need to contact Bjorn
Larsson and coordinate with him... (Bjorn, are you out there?)

PCcurses 1.5 will have stock EGA/VGA support (standard (EGA)80x43,
(VGA)80x28, (VGA)80x50, and normal 80x25) support.  It has the option
of direct video memory writes vs. BIOS video writes.  Colors.  Pads.
Printing the contents of a window/pad to LPT1: via the BIOS.
Resizable windows.  Mostly X/Open Curses Interface compliant
(exceptions are the newterm() calls that handle the I/O streams)...
[Relatively] legally established Public Domain status (via Pavel
Curtis and Bjorn Larsson)... 

Adapter Combinations:
	VGA Mono/Color
	EGA Mono/Color
	MCGA Mono/Color
	CGA
	MDA

At one time I had added support for the 66-line MDS Genius Monitor
with Direct Video Memory Writes.  That was sweet!  Unfortunately it
collided with another EGA clone card, so it was removed.  It was
relatively trivial to add support for these weird modes, the problem
is unique adapter detection;-(

-- Frotz@Digital Research, Incorporated		amdahl!drivax!frotz
	 Graphics Business Unit			(408) 647-6570 (msg)
	 70 Garden Court, B15			(408) 649-3896
	 Monterey, California  93940		Ask for John Fa'atuai
[This is News.  This is your brain on News.  Any questions?]