This call sets the mode of the display.
VioSetMode
ModeData (PVIOMODEINFO) - input
length (USHORT)
Bit
1 = Native mode.
1 = Disable color burst.
1 = Graphics mode.
1 = Other.
Value
VioSetMode initializes the cursor position and type.
VioSetMode does not clear the screen. To clear the screen, use one of the VioScrollxx calls.
The disable color burst bit in the Type field in the VioSetMode data structure is functional only for the CGA and VGA. This bit causes the color portion of the video signal to be suppressed, producing a black and white mode on composite monitors attached to the CGA. On VGA, the bit causes the color lookup table to be loaded with values that produce shades of gray instead of colors, again producing a black and white mode. For all other combinations of adapters and displays, the setting of this bit is recorded and returned on any subsequent VioGetMode call, but otherwise is ignored.
For text modes in full-screen sessions, the number of rows on the screen is determined by the availability of fonts of the correct size. For any specified mode, the size of the character defined by the font must be (Horizontal Resolution)/(Text Columns) dots wide and (Vertical Resolution)/(Text Rows) dots high. For example, an 8x8 font would support 39 through 43 text rows if the screen resolution were 640x350.
If VioSetState request type 6 has been issued previously to select the target display configuration for VioSetMode, the mode is set on the display configuration selected. If that display configuration does not support the mode specified, an error is returned.
Assuming no target display configuration for VioSetMode is selected, the mode is set on the primary configuration. If the primary configuration does not support the mode specified, the mode is set on the secondary configuration.
The table below shows the VioSetMode parameters required to set all the modes supported by the CGA, EGA, VGA, and PS/2 Display Adapters. The modes native to the 8514/A and other advanced video adapters are set with the Adapter (programming) Interface to these adapters, not VioSetMode.
Note: Although graphics mode support is provided in VioSetMode, this support is not provided by the Base Video Handlers provided with OS/2.
─────────────────────────────────────────────────────────────────────
Table 5-1. Display Mode Attributes Supported by Adapters
─────────────────────────────────────────────────────────────────────
BIOS TYPE COLOR COLS ROWS HRES VRES VALID ADAPTER/DISPLAY
MODE COMBINATIONS [EMULATED]
─────────────────────────────────────────────────────────────────────
0 5 4 40 25 320 200 [CGA/CD], CGA/Comp,
[EGA/CD], [EGA/ECD],
VGA/Mono, VGA/Color,
VGA/Plasma
─────────────────────────────────────────────────────────────────────
0* 5 4 40 25 320 350 [EGA/ECD], VGA/Mono,
VGA/Color, VGA/Plasma
─────────────────────────────────────────────────────────────────────
0+ 5 4 40 25 360 400 VGA/Mono, VGA/Color
─────────────────────────────────────────────────────────────────────
0# 5 4 40 25 320 400 VGA/Mono, VGA/Color,
VGA/Plasma
─────────────────────────────────────────────────────────────────────
1 1 4 40 25 320 200 CGA/CD, CGA/Comp,
EGA/CD, EGA/ECD,
[VGA/Mono], VGA/Color,
[VGA/Plasma]
─────────────────────────────────────────────────────────────────────
1* 1 4 40 25 320 350 EGA/ECD, [VGA/Mono],
VGA/Color, [VGA/Plasma]
─────────────────────────────────────────────────────────────────────
1+ 1 4 40 25 360 400 [VGA/Mono], VGA/Color
─────────────────────────────────────────────────────────────────────
1# 1 4 40 25 320 400 [VGA/Mono], VGA/Color,
[VGA/Plasma]
─────────────────────────────────────────────────────────────────────
2 5 4 80 25 640 200 [CGA/CD], CGA/Comp,
[EGA/CD], [EGA/ECD],
VGA/Mono, VGA/Color,
VGA/Plasma
─────────────────────────────────────────────────────────────────────
2* 5 4 80 25 640 350 [EGA/ECD], VGA/Mono,
VGA/Color, VGA/Plasma
─────────────────────────────────────────────────────────────────────
2+ 5 4 80 25 720 400 VGA/Mono, VGA/Color
─────────────────────────────────────────────────────────────────────
2# 5 4 80 25 640 400 VGA/Mono, VGA/Color,
VGA/Plasma
─────────────────────────────────────────────────────────────────────
3 1 4 80 25 640 200 CGA/CD, CGA/Comp,
EGA/CD, EGA/ECD,
[VGA/Mono], VGA/Color,
[VGA/Plasma]
─────────────────────────────────────────────────────────────────────
3* 1 4 80 25 640 350 EGA/ECD, [VGA/Mono],
VGA/Color, [VGA/Plasma]
─────────────────────────────────────────────────────────────────────
3+ 1 4 80 25 720 400 [VGA/Mono], VGA/Color
─────────────────────────────────────────────────────────────────────
3# 1 4 80 25 640 400 [VGA/Mono], VGA/Color,
[VGA/Plasma]
-────────────────────────────────────────────────────────────────────
7 0 0 80 25 720 350 MPA/MD, EGA/MD,
VGA/Mono, VGA/Color
─────────────────────────────────────────────────────────────────────
7+ 0 0 80 25 720 400 VGA/Mono, VGA/Color
─────────────────────────────────────────────────────────────────────
7# 0 0 80 25 640 400 VGA/Mono, VGA/Color,
VGA/Plasma
─────────────────────────────────────────────────────────────────────
n/a 0 0 80 25 640 350 VGA/Mono, VGA/Color,
VGA/Plasma
─────────────────────────────────────────────────────────────────────
n/a 1 4 80 30 720 480 [VGA/Mono], VGA/Color
─────────────────────────────────────────────────────────────────────
n/a 1 4 80 30 640 480 [VGA/Mono], VGA/Color,
[VGA/Plasma]
─────────────────────────────────────────────────────────────────────
4 3 2 [40] [25] 320 200 CGA/CD, CGA/Comp,
EGA/CD, EGA/ECD,
[VGA/Mono], VGA/Color,
[VGA/Plasma]
─────────────────────────────────────────────────────────────────────
5 7 2 [40] [25] 320 200 [CGA/CD], CGA/Comp,
[EGA/CD], [EGA/ECD],
VGA/Mono, VGA/Color,
VGA/Plasma
─────────────────────────────────────────────────────────────────────
6 3 1 [80] [25] 640 200 CGA/CD, CGA/Comp,
EGA/CD, EGA/ECD,
VGA/Mono, VGA/Color,
VGA/Plasma
─────────────────────────────────────────────────────────────────────
D 3 4 [40] [25] 320 200 EGA/CD, EGA/ECD,
[VGA/Mono], VGA/Color,
[VGA/Plasma]
─────────────────────────────────────────────────────────────────────
E 3 4 [80] [25] 640 200 EGA/CD, EGA/ECD,
[VGA/Mono], VGA/Color,
[VGA/Plasma]
─────────────────────────────────────────────────────────────────────
F 2 0 [80] [25] 640 350 EGA/MD, VGA/Mono,
VGA/Color, VGA/Plasma
─────────────────────────────────────────────────────────────────────
10 3 4 [80] [25] 640 350 EGA/ECD, [VGA/Mono],
VGA/Color, [VGA/Plasma]
─────────────────────────────────────────────────────────────────────
11 3 1 [80] [30] 640 480 VGA/Mono, VGA/Color,
VGA/Plasma
─────────────────────────────────────────────────────────────────────
12 3 4 [80] [30] 640 480 [VGA/Mono], VGA/Color,
[VGA/Plasma]
─────────────────────────────────────────────────────────────────────
13 3 8 [40] [25] 320 200 [VGA/Mono], VGA/Color,
[VGA/Plasma]
─────────────────────────────────────────────────────────────────────
n/a 11 8 [80] [30] 640 480 [8514A/Mono],
8514A/Color
─────────────────────────────────────────────────────────────────────
n/a 11 4 [80] [30] 640 480 [8514A/Mono],
8514A/Color
─────────────────────────────────────────────────────────────────────
n/a 11 8 [85] [38] 1024 768 [8514A/HMono],
8514A/HColor
─────────────────────────────────────────────────────────────────────
n/a 11 4 [85] [38] 1024 768 [8514A/HMono],
8514A/HColor
─────────────────────────────────────────────────────────────────────
Display Adapters:
MPA Monochrome/Printer Adapter
CGA Color Graphics Adapter
EGA Enhanced Graphics Adapter
VGA Video Graphics Array, PS/2 Display Adapter
8514A 8514/A Display Adapter
─────────────────────────────────────────────────────────────────────
Displays:
MD 5151 Monochrome Display
CD 5153 Color Display
ECD 5154 Enhanced Color Display
MONO 8503 PS/2 Monochrome Display, 8507/8604 Display
HMONO 8507/8604 Display
COLOR 8512/13 PS/2 Color Display, 8514 Display
HCOLOR 8514 Display
PLASMA Plasma Display Panel
COMP Composite Video Monitor
Notes:
1. Types 0, 1, and 5 are text modes; types 2, 3, 7, and 11 are
graphics modes.
2. For BIOS modes 0, 2, 5, the color burst is disabled on the
CGA and VGA.
3. The Personal System/2 Display Adapter 8514/A(TM) has advanced
function modes, which are supported through the 8514/A display
adapter interface, not the VIO Subsystem. Refer to the
Personal System/2 Display Adapter 8514/A Technical Reference
for details of this support.
─────────────────────────────────────────────────────────────────────
Note: For text modes in full-screen, the number of rows may differ
from the
mode table due to the availability of fonts of the correct size as described
above.
PM Considerations
Windowable VIO sessions support only 80-column, color text modes. When VioSetMode
is called from a Windowable VIO session, it only verifies that an 80-column
text mode was requested, with Text Rows between 1 and 255. The resulting
mode, which can be queried using VioGetMode,
always has Type = 1, Color = 4, Text Columns = 80,
Text Rows = requested Text Rows, Horizontal Resolution = 640, and Vertical
Resolution = 16 * (Text Rows).
Family API Considerations
Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following consideration applies to VioSetMode when coding for the DOS mode:
VioSetMode clears the screen.