This is off-topic, memories of this, but digging up the code I found this:
/* Global Variables */
static Word far *ScrPtr;
/* Local Variables */
static Word VidSeg;
...
int WinScreenHeight(void)
{
return (*(unsigned char far *) 0x484) + 1;
}
int WinScreenWidth(void)
{
return (*(unsigned int far *) 0x44A);
}
void WinInit(){
SetMode(AdapterType());
ScrPtr = (Word far *) CreateFarPtr(VidSeg, 0x0000);
}
static void SetMode(int VideoAddress)
{
switch(VideoAddress)
{
case VGA :
case MCGA:
case EGA :
case CGA : (Word) VidSeg = 0xB800;
break;
case MDA : (Word) VidSeg = 0xB000;
break;
case ? : fprintf(stderr, "Sorry Unknown Video Adapter.
");
fprintf(stderr, "This program requires C/E/MC/VGA, Mono Adapter
");
exit(1);
}
}
static int AdapterType(void)
{
char far *VidMode;
char blreg, alreg;
VidMode = (char far *) 0x00000449L;
asm mov ax, 0x1a00;
asm push bp;
asm int 0x10;
asm pop bp;
asm mov blreg, bl;
asm mov alreg, al;
if (alreg == 0x1a && blreg >= 9) return(MCGA);
if (alreg == 0x1a && blreg >= 7 && blreg <= 9) return(VGA);
if (blreg == 4 || blreg == 5) return(EGA);
if (*VidMode == 3) return(CGA);
if (*VidMode == 7) return(MDA);
return( ? );
}
Hope this helps,
Best regards,
Tom.