[comp.sys.ibm.pc.misc] HELP needed about HERCULES modes ...

talnevo@SHUM.HUJI.AC.IL (tal nevo) (11/16/90)

    I am writing a TSR that must be able to pop-up with ANY video
   card. I have not been able to determine the current mode when
   a hercules monochrome card is in use. My TSR has to do the
   following: 1) Determine the current mode.
              2) Save the appropriate video ram & mode
              3) Go to text mode and do your stuff...
              4) Return everything back to original state & exit.

    I need to know two things : How do I know that I am in graphic
   mode on a hercules card, andhow do I know which graphic page is
   active.
                            Thanks in advance ...         Tal

sonny@charybdis.harris-atd.com (Bob Davis) (11/16/90)

In article <491@shum.huji.ac.il> shum!talnevo@lilac.berkeley.edu (tal nevo) writes:
>
>    I am writing a TSR that must be able to pop-up with ANY video
>   card. I have not been able to determine the current mode when

	[DELETIONS]
>
>    I need to know two things : How do I know that I am in graphic
>   mode on a hercules card, andhow do I know which graphic page is
>   active.
>                            Thanks in advance ...         Tal

	For determining HERCULES mode:


	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 space
 badly 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).
	Note: This problem is fixed in FHPRTSC, now also available at
		SIMTEL.

	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.  |_________|