Mode X
Encyclopedia
Mode X is an alternative video graphics display mode of the IBM VGA graphics hardware that was popularized by Michael Abrash
Michael Abrash
Michael Abrash is a technical writer specializing in optimization and 80x86 assembly language programming, a reputation cemented by his 1990 book Zen of Assembly Language Volume 1: Knowledge. The original 8086 processor, the focus of the book, was several generations behind the state of the art by...

, 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 has square pixels: a resolution of 320x240 instead of the VGA standard Mode 13h
Mode 13h
Mode 13h is the IBM VGA BIOS mode number for a specific standard 256 color mode on IBM's VGA graphics hardware. It features a resolution of 320×200 pixels and was used extensively in computer games and art/animation software of the late 1980s and early- to mid-1990s...

 which is 320x200. Additionally, Abrash enabled the VGA's planar memory mode (also called "unchained mode"). Even though planar memory mode was a documented part of the VGA standard, 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.

The term "Mode X" was coined by Michael Abrash, who called it this in his articles. Though this mode had been used earlier by others (i.e. in many commercial games), it became widely known after Abrash's articles.

Planar memory arrangement splits the pixels horizontally into groups of four. For any given byte in the PC video memory aperture, you can access four pixels on screen, by selecting the plane(s) you require. This is more complicated for the programmer, but the advantages gained by this arrangement were considered very worthwhile by many, and Mode X found considerable use in demos
Demo (computer programming)
A demo is a non-interactive multimedia presentation made within the computer subculture known as the demoscene. Demogroups create demos to demonstrate their abilities in programming, music, drawing, and 3D modeling...

 and 2D
2D computer graphics
2D computer graphics is the computer-based generation of digital images—mostly from two-dimensional models and by techniques specific to them...

 games.

The main uses of the extra memory are:
  • Higher resolutions: up to 360x480 in 256 colours is possible
  • Double buffering
    Double buffering
    In computer science, multiple buffering is the use of more than one buffer to hold a block of data, so that a "reader" will see a complete version of the data, rather than a partially-updated version of the data being created by a "writer"...

     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 usually do in the 320x240 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.

"Mode Q" ('Q' being short for "Cube") is often used to refer to the Chain-4 256x256x256 colours VGA-compatible tweak mode. This mode's advantage is the simplistic and fast method for addressing 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 being needed like other video modes.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK