Text mode

From Wikipedia, the free encyclopedia

Screenshot of the MS-DOS command line interface, a typical use of the text mode display.
Screenshot of the MS-DOS command line interface, a typical use of the text mode display.
WordPerfect 5.1 for DOS on the IBM PC only used the text mode display.
WordPerfect 5.1 for DOS on the IBM PC only used the text mode display.

Text mode is a kind of computer display mode in which the content of the screen is internally represented in terms of textual characters rather than individual pixels. Typically, the screen consists of a uniform grid of character cells, each of which contains one of the characters of the character set.

Text mode video rendering came to prominence in the early 1970s, when video-oriented text terminals started to replace teleprinters in the interactive use of computers.

Text mode applications communicate with the user with command-line interfaces and text user interfaces. Many character sets used in text mode applications also contain a limited set of predefined semi-graphical characters usable for drawing boxes and other rudimentary graphics which can be used to highlight the content or to simulate widget or control interface objects found in GUI programs. A typical example is the IBM code page 437 character set.

The advantages of text modes compared to graphics modes include lower memory consumption and faster screen manipulation. Also, text mode applications have relatively low bandwidth requirements in remote terminal use. An obvious disadvantage of text mode is the restricted screen content, which makes text mode impractical for many types of applications.

An important characteristic of text mode programs is that they assume constant width fonts, where every character has the same width on screen, which allows to easily maintain the vertical alignment when displaying semi-graphical characters. This was influenced by the use of early teletype-like and daisy-like fixed-pitch type printers, but also by applications designed for punched cards. This way, the output seen on the screen could be sent directly to the printer maintaining exactly the same format, somewhat in a fashion that is now called WYSIWYG (What You See Is What You Get).

Depending on the environment, the screen buffer can be directly addressable. Programs that display output on remote video terminals must issue special control sequences to manipulate the screen buffer. The most popular standards for such control sequences are ANSI and VT100.

Programs accessing the screen buffer through control sequences may lose synchronization with the actual display, and so many text mode programs have a redisplay everything command, often associated with the Ctrl-L key combination.

Norton Utilities 6.01, an example of avanced TUI which redefines the character set to show tiny graphical widgets, icons and an arrow pointer in text mode.
Norton Utilities 6.01, an example of avanced TUI which redefines the character set to show tiny graphical widgets, icons and an arrow pointer in text mode.

The border between text mode and graphical programs can sometimes be fuzzy, especially on the PC's VGA hardware, because many later text mode programs tried to push the model to the extreme by playing with the video controller. For example, they redefined the character set in order to create custom semi-graphical characters, or even created the appearance of a graphical mouse by redefining the appearance of the characters over which the mouse was shown at a given time.

Text mode rendering with user-defined characters has also been useful for 2D computer and video games because the game screen can be manipulated much faster than with pixel-oriented rendering.

Many modern programs with a graphical interface simulate the display style of text mode programs, notably when it is important to preserve the vertical alignment of text, e.g., during computer programming. There exist also software components to emulate text mode, such as terminal emulators or command line consoles. In Microsoft Windows, the Win32 console usually opens in emulated, graphical window mode but it can be switched to full screen, true text mode and vice versa by pressing the Alt and Enter keys together.

Contents

[edit] Technical basis

A video controller implementing a text mode usually uses two distinct areas of memory: a character memory containing the pixel structure of each character of the font in use, and a display matrix, "character pointer table" or screen buffer tracking which character is in each cell.

The character memory usually resides in a read-only memory by default. However, many systems also allow the use of RAM for this purpose, making it possible to redefine the character set for application-specific purposes. The use of RAM-based characters also facilitates some special techniques, such as the implementation of a pixel-graphics framebuffer. In some historical graphics chips, including the TMS9918, the MOS Technology VIC, and the Game Boy graphics hardware, this was actually the canonical way of doing pixel graphics.

Text modes often assign attributes to the displayed characters. For example, the VT100 terminal allows each character to be underlined, brightened, blinking or inverse. Color-supporting devices usually allow the color of each character, and often the background color as well, to be selected from a limited palette of colors. These attributes can either coexist with the character indices or use a different memory area called color memory or attribute memory.

Some text mode implementations also have the concept of line attributes. For example, the VT100-compatible line of text terminals supports the doubling of the width and height of the characters on individual text lines.

[edit] PC Common Text Modes

Depending on the graphics adapter used, a variety of text modes are available on IBM PC compatible computers. They are listed on the table below:

Text res. Char. size Graphics res. Colors Adapters
80×25 9×14 720×350 B&W Text MDA, Hercules
40×25 8×8 320×200 16 colors CGA, EGA
80×25 8×8 640×200 16 colors CGA, EGA
80×25 8×14 640×350 16 colors EGA
80×43 8×8 640×350 16 colors EGA
80×25 9×16 720×400 16 colors VGA
80×50 9×8 720×400 16 colors VGA
80×60 16 colors VESA-compatible Super VGA
132×25 16 colors VESA-compatible Super VGA
132×43 16 colors VESA-compatible Super VGA
132×50 16 colors VESA-compatible Super VGA
132×60 16 colors VESA-compatible Super VGA

MDA text could be emphasized with bright, underline, reverse and blinking attributes.

Video cards in general are backward compatible, i.e. EGA supports all MDA and CGA modes, VGA supports MDA, CGA and EGA modes.

By far the most common text mode used in DOS environments, and initial Windows consoles, is the default 80 columns by 25 rows, or 80×25, with 16 colors. This mode was available on practically all IBM and compatible personal computers. All 80×25 modes also had a virtual 80×24 mode, used by some applications that needed a status bar on the last row, like terminal emulators. In reality, it was the same 80×25 mode, but restrained by software to make the last row unaccesible.

Two other VGA text modes, 90×43 and 90×50, exist but were very rarely used. The 40 column text modes were never very popular, and were used only for demonstration purposes or with very old hardware.

Character sizes and graphical resolutions for the extended VESA-compatible Super VGA text modes are manufacturer's dependent. Also on these display adapters, available colors can be halved from 16 to 8 when a second customized character set is employed (giving a total repertorie of 512 —instead the common 256— different graphic characters simultaneously displayed on the screen).

Some cards (e.g. S3) supported custom very large text modes, like 100×37 or even 160×120. In Linux systems, a program called SVGATextMode was often used with SVGA cards to set up very large console text modes.

[edit] See also

[edit] External links