Table of Contents

This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

VioGetPhysBuf

This call gets addressability to the physical display buffer.

Syntax

VioGetPhysBuf (DisplayBuf, Reserved)

Parameters

Returns the selectors (each of word-length) that address the physical display buffer. The first selector returned in the list, addresses the first 64KB of the physical display buffer or displaybuflen, whichever is smaller. If displaybuflen is greater than 64KB, the second selector addresses the second 64KB. The last selector returned in the list, addresses the remainder of the display buffer. The application is responsible for ensuring enough space is reserved for the selector list to accommodate the specified buffer length.

selector (SEL)

            First selector
          selector (SEL)
             Next selector 
          selector (SEL)
             ... ... 
          selector (SEL)
            Last selector
* Reserved (USHORT) - input : Reserved word of 0s.

Return Code

rc (USHORT) - return

Return code descriptions are:

Remarks

If displaybuflen = 0, VioGetPhysBuf returns a selector that addresses the physical display buffer corresponding to the current mode. One selector is returned in Selector List. If a VioGetPhysBuf is issued after a VioGetBuf, then all VioWrtXX calls will on longer be written to the LVB. They will only be written to the physical display buffer. An application uses VioGetPhysBuf to get addressability to the physical display buffer. The selector returned by VioGetPhysBuf may be used only when an application program is executing in the foreground. When an application wants to access the physical display buffer, the application must call VioScrLock. VioScrLock either waits until the program is running in the foreground or returns a warning when the program is running in the background. For more information refer to VioScrLock and VioScrUnLock.

The buffer range specified for the physical screen buffer must fall between hex 'A0000' and 'BFFFF' inclusive. An application may issue VioGetPhysBuf only when it is running in the foreground. An application may issue VioGetPhysBuf more than once.

Bindings

C Binding

typedef struct _VIOPHYSBUF {   /* viopb */
  PBYTE    pBuf;               /* Buffer start address */
  ULONG    cb;                 /* Buffer length */
  SEL      asel[1];            /* Selector list */
} VIOPHYSBUF;
 
#define INCL_VIO
 
USHORT  rc = VioGetPhysBuf(Structure, Reserved);
 
PVIOPHYSBUF      Structure;     /* Data structure */
USHORT           Reserved;      /* Reserved (must be zero) */
 
USHORT           rc;            /* return code */

MASM Binding

VIOPHYSBUF struc
  viopb_pBuf dd  ? ;Buffer start address
  viopb_cb   dd  ? ;buffer length
  viopb_asel dw  1 dup (?) ;selector list
VIOPHYSBUF ends
 
EXTRN  VioGetPhysBuf:FAR
INCL_VIO            EQU 1
 
PUSH@  OTHER   Structure     ;Data structure
PUSH   WORD    Reserved      ;Reserved (must be zero)
CALL   VioGetPhysBuf
 
Returns WORD

Note

Text based on http://www.edm2.com/index.php/VioGetPhysBuf