Special Programming Information
*******************************
This information is intended for advanced programmers writing applications or
drivers to make use of the extended capabilities of the 16 Bit VGA card. This
information is not needed for normal use of the 16 Bit VGA card. Use of the
information contained here requires familiarity with assembly language
programming and the workings of the IBM PC/AT environments.

Programmers requiring additional general information on programming VGA may
want to refer to the IBM PS/2 Technical Reference manuals as well as the
following book: Programmer's Guide to PC and PS/2 Video Systems,
by Richard Wilton, Microsoft Press, 1987. (ISBN 1-55615-103-9). 

Programming Considerations
**************************
Refer to the Extended Video Mode table in the 16 Bit VGA Card Software Manual
for a description of the extended video modes available on your 16 Bit VGA.

132 Column Modes hex 54,55,56,57
********************************
If the multi-frequency monitor switch (sw 1) is turned on, the BIOS will use 
the 8x8 font for the 43 row modes (54,56) and the 8x16 font for the 25 row
modes (55,57) and program the PVGA chip to use all 8 pixels. If on the other
hand, the multi-frequency monitor switch is off, the VGA board will be limited
to 7 pixels causing the 8x8 and 8x16 characters to run together. The VGA.EXE
utility compensates for this by loading a different font when the 132 column
modes are selected and the multi-frequency monitor switch is off. For those
programs that set the 132 column modes, the fonts used by the VGA.EXE utility
are provided on this disk:

      FONT_25.I   ---- Mode 55 and 57.
      FONT_43.I   ---- Mode 54 and 56.

The following program segment demonstrates how to determine if the fonts
should be used.

Read PR5 register (3CE index F):

        mov     ax,007fh                ; Use extended setmode     
        mov     bh,1fh                  ; Look in the PR5 switches
        int     10h
        test    bl,80H                  ; Look for the switch 1 = on
        jne     quit                    ; Switch is off do nothing

The switch was on. Pick the font needed based on the mode. 

        mov     ax,offset f5x7          ; load address of font for mode 54,56
        mov     bh,9                    ; Load number of points
                
        mov     ax,offset f7x16         ; load address of font for mode 55,57
        mov     bh,16                   ; Set points             

 Setup for loading the font via BIOS call 11.

        push    cs                      ; put cs in es
        pop     es
        push    ax                      ; Contains the offset
        pop     bp
        mov     al,00h                  ; Load user font
        mov     ah,11h                  ; set bios call lcgen    
        mov     bl,00h                  ; Starting block         
        mov     cx,256                  ; number of characters
        xor     dx,dx
        int     10h

Extended 800x600 Graphics Modes hex 58,59
*****************************************
800 by 600 extended graphics modes require a multi-frequency monitor. No 
checking is done in the BIOS or hardware to determine if such a monitor is
connected.  This mode is available independent of the setting of the 
multi-frequency monitor special timing switch (switch lever 1).

Extended 256 Color Graphics Mode hex 5E
********************************************
The 640 by 400 extended graphics modes of the 16 Bit VGA card can be invoked 
using the SetMode BIOS call.  The file 256COLOR.TXT on this disk describes in
detail how to access the additional memory required for this extended mode.

Extended BIOS Calls
Setmode Extensions
******************
The extended video modes of the 16 Bit VGA card can be set via
the standard SETMODE BIOS call or through the SET SPECIAL MODE BIOS call.
Additionally support is provided for setting and locking non-VGA modes
and reading and writing the Paradise Registers through the EXTENDED
FUNCTIONS Setmode BIOS call.

Setmode (BIOS call AH=00) has been extended as follows:

    AH = 00h    SETMODE
        AL = extended video mode
            This call will set the extended 16 Bit VGA card video modes:
            54h, 55h, 56h, 57h, 58h, 59h, 5Eh.

    AX = 007E   SET SPECIAL MODE 
                   This call sets modes by describing the mode desired.

       BX = The horizontal dimension of the mode desired
            (in pixels for graphics modes, columns for alpha modes) 
       CX = The vertical dimension of the mode desired
            (in pixels for graphics modes, rows for alpha modes)
       DX = The number of colors of the mode desired
            (use 0 for monochrome modes)

    On exit, the BH register will equal 7E if successful.


    AX = 007F   EXTENDED FUNCTIONS
           This call supports the following functions:        

       BH = 00  SET VGA OPERATION

       BH = 01  SET NON-VGA OPERATION
           Board must be set to a valid mode for non-VGA operation.
           Color modes (0,1,2,3,4,5,6) will set non-VGA CGA operation.
           Monochrome mode 7 will set non-VGA MDA/Hercules operation.

       BH = 02  QUERY MODE STATUS 

           On exit the following is returned:

                  BL = 0 if operating in VGA mode.
                  BL = 1 if operating in non-VGA mode
                  CH = Total video RAM size in 64k byte units.
                  CL = Video RAM used by the current mode.

       BH = 03  LOCKS CURRENT MODE
           Allows current mode (VGA or non-VGA) to survive re-boot.
 
    PR Register Extended Function Calls

       BH = 09  WRITE PR0A REGISTER (3CE index 9)
           BL = Value to set in PR0A.

       BH = 0A  WRITE PR0B REGISTER (3CE index A)
           BL = Value to set in PR0B.

       BH = 0B  WRITE PR1 REGISTER (3CE index B)
           BL = Value to set in PR1.

       BH = 0C  WRITE PR2 REGISTER (3CE index C)
           BL = Value to set in PR2.

       BH = 0D  WRITE PR3 REGISTER (3CE index D)
           BL = Value to set in PR3.

       BH = 0E  WRITE PR4 REGISTER (3CE index E)
           BL = Value to set in PR4.

       BH = 0F  WRITE PR5 REGISTER (3CE index F)
           BL = Value to set in PR5.
                The high order 4 bits cannot be changed (SWITCHES).

       BH = 19  READ PR0A REGISTER (3CE index 9)

           On exit the following is returned:

               BL = Value of PR0A.
  
       BH = 1A  READ PR0B REGISTER (3CE index A)

           On exit the following is returned:

               BL = Value of PR0B.

       BH = 1B  READ PR1 REGISTER (3CE index B)

           On exit the following is returned:

               BL = Value of PR1.

       BH = 1C  READ PR2 REGISTER (3CE index C)

           On exit the following is returned:

               BL = Value of PR2.

       BH = 1D  READ PR3 REGISTER (3CE index D)

           On exit the following is returned:

               BL = Value of the PR3.

       BH = 1E  READ PR4 REGISTER (3CE index E)

           On exit the following is returned:

               BL = Value of the PR4.

       BH = 1F  READ PR5 REGISTER (3CE index F)

           On exit the following is returned:

               BL = Value of PR5.

    On exit, the BH register will equal 7F if successful.

Note: The state of PR Registers cannot be assumed between standard 
Setmode calls, and should not be assumed in general.
