delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/01/05:11:26

Date: Wed, 1 Aug 2001 11:49:32 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp-workers AT delorie DOT com
Subject: Re: djgpp: djgpp/src/libc/posix/termios/tmwrite.c
In-Reply-To: <200107312149.RAA16033@delorie.com>
Message-ID: <Pine.SUN.3.91.1010801114831.14932I-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 31 Jul 2001, cvs-snowball AT delorie DOT com wrote:

> *** 75,80 ****
>     screen.max_row = (int)_farnspeekb(0x484);
>     screen.max_col = (int)_farnspeekw(0x44a) - 1;
> -   screen.video_buffer = 0xb800 * 16;
>   
>     r.h.ah = 0x08;
>     r.h.bh = screen.active_page;
> --- 76,87 ----
>     screen.max_row = (int)_farnspeekb(0x484);
>     screen.max_col = (int)_farnspeekw(0x44a) - 1;
>   
> +   /* Use the current mode to determine
> +      if the screen is in monochrome mode.  */
> +   screen.is_mono = (_farnspeekb(0x449) == 7);
> + 
> +   /* Determine the video offset.  */
> +   screen.video_buffer = screen.is_mono ? 0xb000 * 16 : 0xb800 * 16;
> + 

This reminds me: conio.c contains special support for DOS/V systems,
which don't let you access the actual video memory, but instead
emulate that access.  (That's because the PC works in graphics mode,
to be able to draw Far-Eastern characters, but pretends to be in text
mode as far as DOS is concerned.)

The upshot of this is that you need to call a special function (see
refreshvirtualscreen on conio.c) to signal DOS/V that it should update
the actual screen from its virtual contents at 0xb800 or wherever.

Since the above code cares about the video buffer address, maybe it
needs that code as well?  OTOH, if only BIOS functions are used to
write text and move cursor, this problem is irrelevant to termios.

Also, why did you need your own code to figure out the address of the
primary screen?  The _go32_info_block variable already has it, ready
to be used.

- Raw text -


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