[alt.msdos.programmer] Turbo C console i/o routines and non-standard video modes

richard@calvin.EE.CORNELL.EDU (Richard Brittain) (11/15/89)

Hello, 
    I'm writing some code that I would like to be usable in non-standard
text modes like 43x80 and larger.  As I don't have the neccessary hardware to
hack on I hope that someone can tell me if this is worth pursuing:
1)  Whether Borlands console i/o routines will work (cputs, cprintf etc.) in
    a window larger than 25x80
2)  Whether the standard i/o routines will work, assuming the display is
    already in the required mode, or can be set using something nnansi.sys

I have already established that the gettextinfo() routine does not return
the correct screen size but I think I can fix that.  If the window() routine
won't accept the larger values however, it isn't worth it.
With the large screen capabilities on some video cards, is the normal way to
provide for them by giving replacement bios routines for int 10h, or do they
usually provide a replacement console device driver and do everything via that.

Thanks in advance

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

raymond@ptolemy.arc.nasa.gov (Eric A. Raymond) (11/15/89)

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.


-- 
Eric A. Raymond  (raymond@ptolemy.arc.nasa.gov)
G7 C7 G7 G#7 G7 G+13 C7 GM7 Am7 Bm7 Bd7 Am7 C7 Do13 G7 C7 G7 D+13: Elmore James

richard@calvin.EE.CORNELL.EDU (Richard Brittain) (11/16/89)

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

eclarke@ironside.uucp (Eric S. Clarke) (11/28/89)

In article <2090@calvin.EE.CORNELL.EDU> richard@calvin.EE.CORNELL.EDU (Richard Brittain) writes:
>1)  Whether Borlands console i/o routines will work (cputs, cprintf etc.) in
>    a window larger than 25x80
>2)  Whether the standard i/o routines will work, assuming the display is
>    already in the required mode, or can be set using something nnansi.sys
>
>I have already established that the gettextinfo() routine does not return
>the correct screen size but I think I can fix that.  

I have used cputs, cprintf etc., in text windows of 135x43 on an EGA and 135x50
on a VGA with no problems.  I am not sure why you claim gettextinfo() doesn't 
work.  I have used it to get the info for the windows I mentioned above.  If it
wasn't working that is news to me.

I don't know if you are talking about standard DOS i/o routines or Borland's
standard i/o routines in paragraph two.  I also don't know what a nnansi.sys
is.  I can guess that nnansi.sys is a replacement ansi.sys supplied by some
VGA card maker but that is only a guess.  It would be nice to have a little 
more info.

The above statements are only my opinions.  They in no way reflect the official
opinions of IBM or of IBM AWD Development.



Eric S. Clarke                                   UUCP: uunet!ibmsupt!eclarke
1510 Page Mill Road                              COM:  415-855-4458
Palo Alto, CA 94304                              TIE:  465-4458