🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #2076

Re: Vio buffer pointer question

#2076
From: Kenneth A. Kahn
Date: Thu, 15 Oct 1992 08:55
33 lines
2209 bytes
In <1998@acf5.NYU.EDU> checker writes:
>I'm trying to get some Vio code working without any manuals (it was so
>nice of IBM to include no documentation on the freaking API in the
>WorkSet) and I'm having some trouble with direct video writes.
>
>I'm creating a VIOMODEINFO struct (and filling in the cb member with the
>size) and passing it to VioGetMode.  The buf_addr member has the correct
>address after the call for the mode I'm in (0x000B8000) but I get a GP
>fault when I try to write to it.  Do I have to do something before I can
>do a direct video write?  Can I even _do_ a direct video write?  If not,
>what is that pointer for?
>

The value 0xB8000 is the 'physical' address of your display memory.  In order
to write to it directly, you need access to the 'Logical Video Buffer', which
is the 'virtual' addres of this memory.  To get the LVB, use the VioGetBuf API

/***************************************************************************
 * Structure defining the layout of the LVB Buffers.  The Buffer consists  *
 * of Host_Rows*Host_Cols 2-Byte Cells.                                    *
 ***************************************************************************/
typedef union {
  struct {
    BYTE Character;               /* ASCII Character                         */
    BYTE Color;                   /* Foreground/Background Color             */
  } Byte;
  UINT Cell;                      /* Allows access to the 2-byte cell        */
} LVB;

LVB     *lvb_Ptr;                /* Logical Video Buffer                    */
USHORT  lvb_Size;                /* Size of LVB in bytes                    */

VioGetBuf(&lvb_Ptr,&lvb_Size,0);
Technical Details
Message-ID: <19921015.020826.437@almaden.ibm.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!PKSMRVM.VNET.IBM.COM
References: <1998@acf5.NYU.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!PKSMRVM.VNET.IBM.COM
From: KENKAHN@PKSMRVM.VNET.IBM.COM (Kenneth A. Kahn)
Message-ID: <19921015.020826.437@almaden.ibm.com>
Date: Thu, 15 Oct 92 04:55:13 EDT
Newsgroups: comp.os.os2.programmer
Subject: Re: Vio buffer pointer question
Organization: Staff of IBM Fellow - IBM Personal/370
Disclaimer: This posting represents the poster's views, not those of IBM
News-Software: UReply 3.0
X-X-From: KENKAHN@PKSMRVM.VNET.IBM.COM (Ken Kahn)
References: <1998@acf5.NYU.EDU>
Lines: 33