🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #254

Re: Turbo C console i/o routines and non-standard video modes

#254
From: Richard Brittain
Date: Wed, 15 Nov 1989 18:30
33 lines
2340 bytes
In article <2980@einstein.ptolemy.arc.nasa.gov> raymond@einstein.arc.nasa.gov.UUCP (Eric A. Raymond) writes:
>In article <2090@calvin.EE.CORNELL.EDU> richard@calvin.EE.CORNELL.EDU (Richard Brittain) writes:
>>I have already established that the gettextinfo() routine does not return
>>the correct screen size but I think I can fix that.
>
>Alright then, how do you do this.  I want a routine which will tell me
>whether I'm in 25,43, or 50 line mode.

	Well, I hate it when people post replies that are not true, but working from
my manual (like I said, I don't have the hardware to actually test this)
BIOS data area:
0040:004a	# characters per line 16 bit int
0040:004c	# bytes required for 1 screenful of data - 16 bit int 
0040:0084	# rows-1 - 1 byte
0040:0085	# scan lines per character (i.e. height of cell) - 16 bit int
If these are set correctly (The last two only for EGA/VGA/MCGA) then that
should be all you need.
Alternatively:
BIOS INT 10H
function AH=0F  Get mode - should return characters/line as well as mode.
Hopefully the 'non-standard' modes also return this correctly
function AX=1130 Get character generator info (EGA/VGA/MCGA) returns #rows-1
and bytes/character in the 'alternate' font table.

The gettextinfo() routine does a function 0F (Get mode) call, which doesn't
return enough information by itself, and it apparently doesn't read the bios
data area parameters directly.  I used the intercep program to trap all of
its bios calls.

Richard Brittain,                   School of Elect. Eng.,  Upson Hall   
                                    Cornell University, Ithaca, NY 14853
ARPA: richard@calvin.spp.cornell.edu	
UUCP: {uunet,uw-beaver,rochester,cmcl2}!cornell!calvin!richard
Technical Details
Message-ID: <2092@calvin.EE.CORNELL.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!mit-eddie!uw-beaver!cornell!calvin!richard
References: <2090@calvin.EE.CORNELL.EDU> <2980@einstein.ptolemy.arc.nasa.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!mit-eddie!uw-beaver!cornell!calvin!richard
From: richard@calvin.EE.CORNELL.EDU (Richard Brittain)
Newsgroups: alt.msdos.programmer,comp.sys.ibm.pc
Subject: Re: Turbo C console i/o routines and non-standard video modes
Message-ID: <2092@calvin.EE.CORNELL.EDU>
Date: 15 Nov 89 18:30:06 GMT
References: <2090@calvin.EE.CORNELL.EDU> <2980@einstein.ptolemy.arc.nasa.gov>
Reply-To: richard@calvin.spp.cornell.edu.UUCP (Richard Brittain)
Organization: Cornell Space Plasma Physics Group
Lines: 33