ANSI

From ZDoom Wiki
Jump to: navigation, search

An MiniWikipediaLogoIcon.pngANSI 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 MiniWikipediaLogoIcon.pngCP437.

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 colors CP437 characters
Background and Foreground Foreground Only Vga-rom-font.png
Code Color Code Color
0 Black 8 Dark Gray
1 Blue 9 Light Blue
2 Green A Light Green
3 Cyan B Light Cyan
4 Red C Light Red
5 Magenta D Light Magenta
6 Brown E Yellow
7 Light Gray/White F Bright White

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

External links