Hardware‎ > ‎GPU‎ > ‎



Short History

MDA/CGA - 1981
MDA is text mode only (80x25 symbols) with 256 characters in code page 473. CGA is graphical mode with a max resolution of 640x200 with 2 colors and 320x200 with 16 colors.

EGA - 1984
More resolution (640×350) and more colors, 16 colors from a palette of 64.

VGA - 1987
Mode 13h, the best graphic mode ever with 320x200 and 256 colors. Aka Mode X 320x240 for those people that prefer square pixels.

Not much of a standard, more chaos really. Everything 800x600 and up with increasing number of colors is SVGA.

To modify the video mode the BIOS is used. It can only be done in real mode. This is done by invoking a interrupt 10h with the INT x86 instruction. The action to perform is put into the AH register.

00h     Set Video Mode
0Ch     Write Graphics Pixel
0Dh     Read Graphics Pixel
10h     Set Palette Registers
4Fh     VESA Extension Functions

00h     Set Video Mode
AH = 0
AL = Video Mode number.

Mode Number Resolution x Colors Minimum System Video Segment
2h 80x25x16 CGA B800
7h 80x25 MDA B800
12h 640x480x16 VGA A000
13h 320x200x256 VGA A000
101h 640x480x256 SVGA 
103h 800x600x256 SVGA 
105h 1024x768x256 SVGA 
107h 1280x1024x256 SVGA 

0CH/ODH: Store pixel value / Return pixel value

AH = 0CH / ODH
AL = Pixel value (IN/OUT)
BH = Video page
CX = x coordinate
DX = y coordinate

10h: Set Palette registers

AH = 10h
AL = 12h (subfunction 12h: Update dac)
BX = First register
CX = Number of registers
ES:DX = Address to table of rgb values.

4F02h: Set VBE Video Mode

The Fastest Sprite in the West (Lets talk VGA, Part 2)