Mail Archives: djgpp-workers/1998/07/21/17:29:41
According to Eli Zaretskii:
>
> On Sun, 19 Jul 1998, Nate Eldredge wrote:
>
> > Looks like there's an XMS call, and also perhaps a BIOS call. The BIOS
> > is INT 15h/AX=2401h, and XMS seems to be a far call with AH=03h or 05h
> > (not sure which one is appropriate). See the INTLIST.
>
> Martin, could you please see whether these eliminate the crashes in
> _set_screen_lines?
Sorry but no. It still crashes. I've tried the BIOS INT15/2401 variant.
This is the output of the the program at the end of this message:
ah = 0x86
which means "function not supported" according to the interrupt list.
As I said before I don't understand how to test the XMS variant; could
somebody explain how to test that?
New Model Army, Small Town England,
MartinS
#include <errno.h>
#include <dpmi.h>
#include <go32.h>
#include <conio.h>
#include <stdio.h>
/* Stretch a 8x8 font to the 8x10 character box. This is required to
use 80x40 mode on a VGA or 80x35 mode on an EGA, because the
character
box is 10 lines high, and the ROM BIOS doesn't have an appropriate
font.
So we create one from the 8x8 font by adding an extra blank line
from each side. */
static int font_seg = -1;
static void
maybe_create_8x10_font(void)
{
unsigned char *p;
unsigned long src, dest, i, j;
if (font_seg == -1)
{
__dpmi_regs regs;
int buf_pm_sel;
/* Allocate buffer in conventional memory. */
font_seg = __dpmi_allocate_dos_memory(160, &buf_pm_sel);
if (font_seg == -1)
return;
/* Get the pointer to the 8x8 font table. */
p = (unsigned char *)malloc(2560); /* 256 chars X 8x10 pixels */
if (p == (unsigned char *)0)
{
errno = ENOMEM;
__dpmi_free_dos_memory(buf_pm_sel);
font_seg = -1;
return;
}
regs.h.bh = 3;
regs.x.ax = 0x1130;
__dpmi_int(0x10, ®s);
src = ( ( (unsigned)regs.x.es ) << 4 ) + regs.x.bp;
dest = ( (unsigned)font_seg ) << 4;
fprintf(stderr, "es = 0x%x; bp = 0x%x; font_seg = 0x%x; src =
0x%x; dest =
0x%x.\n", regs.x.es, regs.x.bp, font_seg, src, dest);
/* Now copy the font to our table, stretching it to 8x10. */
_farsetsel(_dos_ds);
for (i = 0; i < 256; i++)
{
/* Fill first extra scan line with zeroes. */
_farnspokeb(dest++, 0);
for (j = 0; j < 8; j++)
{
unsigned char val = _farnspeekb(src++);
_farnspokeb(dest++, val);
}
/* Fill last extra scan line with zeroes. */
_farnspokeb(dest++, 0);
}
}
}
int main()
{
__dpmi_regs regs;
regs.x.ax = 0x2401;
__dpmi_int(0x15, ®s);
fprintf(stderr, "ah = 0x%x.\n", regs.h.ah);
maybe_create_8x10_font();
return(0);
}
- Raw text -