[comp.os.msdos.programmer] How to detect in which mode a Hercules card is.

John Graat (10/18/90)

Hi there,

Can someone tell me how to determine whether a Hercules Graphics Card is
in text mode or in graphics mode? (not looking at the screen :-) ).

				Ciao,

					John Graat
					University of Nijmegen
					The Netherlands
					

sonny@charybdis.harris-atd.com (Bob Davis) (10/23/90)

In article <2306@wn1.sci.kun.nl> ose21@sci.kun.nl writes:
>Hi there,
>
>Can someone tell me how to determine whether a Hercules Graphics Card is
>in text mode or in graphics mode? (not looking at the screen :-) ).
>

Hello, John:

	There is a technique used by Alan Groupe in his Hercules
Print Screen (HPRTSC) program. He attributes the technique to a
program given him by Hercules.
	The technique exploits the fact that Hercules (and true compatibles)
cards have a Light Pen Port on them. And that when Vertical Retrace occurs,
the offset into Video memory differs for Text and Graphics Modes. The
program thus watches for Vertical Retrace to occur and then immediately,
through software, artificially "Triggers" the (usually-nonexistent) Light 
Pen whose circuitry grabs and stores the Video memory offset at the faked 
"Trigger" time. One then has only to read the offset at which the "Trigger"
occurred to know whether the mode is Text or Graphics.
	For assembly language details of this technique, fetch from 
Simtel [26.2.0.74] by anonymous ftp, Alan Groupe's program to print Herc
graphics screens:

	PD1:<MSDOS.SCREEN>HPRTSC.ARC

	
(There was a bug in this program, BTW, that made it double space
 instead of single spacing during graphics screen dumps to my
 Epson printer. If you have the same problem, I could tell you what I
 had to do to make it work. THIS PROBLEM WAS NOT IN THE CODE TO
 DETERMINE WHETHER THE CARD IS IN GRAPHICS OR TEXT MODE, THOUGH).

	Good luck,
	Bob.

______________________________________________________________________________
Bob Davis, UofALA'66   \\ INTERNET : sonny@trantor.harris-atd.com  |  _   _  |
Harris Corporation, ESS \\    UUCP : ...!uunet!x102a!trantor!sonny |_| |_| | |
Advanced Technology Dept.\\ AETHER : K4VNO          |==============|_/\/\/\|_|
PO Box 37, MS 3A/1912     \\ VOICE : (407) 727-5886 | I SPEAK ONLY | |_| |_| |
Melbourne, FL 32902        \\  FAX : (407) 729-2537 | FOR MYSELF.  |_________|