Mode X

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Mode X is an alternative graphics display mode of the IBM VGA graphics hardware that was popularized by Michael Abrash. It was first published in July 1991 in Dr. Dobb's Journal, and republished in chapters 47-49 of Abrash's Graphics Programming Black Book (now freely available online).[1] The term "Mode X" was coined by Abrash.

The primary advantage of Mode X is that it has square pixels: a resolution of 320×240 instead of the standard VGA Mode 13h which is 320×200. Additionally, Abrash enabled the VGA's planar memory mode (also called "unchained mode"). Even though planar memory mode is a documented part of the VGA standard and was used in earlier commercial games,[2] it was first widely publicized in the Mode X articles, leading many programmers to consider Mode X and planar memory synonymous. It is possible to enable planar memory in standard 320x200 mode, which became known as Mode Y in the Usenet rec.games.programmer group;[3][4] this setup is used in the popular 1993 game Doom, for instance.

Planar memory arrangement splits the pixels horizontally into groups of four. For any given byte in PC video memory, four pixels on screen can be accessed depending on which plane(s) are enabled. This is more complicated for the programmer, but the advantages gained by this arrangement—primarily the ability to use all 256 KB of VGA memory for one or more display buffers, instead of only one quarter of that (64 KB)—were considered worthwhile by many.

Variants[edit]

In addition to unchained 320x200 being called Mode Y, Mode Q (short for "cube") is sometimes used to refer to a 256×256 256 colour mode.[5][6] This allows simple and fast addressing of pixels in memory based on the X and Y coordinates. The Y coordinate can simply be put in the high byte of the address, and the X coordinate in the low byte, forming the address of the pixel without a multiply, shift, or lookup.

References[edit]

  1. ^ Abrash, Michael. Michael Abrash's Graphics Programming Black Book Special Edition. The Coriolis Group, Scottsdale Arizona, 1997. ISBN 1-57610-174-6: PDF available online [1] Archived 2007-03-11 at the Wayback Machine
  2. ^ Abrash, Michael. Michael Abrash's Graphics Programming Black Book Special Edition. The Coriolis Group, Scottsdale Arizona, 1997. ISBN 1-57610-174-6: PDF available online [2] Archived 2007-03-11 at the Wayback Machine pg. 877
  3. ^ "Mode Y". August 1993. Retrieved 2007-04-05.
  4. ^ Roberts, Dave. PC Game Programming Explorer. The Coriolis Group, Scottsdale Arizona, 1994. ISBN 1-883577-07-1. Page 106.
  5. ^ Robert Schmidt."tweak16b". 1993.
  6. ^ Bas van Gaalen. "Tweaked 256x256x256 Chained". August 1994.

External links[edit]