ANSI

An ANSI screen consists of 4,000 bytes representing an 80 by 25 block of text. Each character on the screen takes up two bytes in the resource: the first byte is simply the character's 8-bit ASCII value, while the second byte gives color information. This means you can use the line-drawing characters in the extended ASCII character set from IBM's CP437.

The second byte is further broken down into three pieces. Bits 0-3 give the foreground color, 4-6 give the background color, and bit 7 is a flag that tells whether the character should blink. The colors are standard ANSI colors used by DOS. The reason why the foreground has an extra bit is because the higher colors are all bright, and the background is restricted to display darker colors only. So the first eight colors can be used for anything, the last eight colors can be used for the foreground only.

ANSI screens are displayed only for the ENDOOM (or ENDTEXT, or ENDSTRF) screen and the Heretic startup. They cannot be used in-game.

ANSI colorsCP437 characters
Background and Foreground Foreground Only
CodeColorCodeColor
0Black 8Dark Gray
1Blue 9Light Blue
2Green ALight Green
3Cyan BLight Cyan
4Red CLight Red
5Magenta DLight Magenta
6Brown EYellow
7Light Gray/White FBright White

This information is from the Unofficial Doom Specs and the DOS "color" command.

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.