home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-04-11 | 46.8 KB | 1,074 lines |
-
- April 10, 1991
-
- 1.0 INTRODUCTION
-
- 1.1 PURPOSE
-
- The purpose of this document is to aid professional programmers who
- wish to write software to use the high resolution modes supported by
- the VGAWONDER video board. Working knowledge of EGA/VGA graphics and
- assembly language programming is required and assumed. The document
- describes several features unique to the VGAWONDER and how each high
- resolution mode is similar or is different compared to standard VGA
- modes. It does not contain any programming information about standard
- EGA/VGA modes. Refer to the Reference list in the appendix for
- recommended EGA/VGA programmer's references.
-
- 1.2 CONVENTIONS
-
- The code segments contained in this document follow the conventions of
- the MicroSoft MASM assembler. Numbers given in hexadecimal end with a
- lower case h.
-
- 2.0 FEATURES OF THE VGA BOARD
-
- 2.1 STANDARD VIDEO MODES
-
- AH = 0 ;set video mode
-
- AL = MODE/ RESOLUTION DIM/ START
- TYPE COLOR ADDRESS
- ---------------------------------------------------------------
- 0h color/alpha 640x200 40x25/ BW b800:0h
- 1h color/alpha 640x200 40x25/ 16 b800:0h
- 2h color/alpha 640x200 80x25/ BW b800:0h
- 3h color/alpha 640x200 80x25/ 16 b800:0h
- 0* color/alpha 640x350 40x25/ BW b800:0h
- 1* color/alpha 640x350 40x25/ 16 b800:0h
- 2* color/alpha 640x350 80x25/ BW b800:0h
- 3* color/alpha 640x350 80x25/ 16 b800:0h
- 0+ color/alpha 720x400 40x25/ BW b800:0h
- 1+ color/alpha 720x400 40x25/ 16 b800:0h
- 2+ color/alpha 720x400 80x25/ BW b800:0h
- 3+ color/alpha 720x400 80x25/ 16 b800:0h
- 4h color/graphics 320x200 40x25/ 4 b800:0h
- 5h color/graphics 320x200 40x25/ BW b800:0h
- 6h color/graphics 320x200 80x25/ BW b800:0h
- 7h mono/alpha 720x350 80x25/ BW b000:0h
- 0dh color/graphics 320x200 40x25/ 16 a000:0h
- 0eh color/graphics 640x200 80x25/ 16 a000:0h
- 0fh mono/graphics 640x350 80x25/ BW a000:0h
- 10h color/graphics 640x350 80x25/ 16 a000:0h
- 11h color/graphics 640x480 80x30/ BW a000:0h
- 12h color/graphics 640x480 80x30/ 16 a000:0h
- 13h color/graphics 320x200 80x25/256 a000:0h
- 2.2 ENHANCED VIDEO MODES
-
- 23h color/alpha 1056x350 132x25/16 b800:0h
- 27h mono/alpha 1056x350 132x25/BW b000:0h
- 33h color/alpha 1056x352 132x44/16 b800:0h
- 37h mono/alpha 1056x352 132x44/BW b000:0h
- 53h color/graphics 800x560 16 a000:0h
- 54h color/graphics 800x600 16 a000:0h
- 55h color/graphics 1024X768 16 a000:0h
- 61h color/graphics 640x400 256 a000:0h
- 62h color/graphics 640x480 256 a000:0h
- 63h color/graphics 800x600 256 a000:0h
- 64h color/graphics 1024x768 256 a000:0h
- 65h color/graphics 1024x768 16 a000:0h
- 67h color/graphics 1024x768 4 a000:0h
-
- 2.3 REQUIRED CONFIGURATIONS
-
- The enhanced modes have differing memory requirements. Some enhanced
- modes are supported only on certain monitor types or hardware revisions.
- The following chart describes the requirements for each enhanced mode.
-
- Mode# Resolution Colors/ Memory Monitors
- (hex) Palette Required Supported
- -----------------------------------------------------------------
- 23 132x25 16/64 512K 1,2,5
- 27 132x25 B&W 512K 1,2,5
- 33 132x44 16/64 512K 1,2,5
- 37 132x44 B&W 512K 1,2,5
- 54 800x600 16/256K 256K 5
- 55* 1024X768 256/256K 256K 4,5
- 61 640x400 256/256K 512K 3,4,5
- 62 640x480 256/256K 512K 3,4,5
- 63 800x600 256/256K 512K 5
- 64# 1024x768 256/256K 1M 4,5
- 65 1024x768 16/256K 512K 4,5
- 67 1024x768 4/16 256K 4,5
-
- Monitors: (1) TTL mono (2) EGA (3) VGA (4) IBM 8514 (5) Multisync
-
- * not supported on VGAWONDER V3
- # only supported on VGAWONDER+ 1Mb
-
- 3.0 DETERMINING THE STATUS OF THE CARD
-
- The VGA BIOS features some special functions which will allow the
- programmer to determine if a compatible VGA board is installed and how
- the card is configured within his program.
-
- 3.1 IDENTIFYING THE VIDEO CARD
-
- All EGA and VGA display adapters manufactured by ATI Technologies will
- contain the character string: "761295520" starting at address: C000:31.
- VGA boards which are based on the ATI VGA chip set are identified by the
- character string "31" at address C000:40. The card is further identified
- by 2 bytes. The definition of the byte at address C000:42 is:
-
- bit 0 = 0 16-bit VGA board
- bit 0 = 1 8-bit VGA board
- bit 1 = 1 mouse port present on display adapter
- bit 2 = 1 supports non-interlaced 1024x768
- bit 3 = 1 microchannel product
- bit 4 = 1 contains programmable video clock chip
- bit 5-7 = not currently defined
-
- The character at address C000:43 contains the revision of the VGA gate
- array. Currently, the following models exist and other revisions
- may follow in the future.
-
- '1' = 18800
- '2' = 18800-1
- '3' = 28800-2
- '4' = 28800-4
- '5' = 28800-5
-
- 3.2 DETERMINING THE MONITOR TYPE
-
- The following assembler code segment can be used to determine for
- which monitor the VGA board is currently configured.
-
- cli
- mov dx,EXTENDED_REG
- mov al,DATA_I
- out dx,al
- inc dx
- in al,dx
- sti
- and al,0fh
-
- returns al = 0 EGA monitor
- 1 PS/2 monochrome monitor
- 2 TTL monochrome monitor
- 3 PS/2 color monitor
- 4 RGB color monitor
- 5 Multisync monitor
- 7 PS/2 8514 monitor
- 8 Seiko 1430
- 9 NEC MultiSync 2A
- a Crystalscan 860/Tatung 1439
- b NEC MultiSync 3D
- c TVM 3M
- d NEC MultiSync XL
- e TVM 2A
- f TVM 3A
-
- where
- EXTENDED_REG = see section 4.41 in this document
- DATA_I = 0bbh
-
- Note : We reserve the right to add more monitor types at any time. We
- recommend that if an undefined value is returned that the program
- assumed that a multisync is installed.
-
- 3.3 DETERMINING MEMORY SIZE
-
- In terms of memory determination, ATI VGA chipsets fall into 3 groups. The first
- group is identified as types 1 and 2 (see section 3.31). The second group is identified as
- type 3 and the third group as type 4 or 5. All types can be equipped with 256K or 512K
- of RAM. Only types 4 or 5 may be equipped with 1M of RAM.
-
- The following code segment will determine the type of chipset and use the appropriate
- method to determine memory size.
-
- .MODEL small,C
- .CODE
-
- PUBLIC RAMSIZE
- ; --------------------------------------------------------------------------
- ; CALL VALUES: none
- ; RETURNS VALUES: AX = 256 (100h) for 256K bytes
- ; 512 (200h) for 512K bytes
- ; 1024 (400h) for 1024K bytes
-
- RAMSIZE PROC NEAR
- push bx ; Save used register values
- push dx
- push ds
- mov ax, 0c000h
- mov ds, ax
- xor ax, ax
- mov dx, word ptr ds:[0010h] ; Get value of ATI extended register
- mov bl, byte ptr ds:[0043h] ; Get value of ATI chip version
- pop ds
- mov bh, 1 ; Assume 256K ramsize (100h)
- cmp bl, '3'
- jae ramsize_V6_up ; Use different method to determine
- mov al, 0bbh ; memory size of chip version is 3 or
- cli ; higher
- out dx, al
- inc dx
- in al, dx ; Get ramsize byte for chip versions
- sti ; 1 & 2
- test al, 20h
- jz eo_ramsize
- mov bh, 2 ; Set ramsize return value to 512K (200h)
- jmp short eo_ramsize ; and exit
-
- ramsize_V6_up: ; Method used for newer ATI chip versions
- mov al, 0b0h
- cli
- out dx, al
- inc dx
- in al, dx ; Get ramsize byte for versions 3-5
- sti
- test al, 10h ; Check if ramsize byte indicates 256K
- jz ramsize_V7_up ; or 512K bytes
- mov bh, 2 ; Set ramsize return value to 512K (200h)
-
- ramsize_V7_up: ; Check for ramsize for ATI chip
- cmp bl, '4' ; versions 4 & 5
- jb eo_ramsize
- test al, 8 ; Check if version 5 ATI chip has 1024K
- jz eo_ramsize
- mov bh, 4 ; Set ramsize return value to 1024K (400h)
-
- eo_ramsize:
- xor bl,bl ; Zero lower byte of BX
- mov ax, bx ; Return actual ramsize value in AX
-
- pop dx ; Restore BX and DX registers
- pop bx
- ret
- RAMSIZE ENDP
- ; --------------------------------------------------------------------------
-
- END
-
- 3.4 DETERMINING WHETHER A MODE IS SUPPORTED
-
- Your VGA board implements an extended video BIOS call which can be
- used to determine if a particular mode is actually available in the
- user's current configuration. The following assembler routine
- demonstrates this technique:
-
- push bp
- mov bp,sp
- push es
- mov al,ARG
- mov ah,12h
- mov bx,5506h
- mov bp,0ffffh
- int 10h
- mov ax,bp
- pop es
- pop bp
- ret
-
- where ARG = mode desired in hexadecimal
-
- If this routine returns ax = 0ffffh, that mode is not supported in the
- current configuration. If the mode is supported, ax will contain the
- offset start address of the CRTC parameter table for that mode.
-
- Note : We recommend this technique as the only reliable means of
- determining if a particular mode is supported on our EGA or VGA boards.
-
- 4.0 PROGRAMMING THE HIGH RESOLUTION MODES
-
- 4.1 SETTING THE VIDEO MODE
-
- The VGA card can be set into a video mode through the BIOS by using
- the standard IBM method: AH is set to 0, AL is set to the video mode
- number, and a call to software interrupt 10h is executed. See sections
- 2.1 and 2.2 of this manual for a list of available modes. The
- following example will perform this function:
-
- mov ah,0 ;set mode function
- mov al,MODE ;select video mode
- int 10h ;make BIOS call by using the video
- ;interrupt
-
- We recommend that programmers select the video mode through BIOS
- whenever possible rather than programming the mode via the registers.
- For any particular video mode, the configuration of the internal
- registers may differ depending on the type of monitor installed.
- Also, we reserve the right to change the product in a way which would
- be transparent to BIOS but which would have an impact on software
- which writes to the registers.
-
- 4.2 VIDEO MEMORY ADDRESSING
-
- 4.21 ADDRESS RANGE OF VGA BOARD
-
- The VGA board uses the RESERVED area designated by IBM for video
- RAM and the video BIOS (A000 to C7FF). The organization is as follows:
-
- Mono text video RAM: B000-B7FF
- Color text video RAM: B800-BFFF
- Graphics video RAM: A000-AFFF (upto eight 64k banked pages with 512K
- RAM)
- Video BIOS: C000-C7FF
- I/O Ports: 1CE-ICF, 3B0-3DF
-
- 4.22 PAGES and PLANES:
-
- There are two memory mapping systems used with VGA graphics modes:
- Packed pixel and Planar organization.
-
- The Packed pixel mapping scheme is associated with pages and uses
- contiguous memory to describe each pel. IBM VGA mode 13h uses this
- system. Extended modes 61, 62, 63, and 65h also use the Bit-packed
- scheme but they use a unique method to select which page is
- available for reading and writing.
-
- The Planar organized memory mapping scheme is associated with
- planes and uses a bit from each plane to describe a pel. IBM VGA
- mode 12h uses this system as does Extended modes 54h, 55h and 67h.
-
- 4.23 SELECTING MEMORY PAGES:
-
- The memory organization of extended modes 61h, 62h, 63h, 64h and 65h are
- arranged into 64k page segments. The data in each page is displayed on
- a specific region of the screen image. For example, mode 63h has eight
- pages. The first page is displayed on the top eighth of the screen
- image, the second page is displayed on the second eighth of the screen
- image, and so on. Data can be read or written to one page at a time.
- The default active page is Page 0. A special code segment is required
- to be executed before data can be read or written to a specific page.
- A page selecting code segment is provided below. VGA cards with 256K
- of RAM have four, those with 512K have eight and those with 1M have 16
- pages available. Modes 61h, 62h, 63h and 64h require 1 byte per pel and
- mode 65h requires 1/2 byte per pel.
-
- The following code segment can be used to select the required page:
-
- cli
- mov dx,EXTENDED_REG
- mov al,PAGE_SELECT
- out dx,al
- inc dl
- in al,dx
- mov ah,al
- and ah,PAGE_MASK
- shl ch,1
- or ah,ch
- mov al,PAGE_SELECT
- dec dl
- out dx,ax
- sti
-
- where ch = required page value (0 to 7 for mode 63h for example)
- PAGE_SELECT = 0B2h
- PAGE_MASK = 0E1h
- EXTENDED_REG = value of extended register stored at memory
- address C000:0010h. See section 4.31
-
-
- The following is a table that describes the visible range for
- each extended mode which uses the bit-packed memory organization:
-
- Mode 61h (640 x 400 - 256 colors):
-
- Page Visible range (column,row) Memory range
- 0 (0,0) --> (255,102) A0000 - AFFFF
- 1 (256,102) --> (511,204) A0000 - AFFFF
- 2 (512,204) --> (127,307) A0000 - AFFFF
- 3 (128,307) --> (639,399) A0000 - AE7FF
-
- Mode 62h (640 x 480 - 256 colors):
-
- Page Visible range (column,row) Memory range
- 0 (0,0) --> (255,102) A0000 - AFFFF
- 1 (256,102) --> (511,204) A0000 - AFFFF
- 2 (512,204) --> (127,307) A0000 - AFFFF
- 3 (128,307) --> (383,409) A0000 - AFFFF
- 4 (384,409) --> (639,479) A0000 - AAFFF
-
- Mode 63h (800 x 600 - 256 colors):
-
- Page Visible range (column,row) Memory range
- 0 (0,0) --> (735,81) A0000 - AFFFF
- 1 (736,81) --> (671,163) A0000 - AFFFF
- 2 (672,163) --> (607,245) A0000 - AFFFF
- 3 (608,245) --> (543,327) A0000 - AFFFF
- 4 (544,327) --> (479,409) A0000 - AFFFF
- 5 (480,409) --> (415,491) A0000 - AFFFF
- 6 (416,491) --> (351,573) A0000 - AFFFF
- 7 (352,573) --> (799,599) A0000 - A561F
-
- Mode 64h (1024 x 768 - 256 colors):
- Page Visible range (column,row) Memory range
- 0 (0,0) --> (1023,63) A0000 - AFFFF
- 1 (0,64) --> (1023,127) A0000 - AFFFF
- 2 (0,128) --> (1023,190) A0000 - AFFFF
- 3 (0,191) --> (1023,255) A0000 - AFFFF
- 4 (0,256) --> (1023,319) A0000 - AFFFF
- 5 (0,320) --> (1023,383) A0000 - AFFFF
- 6 (0,384) --> (1023,447) A0000 - AFFFF
- 7 (0,448) --> (1023,511) A0000 - AFFFF
- 8 (0,512) --> (1023,575) A0000 - AFFFF
- 9 (0,576) --> (1023,639) A0000 - AFFFF
- 10 (0,640) --> (1023,703) A0000 - AFFFF
- 11 (0,704) --> (1023,767) A0000 - AFFFF
- 12 spare
- 13 spare
- 14 spare
- 15 spare
-
- Mode 65h (1024 x 768 - 16 colors):
-
- Page Visible range (column,row) Memory range
- 0 (0,0) --> (1023,127) A0000 - AFFFF
- 1 (0,128) --> (1023,255) A0000 - AFFFF
- 2 (0,256) --> (1023,383) A0000 - AFFFF
- 3 (0,384) --> (1023,511) A0000 - AFFFF
- 4 (0,512) --> (1023,639) A0000 - AFFFF
- 5 (0,640) --> (1023,767) A0000 - AFFFF
- 6 spare
- 7 spare
-
- 4.3 DETAILS OF EACH EXTENDED VIDEO MODE
-
- 4.31 132X25 - Color text (Mode 23h)
- 132x25 - B&W text (Mode 27h)
- 132X44 - Color text (Mode 33h)
- 132X44 - B&W text (Mode 37h)
-
- Video Memory Organization:
-
- The memory organization of very similar to standard text modes. Only
- one page of 6,660 bytes (132X25 modes) or 11,616 bytes (132X44 modes)
- is availible.
-
- Video Data Organization:
-
- The video data organization is identical to standard text modes.
-
- BIOS support
-
- All BIOS calls supported on standard text modes are supported.
-
- NOTE! It is a good idea to avoid DOS calls when using the 132X44 text
- modes. Most versions of ANSI.SYS are not compatible with text modes
- which have more than 25 lines. This is particularly a problem when
- scrolling the screen.
-
- 4.32 800x600 - 16 COLORS (Mode 54h)
-
- Video Memory Organization:
-
- The memory organization is identical to 16 color IBM EGA/VGA modes
- and consists of 256K organized into 4 maps of 64K each. One bit from
- each of the 4 maps is used to compose each pel. The IBM EGA/VGA Map
- Mask Register is used to select any or all the maps to be updated.
- A0000:0 -> ----------
- | |----------
- | | |----------
- |----------| | |---------- <===\=======\
- | Reserved |----------| | | 60,000 |
- ----------| Reserved |----------| | | |
- Plane 0 ----------| Reserved |----------|<===/ 64K
- Plane 1 ----------| Reserved | |
- Plane 2 --------- <===========/
- Plane 3
-
- Video Data Format:
-
- The video data format is identical to the 16 color IBM EGA/VGA modes.
-
- Color Mapping:
-
- Color selection and palette changing is identical to the 16 color IBM
- EGA/VGA mode
-
- 4.33 1024x768 - 16 COLORS PLANAR (Mode 55h)
-
- Video Memory Organization:
-
- The memory organization is similar to 16 color IBM EGA/VGA modes
- and consists of 2 pages of 256K each organized into 4 maps of 64K. One
- bit from each of the 4 maps is used to compose each pel. The IBM
- EGA/VGA Map Mask Register is used to select any or all the maps to be
- updated.
-
-
-
- Address Page #
-
- A000:0 ==> +-----+-----+-----+-----+
- | | | | |
- | | | | |
- | | | | | 0
- | | | | |
- | | | | |
- A000:0 ==> +-----+-----+-----+-----+
- | | | | |
- | | | | |
- | | | | | 1
- | | | | |
- | | | | |
- +-----+-----+-----+-----+
- Map # 0 1 2 3
-
-
- Selecting Memory Page:
-
-
- The following code segment demonstates how to switch between pages
- when in this mode.
-
- To change the write plane
- cli
- mov dx,ATI_REG
- mov al,PLANE_SELECT
- out dx,al
- inc dl
- in al,dx
- mov ah,al
- and ah,WPLANE_MASK
- shl ch,1
- or ah,ch
- mov al,PLANE_SELECT
- dec dl
- out dx,ax
- sti
-
- To change the read plane
- cli
- mov dx,ATI_REG
- mov al,PLANE_SELECT
- out dx,al
- inc dl
- in al,dx
- mov ah,al
- and ah,RPLANE_MASK
- shl ch,1
- shl ch,1
- shl ch,1
- shl ch,1
- rol ch,1
- or ah,ch
- mov al,PLANE_SELECT
- dec dl
- out dx,ax
- sti
-
- Where ch = page number required
- ATI_REG = store in location c000:10h
- PLANE_MASK = 0e1h
- WPLANE_MASK = 0e1h
- RPLANE_MASK = 01eh
- PLANE_SELECT = 0b2h
- DIFF_RW_PLANE = 008h
- MISC2_REG = 0beh
- DATA_I = 0bbh
-
- The read and write planes can be changed simultaneously.
-
- 4.36 800x600 - 256 COLORS (Mode 63h)
-
- Video Memory Configuration:
-
- This enhanced resolution mode uses a page memory system unique to this
- VGA board. The memory is organized into contiguous 64K blocks located
- at A0000H to AFFFFH. The VGA board must be equipped with 512K of RAM
- to support this mode. Mode 63h uses eight 64K pages. For information
- on selecting the active page, refer to section 4.23 "SELECTING MEMORY
- PAGES" of this document.
-
-
- A0000:0 -> ----------<==============================================\
- | |---------- |
- | | |---------- |
- | | | | \ |
- | | | | \ |
- ----------| | | \ |
- Page 0 ----------| | \ |
- Page 1 ---------- ---------- <=\ 480,000
- Page 3 \ | | | |
- \ | | 64K |
- \ | | | |
- \ | | | |
- ---------- <=/=====/
- Page 7
-
-
- Video Data Format:
-
- The video data format is identical to IBM VGA mode 13h (320x200-256
- color). Each pel is represented by 1 byte.
-
- Color Mapping:
-
- Color selection and palette changing is identical to VGA mode 13h.
- Video Data Format:
-
- The video data format is identical to the 16 color IBM EGA/VGA modes.
-
- Color Mapping:
-
- Color selection and palette changing is identical to the 16 color IBM
- EGA/VGA mode
-
- 4.34 640x400 - 256 COLORS (Mode 61h)
-
- Video Memory Configuration:
- This enhanced resolution mode uses a page memory system unique to this
- VGA board. The memory is organized into contiguous 64K blocks located
- at A0000H to AFFFFH. A VGA board equipped with 256K or 512K of RAM
- will support this mode. Mode 61h uses four 64K pages. For information
- on selecting the active page, refer to section 4.23 "SELECTING MEMORY
- PAGES" of this document.
-
- A0000:0->-----------<===========================================\
- | |---------- |
- | | |---------- |
- | | | |---------- <==\=====|
- | | | | | | |
- ----------| | | | 64K |
- Page 0 ----------| | | | 256,000
- Page 1 ----------| | | |
- Page 2 ---------- <==/=====/
- Page 3
-
-
- Video Data Format:
-
- The video data format is identical to IBM VGA mode 13h (320x200-256
- color). Each pel is represented by 1 byte.
-
- Color Mapping:
-
- Color selection and palette changing is identical to VGA mode 13h.
-
- 4.35 640x480 - 256 COLORS (Mode 62h)
-
- Video Memory Configuration:
-
- This enhanced resolution mode uses a page memory system unique to this
- VGA board. The memory is organized into contiguous 64K blocks located
- at A0000H to AFFFFH. The VGA board must be equipped with 512K of RAM
- to support this mode. Mode 62h uses five 64K pages. For information on
- selecting the active page, refer to section 4.23 "SELECTING MEMORY
- PAGES" of this document.
-
-
- A0000:0 -> ---------- <=============================================\
- | |--------- |
- | | |--------- |
- | | | |--------- |
- | | | | |--------- <=\ |
- ----------| | | | | | |
- Page 0 ---------| | | | 64K |
- Page 1 ---------| | | | 307,200
- Page 2 ---------| | | |
- Page 3 --------- <=/====/
- Page 4
-
-
- Video Data Format:
- The video data format is identical to IBM VGA mode 13h (320x200-256
- color). Each pel is represented by 1 byte.
-
- Color Mapping:
-
- Color selection and palette changing is identical to VGA mode 13h.
-
- 4.36 800x600 - 256 COLORS (Mode 63h)
-
- Video Memory Configuration:
-
- This enhanced resolution mode uses a page memory system unique to this
- VGA board. The memory is organized into contiguous 64K blocks located
- at A0000H to AFFFFH. The VGA board must be equipped with 512K of RAM
- to support this mode. Mode 63h uses eight 64K pages. For information
- on selecting the active page, refer to section 4.23 "SELECTING MEMORY
- PAGES" of this document.
-
-
- A0000:0 -> ----------<==============================================\
- | |---------- |
- | | |---------- |
- | | | | \ |
- | | | | \ |
- ----------| | | \ |
- Page 0 ----------| | \ |
- Page 1 ---------- ---------- <=\ 480,000
- Page 3 \ | | | |
- \ | | 64K |
- \ | | | |
- \ | | | |
- ---------- <=/=====/
- Page 7
-
-
- Video Data Format:
-
- The video data format is identical to IBM VGA mode 13h (320x200-256
- color). Each pel is represented by 1 byte.
-
- Color Mapping:
-
- Color selection and palette changing is identical to VGA mode 13h.
-
- 4.37 800x600 - 256 COLORS (Mode 64h)
-
- Video Memory Configuration:
-
- This enhanced resolution mode uses a page memory system unique to this
- VGA board. The memory is organized into contiguous 64K blocks located
- at A0000H to AFFFFH. The VGA board must be equipped with 512K of RAM
- to support this mode. Mode 64h uses sixteen 64K pages. For information
- on selecting the active page, refer to section 4.23 "SELECTING MEMORY
- PAGES" of this document.
-
- A0000:0 -> ----------<==============================================\
- | |---------- |
- | | |---------- |
- | | | | \ |
- | | | | \ |
- ----------| | | \ |
- Page 0 ----------| | \ |
- Page 1 ---------- ---------- <=\ 786,432
- Page 3 \ | | | |
- \ | | 64K |
- \ | | | |
- \ | | | |
- ---------- <=/=====/
- Page 15
-
-
- Video Data Format:
-
- The video data format is identical to IBM VGA mode 13h (320x200-256
- color). Each pel is represented by 1 byte.
-
- Color Mapping:
-
- Color selection and palette changing is identical to VGA mode 13h.
-
- 4.38 1024x768 - 16 COLORS (Mode 65h)
-
- Video Memory Organization:
-
- This enhanced resolution mode uses a page memory system unique to this
- VGA board. The memory is organized into contiguous 64K blocks located
- at A0000H to AFFFFH. The VGA board must be equipped with 512K of RAM
- to support this mode. Mode 65h uses eight 64K pages. For information
- on selecting the active page, refer to section 4.23 "SELECTING MEMORY
- PAGES" of this document.
-
- A0000:0 -> ---------- <=============================================\
-
- | |---------- |
- | | |---------- |
- | | | | \ |
- | | | | \ |
- ----------| | | \ |
- Page 0 ----------| | \ |
- Page 1 ---------- ---------- <==\ 402,432
- Page 2 \ | | | |
- \ | | | |
- \ | | 64K |
- \ | | | |
- ---------- <==/===/
- Page 7
-
- Video Data Format:
- The video data format is unique to this mode. Each pel requires 4 bits
- or half a byte.
-
- ____________________________________________ High Order
- | | | | | Pixel
- |____|____|____|____|____ ____ ____ ____
- | H | H | H | H | L | L | L | L |
- |____|____|____|____|____|____|____|____|
- | | | | |
- |____|____|____|____|________ Low Order
- Pixel
-
- Color Mapping:
-
- This mode has a different memory organization than standard EGA mode
- 10h. If users want to use colors other than the standard 16 colors,
- users are required to re-program the external palettes (3C8h/3C9h). Re-
- programming the internal palettes (3C0h) will not work the same as it
- would in EGA mode 10h because the color mapping in mode 65h is
- different. It is not recommended to change the internal palettes at
- all for mode 65h. The following table shows the mapping of colors and
- external palettes.
-
- Palette registers available for re-programming are:
-
- Palette register Palette register default color color
- (low order pels) (high order pels) assignment value
- ---------------- ----------------- ------------- -----
- 00h 00h Black 0h
- 01h 10h Blue 1h
- 02h 20h Green 2h
- 03h 30h Cyan 3h
- 04h 40h Red 4h
- 05h 50h Magenta 5h
- 06h 60h Brown 6h
- 07h 70h White 7h
- 08h 80h Dark Gray 8h
- 09h 90h Light Blue 9h
- 0Ah A0h Light Green Ah
- 0Bh B0h Light Cyan Bh
- 0Ch C0h Light Red Ch
- 0Dh D0h Light Magenta Dh
- 0Eh E0h Yellow Eh
- 0Fh F0h Bright White Fh
-
- For example, to change the default color assignment for palette
- register 4 from Red to Bright White, palette register 4 and 40h would
- need to be re-programmed with the values:
-
- Red Intensity = 3Fh
- Green Intensity = 3Fh
- Blue Intensity = 3Fh
-
- so that both the low order AND high order pels are affected. The only
- exception is palette register 0 (Black); re-programming this register
- will affect both the low order and high order pels.
-
- An Example:
-
- The following example uses a standard IBM EGA/VGA BIOS call. If more
- information is required, consult the IBM EGA/VGA programmers reference
- list included in this document.
-
- Example segment to re-program a palette register:
-
- mov ah,10h ;EGA/VGA Set Palette Register BIOS call
- mov al,10h
- mov bx,PALETTE_REG_LOW ;Palette register to be re-programmed
- ; for low order pels.
- mov ch,GREEN_INTENSITY ;Load new values
- mov cl,BLUE_INTENSITY
- mov dh,RED_INTENSITY
- int 10h
-
- mov ah,10h ;EGA/VGA Set Palette Register BIOS call
- mov al,10h
- mov bx,PALETTE_REG_HIGH ;Palette register to be re-programmed
- ; for high order pels.
- mov ch,GREEN_INTENSITY
- mov cl,BLUE_INTENSITY
- mov dh,RED_INTENSITY
- int 10h
-
- where:
- PALETTE_REG_LOW = low pel palette register (00,01,02,..,0F)
- PALETTE_REG_HIGH = high pel palette register (00,10,20,..,F0)
-
- GREEN_INTENSITY
- BLUE_INTENSITY = 6 bit intensity values for defining the default color
- RED_INTENSITY
-
-
- 4.39 1024x768 - 4 COLORS (Mode 67h)
-
- Video Memory Organization:
-
- The memory organization is identical to the IBM 16 color EGA and VGA
- modes. 256K of RAM is divided into 4 maps of 64k. The IBM EGA/VGA Map
- Mask Register is used to select the maps to be updated.
-
- A0000:0->/------\
- | | /------\
- | C0 | | | /------\
- \------/ | C1 | | | /------\ <---+
- Plane 0 \------/ | C0 | | | 49152 bytes/plane
- ^ Plane 1 \------/ | C1 | |
- | ^ Plane 2 \------/ <---+
- | | ^ Plane 3
- \---odd pels---/ | ^
- | |
- \---even pels---/
-
-
- Video Data Format:
-
- This mode uses a unique data format where 2 bits are required per pel.
- Plane 0 and 1 contain the data for odd numbered pels and Planes 2 and
- 3 contain the data for the even numbered pels.
-
- Color Mapping:
-
- This mode supports four palette selections. The palette or color set
- is selected by setting bits 0 & 1 of the IBM EGA/VGA Color Select
- Register.
-
- Color Values (C0, C1)
- Color set # C0=0,C1=0 C0=1,C1=0 C0=0,C1=1 C0=1,C1=1
-
- 0 black white grey bright white
- 1 black cyan red white
- 2 black green red yellow
- 3 black cyan magenta white
-
- Examples:
-
- The following examples use standard IBM EGA/VGA registers. If more
- information is required, consult the EGA/VGA programmers reference
- list included in this document.
-
-
- Segment example for selecting the active palette or color set:
-
- mov dx,03dah ;Load Input Status Register One
- ;
- wait:
- in al,dx ;Wait for vertical retrace bit to be set
- test al,8 ; (bit 3 = 1)
- jnz wait ;It is good practise to wait for the vertical
- ; retrace bit before directly modifying the
- ; palette registers
-
- mov ah,ARG ;Arg = color set # (0 to 3)
- mov cl,4 ;Multiply arg by 8 so that bits 4 & 5 of the
- shl ah,cl ; palette registers can be modified
- mov dx,03c0h ;Load Palette Control Register
- mov cx,16 ;16 Palette registers to be modified
- xor bl,bl ;Start from 0
- ;
- repeat: ;Modify bits 4 & 5 of all 16 palette registers with
- mov al,bl ; Arg value (color set #)
- out dx,al ;Select palette register
- or al,ah
- out dx,al ;Write modified data to selected palette register
- loop repeat
-
- mov al,20h ;Restore internal registers access to palette data
- out dx,al ; bit 5 must be zero during palette data writing
- ; and one after data writing is complete
-
-
- Segment example for selecting Bit Planes to be modified during a
- memory write:
-
- mov dx,03c4h ;Load Sequencer Address Register
- mov al,2 ;Load index of Map Mask Register
- out dx,al ;Select Map Mask Register
- inc dl
- mov al,ARG ;Value to select which bit planes are to be
- ; modified during a memory write
- out dx,al ;Select EGA/VGA planes to be modified
-
-
- IBM EGA/VGA Map Mask Register (3C5h, index 2) organization:
-
- Bits: 0 Controls access to Bit Plane 0
- 1 Controls access to Bit Plane 1
- 2 Controls access to Bit Plane 2
- 3 Controls access to Bit Plane 3
- 4-7 Not used
-
- A bit value of 0 disables access to the corresponding Bit Plane and a
- bit value of 1 enables it.
-
- 4.4 SPECIAL NOTES
-
- 4.41 NOTE ON EXTENDED REGISTER ADDRESS
-
- Hard-coding this value is not recommended since it is programmable
- and may be changed in subsequent BIOS releases. The value of
- EXTENDED_REG should be retrieved from the BIOS at location C000:0010h.
- The 'mov dx, EXTENDED_REG statement in the page selecting segment can
- be replaced with code to load the value of EXTENDED_REG from its stored
- location. The registers that need to be saved will depend greatly on
- the particular application:
-
- push es ;save registers es and bx
- push bx
- mov ax,0c000h ;define storage location of EXTENDED_REG
- mov es,ax
- mov bx,10h
- mov dx,es:[bx] ;get the value of EXTENDED_REG from contents
- ;of the storage location C000:0010h
- pop bx ;restore registers es and bx
- pop es
-
- 4.42 NOTE ON DAC REGISTER PROGRAMMING
- In IBM VGA mode 13h (320x200 - 256 color), each color is controlled by
- a corresponding DAC register. There are a total of 256 18-bit DAC
- registers. Therefore, each DAC register can be assigned a color value
- from 0 (BLACK) to 262,143 (BRIGHT WHITE). The first 16 DAC registers
- have assigned color values that correspond to the 16 colors used in
- mode 12h (640x480 - 16 color). DAC register zero, which has an
- assigned color value of 0 (BLACK), also controls the color of the
- overscan border. This function is also supported in ATI modes 61, 62,
- 63, and 65h. On some analog monitors, a non-BLACK overscan border may
- cause line wrapping at either the top or bottom of the screen image
- due to the video bandwidth required. For this reason, it is not
- recommended to change the color value of this DAC register.
-
- 4.43 BIOS FUNCTION SUPPORT
-
- Many versions of the VGAWONDER do not support certain video BIOS
- function calls in some extended video modes due to EPROM space
- limitations. Programmers should assume that the following functions
- are not supported in the indicted modes:
-
- MODE # BIOS FUNCTION
-
- 61h, 62h, 63h, ah = 06h - Scroll active page up
- 65h, 67h ah = 07h - Scroll active page down
- ah = 09h - Read Character at Cursor
- ah = 0ch - Write Dot
- ah = 0dh - Read Dot
- ah = 0eh - Write TTX
-
- All extended modes have only one active page regardless of the amount
- of memory installed.
-
- 5.0 APPENDIX
-
- 5.1 LIST OF SUGGESTED REFERENCES
-
- TITLE: Programmer's Guide to the EGA/VGA *
- AUTHOR: George Sutty and Steve Blair
- PUBLISHER: Brady Books / Simon and Schuster, Inc.
- DATE: 1988
-
- TITLE: Advanced Programmer's Guide to SuperVGAs *
- AUTHOR: George Sutty and Steve Blair
- PUBLISHER: Brady Books / Simon and Schuter, Inc.
- DATE: 1990
-
- TITLE: Programmer's Guide to IBM PC and PS/2 Video Systems
- AUTHOR: Richard Wilton
- PUBLISHER: MicroSoft Press
- DATE: 1987
-
- TITLE: Programmer's Guide to the EGA and VGA Cards
- AUTHOR: Richard F. Ferraro
- PUBLISHER: Addison - Wesley Publishing Co.
- DATE: July, 1988
-
- TITLE: EGA/VGA A Programmer's Reference Guide
- AUTHOR: Bradley Dyck Kliewer
- PUBLISHER: McGraw Hill
- DATE: 1988
-
- TITLE: Personal System/2 Model 50 and 60 Technical Reference
- AUTHOR: unknown
- PUBLISHER: IBM
- DATE: April, 1987
-
- TITLE: Personal System/2 and Personal Computer BIOS Interface
- Technical Reference
- AUTHOR: unknown
- PUBLISHER: IBM
- DATE: April, 1987
-
- TITLE: Programmer's Reference Manual for the VGAWONDER *
- AUTHOR: various
- PUBLISHER: ATI Technologies (order from Tech Support $40)
- DATE: 1990
- * recommended
-
-
- TO OBTAIN A PRINT COPY OF THIS DOCUMENT ON YOUR SYSTEM
- PRINTER, ENTER THE FOLLOWING COMMAND AT THE DOS PROMPT:
-
- TYPE PROGINFO.DOC>PRN <rtn>
-