Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!cos!fetter From: fetter@cos.com (Bob Fetter) Newsgroups: comp.os.msdos.misc Subject: Re: EGA and other text screens Keywords: EGA,text screen height Message-ID: <44421@cos.com> Date: 29 Mar 91 14:05:15 GMT References: <8196@dnlunx.pttrnl.nl> Reply-To: fetter@cos.UUCP (Bob Fetter) Organization: Corporation for Open Systems, McLean, VA Lines: 43 In article <8196@dnlunx.pttrnl.nl> dondorp@dnlunx.pttrnl.nl (Dondorp E.) writes: >first thank you for the 43 line EGA emulation. it't great. > >I did write several full screen programs for the PC range of computers. >All these programs use a fixed 80x25 screen. >But now that I have this EGA emulation and since I will soon >be the proud owner of a VGA I have several questions: > >How can a program determine the width and height of the text screen. >I found out there was a BIOS call that returned the number of >character columns, but none returns the number of lines. >I tried to figure out the height via the 'get screen mode' BIOS call >only to find out that both 80x25 and 80x43 are screen mode nr 7. > >So the real question is: can I find out the screen height unambigously? > (and of course how?) > >Thanks > Erwin At *byte* location [0040:0084] in the BIOS data segment is the number of EGA/MCGA/VGA rows on screen minus one. Right after that, at :0085, is one word containing the character height in scan-lines. In C, you can get this using (my code, probably laborious style, but workable): static unsigned char far * bios_rows = (unsigned char far *)MK_FP(0x0040,0x0084); static int far * bios_cheight = (unsigned int far *)MK_FP(0x0040,0x0085); printf("Number of rows %d, char height %d\n", (int)(*bios_rows)+1,*bios_cheight); This and other goodies are in Ralf Brown's Interrupt List at SIMTEL20 at PD1:INTER490.ZIP Hope this helps. -Bob-