Detecting Colour and Monochrome Monitors: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content deleted Content added
No edit summary |
m Fixed syntax, formatted page. |
||
Line 1:
Detecting
== The Function ==
<pre>
/*
int detect_video_type(void)
{
Line 12:
char c=(*(volatile USHORT*)0x410)&0x30;
/
if(c==0x30){
rc=0; //Monochrome
} else {
else▼
▲ rc=1; // colour
}
return rc;
}
|
Revision as of 01:04, 17 August 2007
Detecting whether a user has a colour or monochrome video card is a trivial task. The BIOS data segment has a value in it for this information. Below is a function (in ANSI C) to retrieve this:
The Function
/* video card mono/colour detection by Dark Fiber returns 0=mono, 1=colour */ int detect_video_type(void) { int rc; char c=(*(volatile USHORT*)0x410)&0x30; //c can be 0x00 or 0x20 for colour, 0x30 for mono. if(c==0x30){ rc=0; //Monochrome monitor. } else { rc=1; //Colour monitor. } return rc; }