home *** CD-ROM | disk | FTP | other *** search
- /*
- VideoidC - Identifies the graphics card and disply in a PC.
- This code is from:
- Programmers Guide to PC & PS/2 Video Systems.
- R. Wilton, Microsoft Press, Redmond, WA. 1987
- */
-
-
-
- #include <stdio.h>
-
- main()
- {
- char *SubsystemName();
- char *DisplayName();
-
- static struct
- {
- char Subsystem;
- char Display;
- }
- VIDstruct[2];
-
- VideoID( VIDstruct );
- printf ("Video subsystem in this computer:");
-
- printf ("\n %s (%s) ", SubsystemName(VIDstruct[0].Subsystem),
- DisplayName(VIDstruct[0].Display) );
- if ( VIDstruct[1].Subsystem )
- printf ("\n %s (%s) ",SubsystemName(VIDstruct[1].Subsystem),
- DisplayName(VIDstruct[1].Display) );
-
- }
-
- char *SubsystemName (a)
- char a;
- {
- static char *IBMname[] =
- {
- "(GA_none)",
- "MDA",
- "CGA",
- "EGA",
- "MCGA",
- "VGA"
- };
-
- static char *Hercname[] =
- {
- "HGC",
- "HGC+",
- "InColor"
- };
-
- if (a & 0x80)
- return (Hercname [a & 0x7F]);
- else
- return (IBMname [a]);
- }
-
-
- char *DisplayName (d)
- char d;
- {
- static char *name[] =
- {
- "(Display_none)",
- "MDA-compatible monochrome display",
- "CGA-compatible color display",
- "EGA-compatible color display",
- "PS/2-compatible monochrome display",
- "PS/2-compatible color display"
- };
- return ( name[d] );
- }
-