no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Next revision | |||
— | en:docs:fapi:viosetmode [2018/09/01 10:05] – created prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | This call sets the mode of the display. | ||
+ | |||
+ | ==Syntax== | ||
+ | | ||
+ | |||
+ | ==Parameters== | ||
+ | ;ModeData ([[PVIOMODEINFO]]) - input : Address of the mode characteristics structure: | ||
+ | ::length (USHORT) : Input parameter to VioSetMode. Length specifies the length of the data structure in bytes including Length itself. The minimum structure size required is 3 bytes. OS/2 sets to the first mode (in the list of modes supported by this display configuration) with a data structure matching the mode data specified. | ||
+ | ::type (UCHAR): Mode characteristics bit mask: | ||
+ | ''' | ||
+ | | ||
+ | | ||
+ | 1 = Native mode. | ||
+ | | ||
+ | 1 = Disable color burst. | ||
+ | | ||
+ | 1 = Graphics mode. | ||
+ | | ||
+ | 1 = Other. | ||
+ | ::numcolors (UCHAR): Number of colors defined as a power of 2. This is equivalent to the number of color bits that define the color, for example: | ||
+ | ''' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ::textcols (USHORT): Number of text columns. | ||
+ | ::textrows (USHORT): Number of text rows. | ||
+ | ::pelcols (USHORT): Horizontal resolution, number of pel columns. | ||
+ | ::pelrows (USHORT): Vertical resolution, number of pel rows. | ||
+ | ::Attribute Format (UCHAR): Identifies the format of the attributes. | ||
+ | ::Number of Attributes (UCHAR): Identifies the number of attributes in a character cell. | ||
+ | ::Buffer Address (ULONG): 32-bit physical address of the physical display buffer for this mode. | ||
+ | ::Buffer Length (ULONG): Length of the physical display buffer for this mode. | ||
+ | ::Full Buffer Size (ULONG): Size of the buffer required for a full save of the physical display buffer for this mode. | ||
+ | ::Partial Buffer Size (ULONG): Size of the buffer required for a partial (pop-up) save of the physical display buffer for this mode. | ||
+ | ::Extended Data Area Address (PCH): Far address to an extended mode data structure or zero if none. The format of the extended mode data structure is determined by the device driver and is unknown to OS/2. | ||
+ | ;VioHandle (HVIO) - input : Reserved word of 0s. | ||
+ | |||
+ | ==Return Code== | ||
+ | rc (USHORT) - return | ||
+ | Return code descriptions are: | ||
+ | *0 | ||
+ | *355 ERROR_VIO_MODE | ||
+ | *430 ERROR_VIO_ILLEGAL_DURING_POPUP | ||
+ | *436 ERROR_VIO_INVALID_HANDLE | ||
+ | *438 ERROR_VIO_INVALID_LENGTH | ||
+ | *465 ERROR_VIO_DETACHED | ||
+ | *467 ERROR_VIO_FONT | ||
+ | *468 ERROR_VIO_USER_FONT | ||
+ | *494 ERROR_VIO_EXTENDED_SG | ||
+ | |||
+ | ==Remarks== | ||
+ | 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)/ | ||
+ | |||
+ | 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. | ||
+ | {|class=" | ||
+ | |+Table 5-1. Display Mode Attributes Supported by Adapters | ||
+ | |- | ||
+ | !BIOS MODE||TYPE||COLOR||COLS||ROWS||HRES||VRES||VALID ADAPTER/ | ||
+ | |- | ||
+ | |0||5||4||40||25||320||200||[CGA/ | ||
+ | |- | ||
+ | |0*||5||4||40||25||320||350||[EGA/ | ||
+ | |- | ||
+ | |0+||5||4||40||25||360||400||VGA/ | ||
+ | |- | ||
+ | |0#||5||4|| 40||25||320||400||VGA/ | ||
+ | |- | ||
+ | |1||1||4||40||25||320||200||CGA/ | ||
+ | |- | ||
+ | |1*||1||4|| 40||25||320||350||EGA/ | ||
+ | |- | ||
+ | |1+||1||4|| 40||25||360||400||[VGA/ | ||
+ | |- | ||
+ | |1# | ||
+ | |- | ||
+ | ||2||5||4||80||25||640||200||[CGA/ | ||
+ | |- | ||
+ | ||2*||5||4||80||25||640||350||[EGA/ | ||
+ | |- | ||
+ | |2+||5||4||80||25||720||400||VGA/ | ||
+ | |- | ||
+ | |2# | ||
+ | |- | ||
+ | |3||1||4||80||25||640||200||CGA/ | ||
+ | |- | ||
+ | |3*||1||4||80||25||640||350||EGA/ | ||
+ | |- | ||
+ | |3+||1||4||80||25||720||400||[VGA/ | ||
+ | |- | ||
+ | |3#||1||4|| 80||25||640||400||[VGA/ | ||
+ | |- | ||
+ | |7||0||0||80||25||720||350||MPA/ | ||
+ | |- | ||
+ | |7+||0||0||80||25||720||400||VGA/ | ||
+ | |- | ||
+ | |7# | ||
+ | |- | ||
+ | |n/ | ||
+ | |- | ||
+ | |n/ | ||
+ | |- | ||
+ | |n/ | ||
+ | |- | ||
+ | |4||3||2||[40]||[25]||320||200||CGA/ | ||
+ | |- | ||
+ | |5||7||2||[40]||[25]||320||200||[CGA/ | ||
+ | |- | ||
+ | |6||3||1||[80]||[25]||640||200||CGA/ | ||
+ | |- | ||
+ | |D||3||4||[40]||[25]||320||200||EGA/ | ||
+ | |- | ||
+ | |E||3||4||[80]||[25]||640||200||EGA/ | ||
+ | |- | ||
+ | |F||2||0||[80]||[25]||640||350||EGA/ | ||
+ | |- | ||
+ | |10||3||4||[80]||[25]||640||350||EGA/ | ||
+ | |- | ||
+ | |11||3||1||[80]||[30]||640||480||VGA/ | ||
+ | |- | ||
+ | |12||3||4||[80]||[30]||640||480||[VGA/ | ||
+ | |- | ||
+ | |13||3||8||[40]||[25]||320||200||[VGA/ | ||
+ | |- | ||
+ | |n/ | ||
+ | |- | ||
+ | |n/ | ||
+ | |- | ||
+ | |n/ | ||
+ | |- | ||
+ | |n/ | ||
+ | |- | ||
+ | |colspan=8|Display Adapters: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |- | ||
+ | |colspan=8|Displays: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Notes: | ||
+ | #Types 0, 1, and 5 are text modes; types 2, 3, 7, and 11 are graphics modes. | ||
+ | #For BIOS modes 0, 2, 5, the color burst is disabled on the CGA and VGA. | ||
+ | #The Personal System/2 Display Adapter 8514/A™ has advanced function modes, which are supported through the 8514/A display adapter interface, not the VIO Subsystem. Refer to the '' | ||
+ | |} | ||
+ | Note: For text modes in full-screen, | ||
+ | |||
+ | ===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. | ||
+ | |||
+ | ==Bindings== | ||
+ | === C Binding=== | ||
+ | <PRE> | ||
+ | typedef struct _VIOMODEINFO { | ||
+ | USHORT cb; /* Length of the entire data structure | ||
+ | UCHAR fbType; | ||
+ | UCHAR color; | ||
+ | USHORT col; /* Number of text columns | ||
+ | USHORT row; /* Number of text rows */ | ||
+ | USHORT hres; /* Horizontal resolution | ||
+ | USHORT vres; /* Vertical resolution | ||
+ | UCHAR fmt_ID; | ||
+ | UCHAR attrib; | ||
+ | ULONG buf_addr; | ||
+ | ULONG buf_length; | ||
+ | ULONG full_length; | ||
+ | ULONG partial_length; | ||
+ | PCH ext_data_addr; | ||
+ | } VIOMODEINFO; | ||
+ | typedef VIOMODEINFO far *PVIOMODEINFO; | ||
+ | |||
+ | #define INCL_VIO | ||
+ | |||
+ | USHORT | ||
+ | |||
+ | PVIOMODEINFO | ||
+ | HVIO | ||
+ | |||
+ | USHORT | ||
+ | </ | ||
+ | |||
+ | ===MASM Binding=== | ||
+ | <PRE> | ||
+ | VIOMODEINFO struc | ||
+ | viomi_cb | ||
+ | viomi_fbType | ||
+ | viomi_color | ||
+ | viomi_col | ||
+ | viomi_row | ||
+ | viomi_hres | ||
+ | viomi_vres | ||
+ | viomi_fmt_ID | ||
+ | viomi_attrib | ||
+ | viomi_buf_addr | ||
+ | viomi_buf_length | ||
+ | viomi_full_length | ||
+ | viomi_partial_length dd ? ; | ||
+ | viomi_ext_data_addr | ||
+ | VIOMODEINFO ends | ||
+ | |||
+ | EXTRN VioSetMode: | ||
+ | INCL_VIO | ||
+ | |||
+ | PUSH@ OTHER | ||
+ | PUSH | ||
+ | CALL | ||
+ | |||
+ | Returns WORD | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== Note ====== | ||
+ | |||
+ | Text based on [[http:// | ||
+ | |||
+ | {{page> | ||
+ | |||