Mode X
From Wikipedia, the free encyclopedia
Mode X is an alternative video graphics display mode of the IBM VGA graphics hardware that was popularized by Michael Abrash, first published in July 1991 in Dr. Dobb's Journal, republished in chapters 47-49 of Abrash's Graphics Programming Black Book (now freely available online ).
The primary advantage of Mode X is that it quadruples the accessable video memory, permitting several useful techniques such as hardware Double buffering and vertical scrolling. It also has square pixels (the resolution is 320x240 instead of the the VGA standard Mode 13h, which is 320x200).
The term "Mode X" was coined by Michael Abrash, who called it this in his articles. Though this mode had been discovered independantly by othersMode 13h 256-color graphics mode, but then enabling the VGA's planar memory mode (also called "unchained" mode), giving the programmer access to the entire VGA memory, and making many other modifications to the video behavior possible.
, it found little use before Abrash's articles outlined its advantages. The mode is engaged by beginning in the standardThe planar memory arrangment distributes each pixel among four different bytes in memory, which is more complicated for the programmer, but the advantages gained by this arrangment were considered very worthwhile by many, and Mode X found considerable use in demos and 2D games.
The main uses of the extra memory are:
- Higher resolutions: up to 360x480 in 256 colours is possible
- Double Buffering and Triple Buffering for flicker free animation
- Smooth hardware scrolling of the video display window
- Graphics stored in 'off-screen' VRAM can quickly be moved around in VRAM using the VGA latches
- Planar mode allows up to 4 adjoining pixels to be modified in one byte write operation, which is ideal for solid filling of objects such as polygons, rectangles, lines, etc.
- Screen splitting, where one part of the display is taken from one area of memory and the other from a different area, which is ideal for status displays in games that utilise smooth hardware scrolling
- Square pixels are possible where the height/width ratio matches the monitor's, as they do in the 360x240 mode.
Simply turning on unchained mode but leaving the resolution at 320x200 became informally known as "Mode Y" in the Usenet rec.games.programmer group [1]
[edit] References
- Abrash, Michael. Michael Abrash's Graphics Programming Black Book Special Edition. The Coriolis Group, Scottsdale Arizona, 1997. ISBN 1-57610-174-6 (↑1 : PDF available online[2]) (↑2 : pg. 877)