delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/21/11:22:07

Date: Sun, 21 Nov 1999 10:28:50 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Chaos <chengin AT alpha DOT net DOT pl>
cc: djgpp AT delorie DOT com
Subject: Re: fprintf() and using under graphic modes
In-Reply-To: <8176ml$or0$1@portraits.wsisiz.edu.pl>
Message-ID: <Pine.SUN.3.91.991121102831.25798V@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 20 Nov 1999, Chaos wrote:

> I was surpprised, that fprintf put a very nice text prompt in 640*480*256c
> mode (0x101).
> 
> Now i'm wondering if I can do it safelly. Can I stick with printing text
> messages such as timer or player name using only printf-familly functions.
> Are there any limitations in using those functions in graphics modes? I
> suspect they are only text modes functions.

fprintf will work provided that your system and/or video BIOS supports
the graphics mode in question.  This works because fprintf eventually
calls a function of the BIOS interrupt 10h.  If your BIOS supports
text output in the graphics mode you are using, it will work.

AFAIK, for VESA modes such a support is not universally available on
all the SVGA cards out there; caveat emptor.

One way of telling if the particular mode is supported by the BIOS is
to call the DJGPP functions ScreenRows() and ScreenCols() and compare
their results with the number of text rows and columns for the
graphics mode you switched into (which you need to know in advance).
If the numbers compare equal, there's a good chance you can use
fprintf.

> And what about erasing buffer (text buffer) in graphics modes. I
> know that i sends strings to stdout but, could this mess my VRAM in
> graphic mode?

If you erase the text, any graphics under it will be erased as well.
But the graphics in other places of the screen will be left
unaffected.

> Is ther a limit how much memory can I use in the following example:
> 
> __dpmi_set_segment_limit(VideSelector,XXXXXXX);

That depends on how did you create the selector VideSelector.  You
don't tell that, so I don't think anybody can answer this question.

In general, there is no limit (up to the maximum amount of VM that you
have available), but some selectors created by certain DPMI functions
have inherent limitations.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019