Thursday, August 12, 2010

Mode 13h

Start at the Beginning
Table of Contents

Mode 13h is the name of the 'graphics mode' most classic DOS games ran in. Telling the computer to go into Mode 13h caused it to set the screen resolution to 320x200, and to use the screen format described above - 8 bits per pixel using a palette, 18 bits per palette entry.

Old computers used a standard graphics system called the VGA - short for Video Graphics Array. It had a number of graphics modes, each with their own dedicated number. Standard DOS text mode is mode 3. Mode 13h is the mode we'll be using in this volume, for the sake of simplicity and nostalgia. The 'h' after 13 means that 13 should be read as a hexadecimal number. In decimal, that's:

1x16^1 + 3x16^0
= 16 + 3
= 19

An alternate representation of hexadecimal numbers, the one used by the C programming language, is prefixing them with 0x - e.g. "we're going to tell the computer to switch into Mode 0x13".

No comments:

Post a Comment