Mode X

From Free net encyclopedia

(Difference between revisions)

Current revision

Mode X is an undocumented 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, which is now freely available online in PDF. [1]

Mode X involves tweaking IBM's standard Mode 13h 256 colour graphics mode such that all the video memory is made available to the programmer in a planar fashion, at the expense of extra complexity in writing to video memory. For many programmers, this expense is well worth the effort as the extra video memory available makes it possible to produce high quality 2D games or demos, things that this mode was primarily used for.

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