⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ai.txt

📁 比较详尽的VGA端口寄存器的文档
💻 TXT
📖 第 1 页 / 共 4 页
字号:
The Adapter Interface (AI) was introduced as the programming interface for the
IBM 8514/A before the register interface was publicly available.
AI interfaces have also been implemented for the XGA, IBM Image Adapter/A and
8514/A clones like the ATI Mach8/32
Also pure software versions exists like Tseng's RIXAI.

INT 7F - AI - Check for Adapter Interface
         AX = 0105h
         CX = 0000h
         DX = 0000h
Return: Carry clear if successful
        CX:DX -> Function table. One DWORD pointer for each function (0..60)
                 Most functions have one parameter (Shown as X below), a
                 pointer to a parameter table where the first WORD holds the
                 number of bytes following, thus if there are 10 bytes in all
                 the first WORD will be 8. It is the callers responsibility to
                 set this.

function 00h HLINE(X) - Line at Given Point
 Draws a polyline starting in the first position listed.
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(4*Number_of_points)
   02h   WORD    X-coordinate of 1st point
   04h   WORD    Y-coordinate of 1st point
      ...
  4*n+2  WORD    X-coordinate of Nth point
  4*n+4  WORD    Y-coordinate of Nth point

function 01h HCLINE(X) - Line at Current Position
 Draws a polyline from the current position to the last point
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(4*Number_of_points)
   02h   WORD    X-coordinate of 1st point
   04h   WORD    Y-coordinate of 1st point
      ...
  4*n+2  WORD    X-coordinate of Nth point
  4*n+4  WORD    Y-coordinate of Nth point

function 02h HRLINE(X) - Relative Line at Given Position
 Draws a series of polylines, starting at the given point, with each endpoint
 given as an offset from the last point.
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(4 + 2*Number_of_points)
   02h   WORD    X-coordinate of starting point
   04h   WORD    Y-coordinate of starting point
      .....
  2*N+4  BYTE    X-coordinate of Nth relative point
  2*N+5  BYTE    Y-coordinate of Nth relative point


function 03h HCRLINE(X) - Relative Line at Current Position
 Draws a series of linesegments, each specified relative to the end of the
 previous segment (the current position for the first segment).
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(2*Number of segments)

  2*N+2  BYTE    X-coordinate offset (-128 to +127)
  2*N+3  BYTE    Y-coordinate offset (-128 to +127)

function 04h HSCP(X) - Set Current Position
 Sets the current drawing position
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(4)
   02h   WORD    New X-coordinate
   04h   WORD    New Y-coordinate

function 05h HBAR(X) - Begin Area
 Marks the start of a series of commands that defines the boundary for a
 fill area. The sequence is terminated by a HEAR() command.
 The following commands are not allowed between the HBAR and HEAR:
   HOPEN, HCLOSE, HSMODE, HSHS, HSCMP, HSBP, HCHST and HCCHST.
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(0)
Note: HBAR/HEAR commands can not be nested.

function 06h HEAR(X) - End Area
 Ends the area definition started by a HBAR command.
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(0 or 1)
   02h   BYTE    Flag (only if length is 1):
                  00h  Fill the defined area
                  40h  Suspend the area definition. until the next HBAR
                  80h  Abort definition.
                 Note: bits 0-5 are probably ignored

function 07h HSCOL(X) - Set Color
 Sets the foreground color
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(4)
   02h   DWORD   Foreground color index. Only the number of least significant
                 bits (depending on the current mode) are used.
                 0FFFFFFFFh is reserved for multiplane character sets

function 08h HOPEN(X) - Open Adapter
 Enables the adapter.
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(3)
   02h   BYTE    Initialisation flags
                 Bit 0-5  Don't care
                       6  Clear to load default palette
                       7  Clear to clear video memory
   03h   BYTE    Mode. See HSMODE for (implementation specific) modelist.
   04h   BYTE    Return status. In the original 8514/A a non-zero return value
                 indicated failure, later version have assigned bits to
                 specific events:
                 Bit 7  Set if a driver/hardware mismatch occours
                     6  Set if a control program reject occours

function 09h HSMX(X) - Set Mix
 Sets the fore- and background mixes
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(2)
   02h   BYTE    Foreground mix (SRC is Source, DST is Destination):
                  00h:  Keep previous mix
                  01h:  SRC or DST
                  02h:  SRC
                  03h:  Reserved
                  04h:  SRC xor DST
                  05h:  DST          (I.e. do nothing)
                  06h:  Max(DST,SRC)
                  07h:  Min(DST,SRC)
                  08h:  SRC+DST  (overflow is clipped to maximum)
                  09h:  DST-SRC  (underflow is clipped to zero)
                  0Ah:  SRC-DST  (underflow is clipped to zero)
                  0Bh:  (SRC+DST)/2  (Average)
              0Ch-0Fh:  Reserved
                  10h:  Zero, all bits cleared
                  11h:  SRC and DST
                  12h:  SRC and (not DST)
                  13h:  SRC
                  14h:  (not SRC) and DST
                  15h:  DST
                  16h:  SRC xor DST
                  17h:  SRC or DST
                  18h:  (not SRC) and (not DST)
                  19h:  not (SRC xor DST)
                  1Ah:  not DST
                  1Bh:  SRC or (not DST)
                  1Ch:  not SRC
                  1Dh:  (not SRC) or DST
                  1Eh:  (not SRC) or (not DST)
                  1Fh:  One, all bits set
   03h   BYTE    Background mix (same as above)

function 0Ah HSBCOL(X) - Set Background Color
 Sets the background color
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(4)
   02h   DWORD   Background color index. Only the number of least significant
                 bits (depending on the current mode) are used.
                 0xFFFFFFFF is reserved for color fonts.

function 0Bh HSLT(X) - Set Line Type
 Sets the current line type
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(1 or 6)
   02h   BYTE    Line pattern type
                   0: User defined pattern (see byte 4-7)
                   1: Dotted line (1 on, 2off)
                   2: Short dashed line (5 on, 3 off)
                   3: Dash-dot line (6 on, 4off, 2on, 4off)
                   4: Double doted line (2 on, 4 off, 2 on, 8 off)
                   5: Long dashed line (9 on, 3 off)
                   6: Dash-double-dot line (8 on, 4 off, 2 on, 4 off, 2 on,
                       4 off)
                   7: Solid line
                   8: Invisible line.
       Following fields only present if length =6
   03h   BYTE    Reserved
   04h   DWORD   Address of user defined pattern
                 Offset: Type:
                   00h   WORD   Number of on/off byte pairs(N)
                      ...
                  2*N    BYTE   On count
                  2*N+1  BYTE   Off count
                 Maximum pattern length is 48 pixels.

function 0Ch HSLW(X) - Set Line Width
 Sets the line drawing width
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(1)
   02h   BYTE    Line width in pixels. Original AI, ATI (Mach32) and XGA
                 versions only supports widths of 1 and 3.

function 0Dh HEGS(X) - Erase Graphics Screen
 Clears the screen and sets the current position to the top left corner
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(0)

function 0Eh HSGQ(X) - Set Graphics Quality
 Sets the graphics quality options
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(2)
   02h   WORD    Quality flags
                 Bit  0-9  Reserved
                       10  (XGA and ImageAdapter/A) If clear areas to be
                            filled are closed by connection the first point
                            to the last with a line
                           Reserved in the original AI.
                    11-12  0: Last pixel in a line is not drawn
                           1: Last pixel in a line is drawn
                           2: Last pixel in a line is drawn dependent on the
                              mix mode.
                       13  Reserved, set to 0
                       14  0: High precision, 1: low precision
                           Ignored in the XGA and ATI (Mach32) AI versions.
                       15  Reserved, set to 0

function 0Fh HSCMP(X) - Set Color Comparison Register
 Sets the color comparison information.
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(5)
   02h   DWORD   Comparison Color (CC)
   06h   BYTE    Logic function:
                   0:  TRUE
                   1:  Destination >  CC
                   2:  Destination == CC
                   3:  Destination <  CC
                   4:  FALSE
                   5:  Destination >= CC
                   6:  Destination != CC
                   7:  Destination <= CC
                 If the color comparison is true the pixel is left unmodified

function 10h HINT(X) - Interrupt
 Waits until the event(s) specified by set bit(s) in the Event word happens
 before it returns. Used to synchronize with an event.
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(4)
   02h   DWORD   Event/Interrupt bits:
                   0-29  Reserved
                     30  Wait for hardware to be free (I.e. not busy
                         drawing). Only in the XGA version
                     31  Wait for vertical blank.

function 11h HSPATTO(X) - Set Pattern Reference Point
 Sets the pattern reference point for functions that use the pattern.
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(4)
   02h   WORD    X-coordinate
   04h   WORD    X-coordinate

function 12h HSPATT(X) - Set Symbol Shape
 Defines an area pattern
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(10 or 14)
   02h   BYTE    Cell width in pixels
   03h   BYTE    Cell height in lines
   04h   BYTE    Flags
                 Bit 0-5  Reserved
                       6  (XGA and ImageAdapter/A only) Set if pattern color
                            data is in packed pixel format, clear if it always
                            uses one byte per pixel
                             0: 1pixel/byte, 1: packed pixel format
                       7  0: Monochrome: Marker is drawn with current
                             foreground color&mix on the background color&mix,
                          1: Color: Marker is drawn in the color from the
                             color data (Byte 0Ch) on the current background
                             color&mix
   05h   BYTE    Reserved
   06h   WORD    Size of pattern in bytes
   08h   DWORD   Ptr to pattern definition data. A packed monochrome bitmap
       Following field only present if length = 14
   0Ch   DWORD   Address of pattern color data
Note: for the original AI (I.e. 8514/A hardware) the pattern is limited to
      32x32, for the XGA and ImageAdapter/A versions there is no limit

function 13h HLDPAL(X) -Load Palette
 Loads the color look-up table with either the default palette or a user
 specified palette.
 Parameter Block:
 Offset: Type:   Description:
   00h   WORD    Length of data following(1 or 10)
   02h   BYTE    Palette type
                   00h  User defined palette as specified in the remaining
                        parameters
                   01h  Adapter default palette. Ignore remaining parameters
   03h   BYTE    Reserved
   04h   WORD    Index of first palette entry
   06h   WORD    Number of entries
   08h   DWORD   Address of palette data. This consists of 4 bytes per entry,
                 with the first byte (0) reserved, byte 1 is Green, byte 2 is
                 Blue and byte 3 is Red.
                 Note: one source has bytes 0 and 3 swapped ??

function 14h HSHS(X) - Set Scissors
 Sets the scissors rectangle, if rectangle not specified (length=0) the HOPEN
 default is used. Only pixels within the rectangle can be updated.
 Parameter Block:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -