Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
_SetVideoMode Function
◄Summary► ◄Details► ◄Example► ◄Back►
Argument
mode Video mode to be set
Returns
Integer Number of text rows if successful; otherwise 0
Description
The _SetVideoMode function selects a screen mode. If the mode
selected is not supported by the current hardware configuration,
the function returns 0. The mode argument can be any of the
constants shown in the table below.
Mode Type Size Colors Adapter
═════════════ ════ ══════════ ═══════ ══════════════════
_TextBW40 BW/T 40 columns 32 CGA
_TextC40 C/T 40 columns 32 CGA
_TextBW80 BW/T 80 columns 32 CGA
_TextC80 C/T 80 columns 32 CGA
_MRes4Color C/G 320x200 4 CGA
_MResNoColor BW/G 320x200 4 CGA
_HResBW BW/G 640x200 2 CGA
_TextMono M/T 80 columns 32 MDPA
_HercMono M/G 720x348 2 HGC
_MRes16Color C/G 320x200 16 EGA
_HRes16Color C/G 640x200 16 EGA
_EResNoColor M/G 640x350 2 EGA
_EResColor C/G 640x350 4/16 EGA
_VRes2Color C/G 640x480 2 VGA
_VRes16Color C/G 640x480 16 VGA
_MRes256Color C/G 320x200 256 VGA
_OResColor C/G 640x400 1 of 16 Olivetti graphics
Type: M monochrome
C color output
T text
G graphics
BW black and white mode
Size: Characters (columns) for text modes
Pixels (horizontal x vertical) for graphics modes
Colors: For monochrome displays, the number of colors is the
number of gray shades, not necessarily unique.
Adapters: IBM (and compatible) Monochrome Display Printer
Adapter (MDPA),
Color Graphics Adapter (CGA), Enhanced Graphics Adapter
(EGA), Video Graphics Array (VGA), Hercules Graphics
Card, (HGC), and Olivetti Graphics Adapters (OCGA,
OEGA, OVGA)
Note: Descriptions for standard hardware also apply to display
hardware 100% compatible with IBM, Hercules, or Olivetti hardware.
In addition to the constants that specify particular modes, the
following constants select modes depending on context:
Constant Mode Selection
═════════════ ═════════════════════════════════════════════════
_DefaultMode Mode on entry; use to restore original video mode
_MaxResMode Graphics mode with highest resolution
_MaxColorMode Graphics mode with most colors
Note that _MaxResMode and _MaxColorMode vary depending on the
hardware. For example with a CGA, _MaxResMode maps to _HResBW
while _MaxColorMode maps to _MRes4Color. With a VGA, _MaxResMode
maps to _VRes16Color while _MaxColorMode maps to _MRes256Color.
Hercules Support
The Hercules driver MSHERC.COM must be installed before running
a program that uses _HercMono mode. Type MSHERC to load the driver.
This can be put in your AUTOEXEC.BAT file.
If both a Hercules monochrome card and a color video card are
used, MSHERC.COM must be installed with the /H (/HALF) option.
The /H option limits the driver to one video page instead of two.
This prevents the two video cards from attempting to use the same
memory. See Hercules hardware manual for more details on
compatibility.
_GrStatus Returns
_GrError, _GrInvalidParameter, _GrModeNotSupported