Jump to content

Mode X

From Wikipedia, the free encyclopedia

Mode Xis an alternative 256-colorgraphics display modeof theIBMVGAgraphics hardware that was popularized byMichael Abrash.The primary advantage of Mode X is that it has square pixels: a resolution of320 × 240instead of the standard VGAMode 13hwhich is320 × 200.It is enabled by enteringMode 13hvia anMS-DOSsystem call, then adjusting the resolution through VGA registers. It was first published in July 1991 inDr. Dobb's Journal,and republished in chapters 47-49 of Abrash'sGraphics Programming Black Book.[1]The term "Mode X" was coined by Abrash.

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 standard320 × 200mode, which became known asMode Yin theUsenetrec.games.programmer group.[3][4]

Planar memory arrangement splits the pixels horizontally into groups of four. For any given byte in 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.

Another advantage of the320 × 240mode is that3D objectsdon't need ratio adjustment when they rotate, because each pixel is perfectly square. And circles don't look squeezed at on a monitor with4:3 aspect ratioin this resolution because mathematically the divisions 320:240 and 4:3 give the same result, which is the reason why the pixels are perfectly square in this mode on such monitors.

Variants[edit]

In addition to unchained320 × 200being called Mode Y,Mode Q(short for "cube" ) is sometimes used to refer to a256 × 256256-color mode.[5][6]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.

References[edit]

  1. ^Abrash, Michael.Michael Abrash's Graphics Programming Black Book Special Edition.The Coriolis Group, Scottsdale Arizona, 1997.ISBN1-57610-174-6:PDF available online[1]Archived2007-03-11 at theWayback Machine
  2. ^Abrash, Michael.Michael Abrash's Graphics Programming Black Book Special Edition.The Coriolis Group, Scottsdale Arizona, 1997.ISBN1-57610-174-6:PDF available online[2]Archived2007-03-11 at theWayback Machinepg. 877
  3. ^"Mode Y".August 1993.Retrieved2007-04-05.
  4. ^Roberts, Dave.PC Game Programming Explorer.The Coriolis Group, Scottsdale Arizona, 1994.ISBN1-883577-07-1.Page 106.
  5. ^Robert Schmidt."tweak16b".1993. Archived fromthe originalon 2015-08-11.Retrieved2015-07-18.
  6. ^Bas van Gaalen."Tweaked 256x256x256 Chained".August 1994.

External links[edit]