Mail Archives: djgpp-workers/2001/08/01/05:11:26
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 -