🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #212

Re: # of Rows on screen

#212
From: Andy Hakim
Date: Tue, 04 Aug 1992 07:27
29 lines
1834 bytes
pshuang@zurich.ai.mit.edu (Ping Huang) writes:
: In article <eoq.9@vthnw.cvm.msu.edu> eoq@vthnw.cvm.msu.edu (Edward Quillen) writes:
: 
:  >   1) Determining # of rows for the current console(ie. 25,43,50)
:  >   2) Switching to different modes
:  > 
:  > I've looked at INT 10h (AH=11h) but had problems.
:  > A DOS solution would preferable to BIOS if one exists.
: 
: I don't think DOS documents a way to determine these numbers. I needed
: to do this recently, and this is what I decided to use (notice the code
: gives the highest priority to an end-user specified configuration value,
: then to what the video BIOS tells it, then finally falls back to 80x25):

//......................................................... Video Info .......
unsigned char far *video_mode   = MK_FP(0x0000, 0x0449); // MK_FP specific to  
unsigned      far *video_cols   = MK_FP(0x0000, 0x044A); // tc, bc.
unsigned char far *video_rows   = MK_FP(0x0000, 0x0484);
unsigned char far *video_page   = MK_FP(0x0000, 0x0462);
unsigned      far *video_pgsize = MK_FP(0x0000, 0x044C);
unsigned char far *video_chsize = MK_FP(0x0000, 0x0485);
unsigned      far *video_baseio = MK_FP(0x0000, 0x0463);
 
The row count stored at that memory location is 1 minus the actual
number of rows.  ie: if the screen was in 25 line mode, it would report 24.

printf ("number of rows = %d\n", *video_rows);

to set mode, use bios calls.
Technical Details
Message-ID: <1992Aug4.072721.7687@menudo.uh.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!cosc16to
References: <PSHUANG.92Aug3204855@freeside.ai.mit.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!cosc16to
From: cosc16to@menudo.uh.edu (Andy Hakim)
Subject: Re: # of Rows on screen
Message-ID: <1992Aug4.072721.7687@menudo.uh.edu>
Organization: University of Houston
X-Newsreader: Tin 1.1 PL4
References: <PSHUANG.92Aug3204855@freeside.ai.mit.edu>
Date: Tue, 4 Aug 1992 07:27:21 GMT
Lines: 29