home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
PROGRAM
/
VIDEO.ZIP
/
VIDIDTST.C
< prev
Wrap
C/C++ Source or Header
|
1992-06-29
|
3KB
|
94 lines
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* . *
* Video *
* *
* (c) Copyright 1988 Michael K. Heney *
* *
* File: VidIdTst.C *
* Purpose: Test driver for the VideoID package. *
* *
* Routines: main *
* *
* Written: 16 Jul 88 - 16 Jul 88 MKH *
* *
* Notes: Adapted from the VideoID program written in assembler in *
* "Programmer's Guide to PC & PS/2 Video Systems" by *
* Richard Wilton (Microsoft Press). Listing C-2, pp. 521-522. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <stdio.h>
#include "videoid.h"
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Some arrays of strings to make printing the results easier. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
char *Devices[] =
{
"None",
"MDA",
"CGA",
"EGA",
"MCGA",
"VGA"
} ;
char *Hercs[] =
{
"HGC",
"HGCPlus",
"InColor"
} ;
char *Displays[] =
{
"NoDisplay",
"MDADisplay",
"CGADisplay",
"EGAColorDisplay",
"PS2MonoDisplay",
"PS2ColorDisplay"
} ;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* main is a driver *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
main()
{
long IDval ;
int dev0, disp0, dev1, disp1 ;
IDval = VideoID() ;
disp1 = IDval & 0x00ff ;
dev1 = (IDval >> 8) & 0x00ff ;
disp0 = (IDval >> 16) & 0x00ff ;
dev0 = (IDval >> 24) & 0x00ff ;
printf("\n\n") ;
printf(" Active Device: ") ;
if (dev0 & 0x80)
printf("%-20s", Hercs[dev0 & 0x007f]) ;
else
printf("%-20s", Devices[dev0]) ;
printf("%-20s", Displays[disp0] ) ;
printf("\n") ;
printf(" Other Device: ") ;
if (dev1 & 0x80)
printf("%-20s", Hercs[dev1 & 0x007f]) ;
else
printf("%-20s", Devices[dev1]) ;
printf("%-20s\n\n", Displays[disp1] ) ;
}