Category : Files from Magazines
Archive   : PCTJ8707.ZIP
Filename : EGA_INFO.C

 
Output of file : EGA_INFO.C contained in archive : PCTJ8707.ZIP
/*
* ega_info -- gather information about an EGA;
* return a non-zero value if one is found
*/

#include

#define ALT_FUNCTION 0x12
#define EGA_INFO 0x10
#define NMODES 2
#define NMEMSIZ 4
#define VIDEO_IO 0x10

int
ega_info(memsize, mode, features, switches)
int *memsize; /* EGA memory size indicator: 0 = 64K */
/* 1 = 128K; 2 = 192K; 3 = 256K */
int *mode; /* 0 = color mode; 1 = mono mode */
/* use getstate function to find out which mode */
unsigned int
*features, /* feature bit settings */
*switches; /* EGA switch settings */
{
int result = 0;
union REGS inregs, outregs;

/* request EGA information */
inregs.h.ah = ALT_FUNCTION;
inregs.h.bl = EGA_INFO;
int86(VIDEO_IO, &inregs, &outregs);

*memsize = outregs.h.bl;
*mode = outregs.h.bh;
*features = outregs.h.ch;
*switches = outregs.h.cl;

/* return non-zero if EGA installed */
if (*memsize >= 0 && *memsize < NMEMSIZ &&
*mode >= 0 && *mode < NMODES)
result = 1;
return (result);
}


  3 Responses to “Category : Files from Magazines
Archive   : PCTJ8707.ZIP
Filename : EGA_INFO.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/