Text mode

from Wikipedia, the free encyclopedia

When text mode up to the appearance of the first refers to video games and GUI - operating systems ( Mac OS , TOS , AmigaOS ) customary mode of graphics hardware . In contrast to the graphics mode , the software does not manage individual pixels with their respective colors, but individual characters such as letters and numbers. These characters are then converted into pixels by the computer's graphics hardware. This prevents graphics from being displayed in high resolution, but it also enormously reduces the need for graphics memory, significantly reduces the programming effort, and speeds up programs, since usually only one or two bytes are required in the video RAM per character.

Usual resolutions range from 40 × 25 characters, which is the largest practically usable resolution for TV screens, over 80 × 25, which is still the mode in which PC graphics cards are after booting, up to 132 × 50 which were used by text-based spreadsheets and similar programs under DOS that have to display a lot of information at the same time. Other variants were 80 × 24 (many mainframe terminals ), 64 × 16 ( Tandy TRS-80 Model 1 ) or 22 × 23 ( Commodore VC20 , so more rows than columns!).

The individual characters usually have a fixed size of 8 × 8 to 9 × 16 pixels (in the early days with much higher memory prices also 5 × 7), whereby only characters with a width of 8 pixels are supported on PC graphics cards. These are stored in a separate character memory, see also the character generator . Depending on the computer and graphics card model, this character generator can be an immutable ROM or a RAM that can be changed by the user; only in the latter case can the user define and use his own character shapes.

The character memory in PC graphics cards stores the characters as a bitmap, with each character requiring as many bytes as it is pixels high. In the ROM of the EGA cards there are two character sets with the character size 8 × 8 and 8 × 14 pixels, with VGA cards there is an 8 × 16 character set. User-defined character sets, which are possible from EGA, can be 1 to 32 pixel lines high.

Text modes on CGA / EGA / VGA graphics cards with standard character sets
Character size Graphics resolution (in pixels)
from CGA: 640 × 200 from EGA: 640 × 350 from VGA: 640 × 400 640 × 480
8 × 8 80 × 25 80 × 43 80 × 50 80 × 60
8 × 14 80 × 14 80 × 25 80 × 28 80 × 34
8 × 16 80 × 12 80 × 21 80 × 25 80 × 30

The highlighted modes are the text modes directly supported by the BIOS ; the rest can only be achieved by programming the graphics card directly. The horizontal graphics resolution in text mode of the VGA card is 720 pixels by default. This means that each character is 9 pixels wide, which improves the legibility of the text display as the spaces between the letters increase somewhat. Since only 8 pixels per character are stored in the character memory, the color of the 9th pixel is determined separately: For most characters this pixel is in the background color, except for the characters with the code values ​​C0 hex to DF hex . With these characters the 8th pixel of each character is repeated. This achieves a seamless transition between graphic and frame characters . The ROM character sets are usually encoded in code page 437 , which accommodates the graphic and frame characters that such horizontal connections can form with their adjacent characters on the right. Both the 9 pixel wide characters and the special handling of the characters C0 hex to DF hex can, however, be deactivated via direct programming of the graphics card register.

Only the character number is stored in the video RAM for each character. On PC systems this is always 8 bits, so 256 different characters can be addressed; In addition, a so-called attribute byte is stored for each character , which codes the color of the character or special character attributes (bold type, underlining, flashing, etc.).

  Standard colors for CGA / EGA / VGA (number also in hex)
Division of the bits in the attribute byte of CGA / EGA / VGA
bit meaning
0..2 Foreground color (character color)
3 Bold (foreground color) / Second character set
4..6 Background color
7th Flashing / background color
number colour RGB value (approx.)
0 black # 000000   
1 blue # 0000AA   
2 green # 00AA00   
3 Cyan # 00AAAA   
4th red # AA0000   
5 violet # AA00AA   
6th brown # AA5500   
7th Gray #AAAAAA   
number colour RGB value (approx.)
8th Dark gray # 555555   
9 Light Blue # 5555FF   
10 / A Light green # 55FF55   
11 / B Light cyan # 55FFFF   
12 / C Bright red # FF5555   
13 / D purple # FF55FF   
14 / E yellow # FFFF55   
15 / F White #FFFFFF   

Bold print is mostly simulated by a lighter color. This means that 16 different foreground colors can be displayed on color graphics cards. The meaning of bit 7 can be reprogrammed so that it allows either flashing characters or 8 additional (light) background colors. From EGA, however, the 16 colors can be reprogrammed so that a more free choice of colors is possible.

A special feature of the EGA / VGA cards is that they can display two character sets (and thus up to 512 different characters) at the same time. Bit 3 of the attribute byte determines from which character set the character is to be taken. By default, both character sets are identical. The Linux console masters this feature as soon as a screen font with more than 256 characters is loaded. Here, colors 8 to 15 are reprogrammed so that they are identical to colors 0 to 7, so that the characters from the second character set are not displayed lighter. There is therefore no longer any “bold print” available.

By using special "block characters", low-resolution "blocks" graphics can be displayed in text mode. If the foreground and background color are cleverly chosen for each character, simple multicolored images can be generated. In the on-screen text , this function has been very commonly used in Teletext this is still common. Some systems also allow the user to redefine character shapes; In connection with hardware-supported soft scrolling and so-called sprites for foreground elements, this technology allows, for example, the display of fast-moving backgrounds for computer games in text mode, which can then hardly be recognized as such. This approach was used, for example, in many games for the 8-bit computers from Commodore.

Computer systems for business use mostly only had a text mode until the early 1980s . It wasn't until the advent of video games and home computers that graphics mode became common; some home computers, such as the Schneider / Amstrad CPC and the Commodore Amiga , no longer had a text mode at all. The Apple Macintosh models of the 68000 series and the PowerPC series did not have a text mode, the BIOS- based or emulating computers have text mode to this day, but it is hardly used by most users since Windows 95 became popular in 1995. It is only still active for a short time when the computer is started. If you maximize a command prompt window (Alt + Enter, no longer possible from Windows Vista), the computer is also set to text mode. Linux or Unix-like operating systems always know the text mode in their console , the graphics mode is optional.

Since support for the text mode on modern graphics cards rarely goes beyond the resolutions and refresh rates of the VGA cards (some Super VGA cards support text modes with 132 text columns, which corresponds to a graphics resolution of 1056 pixels), some operating systems use their text console now also has a graphics mode and emulates the behavior of the text mode completely in software. Since the amount of data to be processed is significantly larger, such an emulated text console is significantly slower (e.g. when scrolling ) than a hardware text mode (see also: Linux frame buffer console ).

Older television sets and video recorders often have graphics chips that only have a text mode for on-screen menus and teletext. These then contain special character sets (often mask-programmed ) that are cleverly used to create symbols or even light and shadow effects.

See also

Web links

Individual evidence

  1. refit.sourceforge.net: Myths and Facts About Intel Macs