en:docs:fapi:viosetmode

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:docs:fapi:viosetmode [2021/08/14 13:11] prokusheven:docs:fapi:viosetmode [2021/09/19 04:15] (current) prokushev
Line 1: Line 1:
-{{logos:os2.gif?35x35}} {{logos:dos.gif?35x35}}+{{page>en:templates:fapiint}}
  
 ====== VioSetMode ====== ====== VioSetMode ======
Line 5: Line 5:
 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== +===== 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. +  * ModeData ([[PVIOMODEINFO]]) - input : Address of the mode characteristics structure: 
-::type (UCHAR): Mode characteristics bit mask: +    *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. 
- '''Bit  Description''' +    *type (UCHAR): Mode characteristics bit mask: 
- 7-4  Reserved, set to zero. + 
-    0 = VGA-compatible modes 0 thru 13H. +Bit Description ^ 
-      1 = Native mode. +7-4 Reserved, set to zero. | 
-    0 = Enable color burst +|   0 = VGA-compatible modes 0 thru 13H. | 
-      1 = Disable color burst. +|:::|      1 = Native mode. | 
-    0 = Text mode. +|   0 = Enable color burst | 
-      1 = Graphics mode. +|:::|      1 = Disable color burst. | 
-    0 = Monochrome compatible mode. +   0 = Text mode. | 
-      1 = Other. +| :::|     1 = Graphics mode. | 
-::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: + |  0 = Monochrome compatible mode. | 
- '''Value  Definition''' +| :::|     1 = Other. | 
-      Monochrome modes 7, 7+, and F. + 
-      2 colors. +    * 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: 
-      4 colors. + 
-      16 colors. +Value Definition ^ 
-      256 colors. + Monochrome modes 7, 7+, and F. | 
-::textcols (USHORT): Number of text columns. +2 colors. | 
-::textrows (USHORT): Number of text rows. +4 colors. | 
-::pelcols (USHORT): Horizontal resolution, number of pel columns. +16 colors. | 
-::pelrows (USHORT): Vertical resolution, number of pel rows. +256 colors. | 
-::Attribute Format (UCHAR): Identifies the format of the attributes. + 
-::Number of Attributes (UCHAR): Identifies the number of attributes in a character cell. +    * textcols (USHORT): Number of text columns. 
-::Buffer Address (ULONG): 32-bit physical address of the physical display buffer for this mode. +    textrows (USHORT): Number of text rows. 
-::Buffer Length (ULONG): Length of the physical display buffer for this mode. +    pelcols (USHORT): Horizontal resolution, number of pel columns. 
-::Full Buffer Size (ULONG): Size of the buffer required for a full save of the physical display buffer for this mode. +    pelrows (USHORT): Vertical resolution, number of pel rows. 
-::Partial Buffer Size (ULONG): Size of the buffer required for a partial (pop-up) save of the physical display buffer for this mode. +    Attribute Format (UCHAR): Identifies the format of the attributes. 
-::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. +    Number of Attributes (UCHAR): Identifies the number of attributes in a character cell. 
-;VioHandle (HVIO) - input : Reserved word of 0s.+    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== 
- 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 136: Line 148:
 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:
Line 146: Line 160:
 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 175: 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 204: 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)]]