home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Science
/
Science.zip
/
imdisp79.zip
/
TVGA.C
< prev
next >
Wrap
Text File
|
1993-02-15
|
1KB
|
62 lines
/*
Function:
Determining if the VGA card is a Trident card
Output parameters:
1 - card is a Trident
0 - card is not a Trident
Calling protocol:
Trident = Is_It_Trident();
*/
int Is_It_Trident(void)
{
unsigned char new_value, old_value, value;
outp (0x3C4, 0x0E); /* read the Mode Control #1 Register */
old_value = inp (0x3C5);
outp (0x3C5, 0x01); /* write a new value, bit0=1, all other bits 0 */
value = inp (0x3C5) & 0x0F; /* read the new value */
outp (0x3C5, old_value); /* write the old value */
if (value == 0x02)
return(1);
else
return(0);
}
/*
Function:
Determine the Trident chip number
Output parameters:
identity - integer containing chip code
8900 = Trident 8900 chip
8800 = Trident 8800 chip
Note:
A subsequent consequence of this call is that the mode control
registers are put into their new state.
Calling protocol:
identity = Which_Trident();
*/
int Which_Trident(void)
{
unsigned char value;
outp (0x3C4, 0x0B); /* version register */
outp (0x3C5, 0x00); /* dummy write to put system into old
definitions */
value = inp (0x3C5); /* read causes new definitions */
if (value >= 0x03)
return(8900);
else
return(8800);
}