en:docs:fapi:viosetmode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:viosetmode [2018/09/01 10:05] – created prokusheven:docs:fapi:viosetmode [2021/09/19 04:15] (current) prokushev
Line 1: Line 1:
 +{{page>en:templates:fapiint}}
 +
 +====== VioSetMode ======
 +
 This call sets the mode of the display. This call sets the mode of the display.
  
-==Syntax== +===== Syntax ===== 
- VioSetMode (ModeData, VioHandle)+ 
 +<code c> 
 +VioSetMode (ModeData, VioHandle) 
 +</code> 
 + 
 +===== 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: 
 + 
 +^ Bit ^ Description ^ 
 +| 7-4 | Reserved, set to zero. | 
 +| 3 |   0 = VGA-compatible modes 0 thru 13H. | 
 +|:::|      1 = Native mode. | 
 +| 2 |   0 = Enable color burst | 
 +|:::|      1 = Disable color burst. | 
 +| 1 |    0 = Text mode. | 
 +| :::|     1 = Graphics mode. | 
 +| 0  |  0 = Monochrome compatible 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: 
 + 
 +^ Value ^ Definition ^ 
 +| 0  | Monochrome modes 7, 7+, and F. | 
 +| 1 | 2 colors. | 
 +| 2 | 4 colors. | 
 +| 4 | 16 colors. | 
 +| 8 | 256 colors. | 
 + 
 +    * 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 =====
  
-==Parameters== +rc (USHORT) - return
-;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: +
- '''Bit  Description''' +
- 7-4  Reserved, set to zero. +
-    0 = VGA-compatible modes 0 thru 13H. +
-      1 = Native mode. +
-    0 = Enable color burst +
-      1 = Disable color burst. +
-    0 = Text mode. +
-      1 = Graphics mode. +
-    0 = Monochrome compatible 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: +
- '''Value  Definition''' +
-      Monochrome modes 7, 7+, and F. +
-      2 colors. +
-      4 colors. +
-      16 colors. +
-      256 colors. +
-::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: Return code descriptions are:
-*0   NO_ERROR  
-*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==+  *0   NO_ERROR  
 +  *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 initializes the cursor position and type.
  
Line 67: Line 84:
  
 Note: Although graphics mode support is provided in VioSetMode, this support is not provided by the Base Video Handlers provided with OS/2. Note: Although graphics mode support is provided in VioSetMode, this support is not provided by the Base Video Handlers provided with OS/2.
-{|class="wikitable" + 
-|+Table 5-1. Display Mode Attributes Supported by Adapters +Table 5-1. Display Mode Attributes Supported by Adapters 
-|- + 
-!BIOS MODE||TYPE||COLOR||COLS||ROWS||HRES||VRES||VALID ADAPTER/DISPLAY COMBINATIONS [EMULATED] +^BIOS MODE^TYPE^COLOR^COLS^ROWS^HRES^VRES^VALID ADAPTER/DISPLAY 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||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||350||[EGA/ECD], VGA/Mono, VGA/Color, VGA/Plasma +|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] | 
-|0+||5||4||40||25||360||400||VGA/Mono, VGA/Color +|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| 
-|0#||5||4|| 40||25||320||400||VGA/Mono, VGA/Color, VGA/Plasma +|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 | 
-|1||1||4||40||25||320||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| 
-|1*||1||4|| 40||25||320||350||EGA/ECD, [VGA/Mono], VGA/Color, [VGA/Plasma] +|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] | 
-|1+||1||4|| 40||25||360||400||[VGA/Mono], VGA/Color +|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| 
-|1#||1||4||40||25||320||400||[VGA/Mono], VGA/Color, [VGA/Plasma] +|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| 
-||2||5||4||80||25||640||200||[CGA/CD], CGA/Comp, [EGA/CD], [EGA/ECD], VGA/Mono, VGA/Color, VGA/Plasma +|7+|0|0|80|25|720|400|VGA/Mono, VGA/Color| 
-|- +|7#|0|0|80|25|640|400|VGA/Mono, VGA/Color, VGA/Plasma| 
-||2*||5||4||80||25||640||350||[EGA/ECD], 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| 
-|2+||5||4||80||25||720||400||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]| 
-|2#||5||4||80||25||640||400||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| 
-|3||1||4||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]| 
-|3*||1||4||80||25||640||350||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]| 
-|3+||1||4||80||25||720||400||[VGA/Mono], VGA/Color +|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]| 
-|3#||1||4|| 80||25||640||400||[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| 
-|7||0||0||80||25||720||350||MPA/MD, EGA/MD, VGA/Mono, VGA/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| 
-|7+||0||0||80||25||720||400||VGA/Mono, VGA/Color +|n/a|11|4|[85]|[38]|1024|768|[8514A/HMono], 8514A/HColor| 
-|- + 
-|7#||0||0||80||25||640||400||VGA/Mono, VGA/Color, VGA/Plasma +  MPA       Monochrome/Printer Adapter 
-|- +  CGA       Color Graphics Adapter 
-|n/a||0||0||80||25||640||350||VGA/Mono, VGA/Color, VGA/Plasma +  EGA       Enhanced Graphics Adapter 
-|- +  VGA       Video Graphics Array, PS/2 Display Adapter 
-|n/a||1||4||80||30||720||480||[VGA/Mono], VGA/Color +  8514A     8514/A Display Adapter 
-|- + 
-|n/a||1||4|| 80||30||640||480||[VGA/Mono], VGA/Color, [VGA/Plasma] +  MD        5151 Monochrome Display 
-|- +  CD        5153 Color Display 
-|4||3||2||[40]||[25]||320||200||CGA/CD, CGA/Comp, EGA/CD, EGA/ECD, [VGA/Mono], VGA/Color,[VGA/Plasma] +  ECD       5154 Enhanced Color Display 
-|- +  MONO      8503 PS/2 Monochrome Display, 8507/8604 Display 
-|5||7||2||[40]||[25]||320||200||[CGA/CD], CGA/Comp, [EGA/CD], [EGA/ECD], VGA/Mono, VGA/Color, VGA/Plasma +  HMONO     8507/8604 Display 
-|- +  COLOR     8512/13 PS/2 Color Display, 8514 Display 
-|6||3||1||[80]||[25]||640||200||CGA/CD, CGA/Comp, EGA/CD, EGA/ECD, VGA/Mono, VGA/Color, VGA/Plasma +  HCOLOR    8514 Display 
-|- +  PLASMA    Plasma Display Panel 
-|D||3||4||[40]||[25]||320||200||EGA/CD, EGA/ECD, [VGA/Mono], VGA/Color, [VGA/Plasma] +  COMP      Composite Video Monitor
-|- +
-|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 +
-|- +
-|colspan=8|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 +
-|- +
-|colspan=8|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: Notes:
Line 166: Line 145:
 #For BIOS modes 0, 2, 5, the color burst is disabled on the CGA and VGA. #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 ''Personal System/2 Display Adapter 8514/A Technical Reference'' for details of this support. #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 ''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. 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===+==== 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). 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===+==== 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: 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.  VioSetMode clears the screen. 
  
-==Bindings== +===== Bindings ===== 
-=== C Binding=== + 
-<PRE>+==== C Binding==== 
 +<code c>
 typedef struct _VIOMODEINFO { typedef struct _VIOMODEINFO {
   USHORT cb;                    /* Length of the entire data structure  */   USHORT cb;                    /* Length of the entire data structure  */
Line 206: Line 190:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===MASM Binding=== +====MASM Binding==== 
-<PRE>+<code asm>
 VIOMODEINFO struc VIOMODEINFO struc
   viomi_cb             dw ? ;Length of the entire data structure   viomi_cb             dw ? ;Length of the entire data structure
Line 235: Line 219:
  
 Returns WORD Returns WORD
-</PRE>+</code>
  
  
-====== Note ======+===== Note =====
  
 Text based on [[http://www.edm2.com/index.php/VioSetMode_(FAPI)]] Text based on [[http://www.edm2.com/index.php/VioSetMode_(FAPI)]]