Detecting Colour and Monochrome Monitors: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content added Content deleted
m (Standardised code to C99.) |
mNo edit summary |
||
Line 1: | Line 1: | ||
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 |
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 ISO C) to retrieve this: |
||
== The Function == |
== The Function == |
Revision as of 04:12, 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 ISO C) to retrieve this:
The Function
/* Video card mono/colour detection. Return values: false=mono true=colour */ _Bool detectVideoType(void) { _Bool type; char c=(*(volatile USHORT*)0x410)&0x30; //c can be 0x00 or 0x20 for colour, 0x30 for mono. if(c==0x30){ return(true); //Monochrome monitor. } else { return(false); //Colour monitor. } }