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

 
Output of file : DSPYINFO.C contained in archive : PCTJ8707.ZIP
/*
* dspyinfo -- display information about installed adapters
*/

#include
#include

#define MDA_SEG 0xB000
#define CGA_SEG 0xB800

main()
{
int mdaflag, egaflag, cgaflag;
int ega_mem, ega_mode;
unsigned int features, switches;
static int memtab[] = {
64, 128, 192, 256
};

extern int getstate();
/* current video mode information (declared in getstate) */
extern short Vmode, Vwidth, Vpage;
extern int ega_info(int *, int *, unsigned *, unsigned *);
extern int memchk(unsigned int, unsigned int);

mdaflag = egaflag = cgaflag = 0;

/* look for display adapters */
if (ega_info(&ega_mem, &ega_mode, &features, &switches))
++egaflag;
if (egaflag) {
puts("Enhanced graphics adapter installed");
printf("\tEGA memory size = %d-KB\n",
memtab[ega_mem]);
printf("\tEGA is in %s mode\n",
ega_mode ? "monochrome" : "color");
}

if (egaflag && ega_mode == 0) {
/* look for IBM monochrome memory */
if (memchk(MDA_SEG, 0))
++mdaflag;
}
else {
/* look for color/graphics memory */
if (memchk(CGA_SEG, 0))
++cgaflag;
}
if (mdaflag)
puts("Monochrome adapter installed");
if (cgaflag)
puts("Color/graphics adapter installed");

/* report video settings */
getstate();
printf("Video state: mode=%d width=%d page=%d\n",
Vmode, Vwidth, Vpage);

exit(0);
}


  3 Responses to “Category : Files from Magazines
Archive   : PCTJ8707.ZIP
Filename : DSPYINFO.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/