home *** CD-ROM | disk | FTP | other *** search
-
- **************************** VIDEO MODES ***********************************
-
- ASMLIB video mode subroutines (C) Copyright 1991 - 1994 Douglas Herr
- All rights reserved
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- HGRAPH: establishes Hercules graphics mode, pages 0 & 1
- HGRAPH0: establishes Hercules graphics mode, clear page 0 only
- Source: hgraph.asm ($herc.asm, hmode.asm)
-
- Hercules or compatible required
- (including Hercules InColor)
-
- Call with: no parameters
- Returns: if CF = 1, no Hercules installed
- if CF = 0, AX = code for Hercules model
- 128 = HGC
- 144 = HGC+
- 208 = InC
- Uses: AX, CX, CF
- Supports: Hercules graphics cards and compatibles: graphics mode
- see also Use64k in SYSTEM.DOC
- Example: call hgraph ; establish graphics mode
- jc no_hercules ; drat!
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- HRAM8029: establish an 80-column, 29-row RamFont mode, loading a
- standard 8x12 character font in RAM
- Source: hram8029.asm ($herc.asm, hmode.asm, $h8x12.asm, f8x12rle.asm,
- $rld.asm)
-
- HRAM8043: establish an 80-column, 43-row RamFont mode, loading a
- standard 8x8 character font in RAM
- Source: hram8043.asm ($herc.asm, hmode.asm, $h8x8.asm, f8x8.asm)
-
- HRAM9025: establish a 90-column, 25-row RamFont mode using
- standard ROM characters
- Source: hram9025.asm ($herc.asm, hmode.asm)
-
- HRAM9029: establish a 90-column, 29-row RamFont mode, loading a
- standard 8x12 character font in RAM
- Source: hram9029.asm ($herc.asm, hmode.asm, $h8x12.asm, f8x12lre.asm,
- $rld.asm)
-
- HRAM9043: establish a 90-column, 43-row RamFont mode, loading a
- standard 8x8 character font in RAM
- Source: hram9043.asm ($herc.asm, hmode.asm, $h8x8.asm, f8x8.asm)
-
- Hercules RamFont card required
- (including Hercules InColor)
-
- Note: use htext to restore normal 80 x 25 text mode
-
- Call with: no parameters
- Returns: if CF = 1, no RamFont card installed
- if CF = 0, AX = code for Hercules model
- 144 = HGC+
- 208 = InC
- Uses: AX, CF; all other flags and registers are saved
- Supports: HGC+ and InC cards: 4k RamFont mode
- Example: call hram8043 ; RamFont mode: 80x43
- jc no_ramfont ; drat!
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- HTEXT: establish (or restore) Hercules text mode
- Source: htext.asm ($herc, hmode)
-
- Call with: no parameters
- Returns: if CF = 1, no Hercules installed
- if CF = 0, AX = code for Hercules model
- 128 = HGC
- 144 = HGC+
- 208 = InC
- Uses: AX, CF
- Supports: Hercules graphics cards and compatibles: text mode
- (including Hercules InColor)
- Example: call htext ; Hercules text mode
- jc no_herc ; drat!
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- MODECOLOR: switches system to color text mode; may be used to switch
- monitors on a 2-monitor system, or to switch to the standard
- 80-column, 25-rows color mode from other color modes
- Source: mode.asm ($6845.asm)
-
- Call with: no parameters
- Returns: CF = 1 if no color monitor
- CF = 0 if successful
- Uses: CF; all registers and all other flags are saved
- Example: call modecolor
- jc nocolor
- .
- .
- .
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- MODEMONO: switches system to monochrome text mode; may be used either
- to switch active monitors on a 2-monitor sysem or to switch
- to monchrome text mode (80x25) from graphics mode (EGA or
- Hercules).
- Source: mode.asm ($6845.asm)
-
- Call with: no parameters
- Returns: CF = 1 if no monochrome monitor
- CF = 0 if successful
- Uses: CF; all registers and all other flags are saved
- Example: call modemono
- jc nomono
- .
- .
- .
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- MODE43: switch EGA to 80x43 text mode or VGA to 80x50 text mode
- Mode43 switches an EGA to the 80-column, 43-row text mode from
- any color mode or any EGA monochrome mode, or switches a color
- VGA to 80x50 text mode from any other color mode.
- Source: mode43.asm
-
- Call with: no parameters
- Returns: if CF = 1, AX = 0 if no EGA or VGA in system
- AX = -1 if EGA connected to CGA monitor
- if CF = 0, AX = 3 if EGA or VGA connected to color monitor
- AX = 7 if EGA or VGA connected to monochrome monitor
- Uses: AX, CF; all other registers and flags are saved
- Example: call mode43
- jc noega
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- SVGA16: set Super VGA 16-color graphics mode
- Source: svga16.asm ($svga.asm, $banks.asm)
-
- Call with: AX = 16-color mode desired
- AX = 0 for 800x600
- AX = 1 for 1024x768
-
- ASMLIB's SVGA subroutines are derived from John Bridges'
- public domain VGAKIT board identification and bank switching code.
- Boards supported are:
-
- Ahead Technologies
- ATI
- Chips & Technologies
- Everex
- Genoa GVGA
- NCR
- Oak Technologies
- Paradise (Western Digital)
- Trident
- Trident 8900
- Tseng (Genoa, Orchid, Willow)
- Tseng 4000
- VESA standard
- Video 7
-
- I have not been able to test VGAKIT modes on all boards; please
- let me know if you encounter difficulties.
-
- Returns: if CF = 0, no error
- if CF = 1, requested mode is not available
- SVGA16 cannot determine if the monitor you are using will
- work with the requested mode. Monitor damage may result
- from improper use of SVGA16.
-
- Example:
-
- include asm.inc
-
- public mygraph
- extrn whichvga:proc, svga16:proc
-
- .code
- mygraph proc
- ; I want to use a 16-color 1024x768 mode if available
- ; start by calling WhichVGA to determine if the equipment is capable
- call whichvga
- or ax,ax ; SuperVGA installed?
- jz no_svga ; nope, use some other mode
- mov ax,1 ; specify 1024x768 mode
- call svga16
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- SVGA132: switches supported systems to 132 column text mode
- Source: svga132.asm ($sega.asm, $svga.asm)
-
- Call with: AX = screen rows code
- AX = 0: 25 rows
- AX = 1: 28-30 rows (depending on equipment)
- AX = 2: 43 rows
- AX = 3: 50 rows (depending on equipment)
- AX = 4: 60 rows (depending on equipment)
-
- Returns: CF = 1 if mode not supported
- if CF = 0, AX = mode number
- Uses: AX, CF; all other registers and flags are saved
- Supports: Equipment detected by IsSEVGA (see IsSEVGA in SYSTEM.DOC).
- Most VGA boards require a multi-frequency monitor to use
- 132-column modes; consult your board's documentation.
- EGA 132-column modes require at least an EGA monitor.
- Example:
-
- call svga132 ; set mode
- jc no132 ; no good
- .
- .
- .
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- SVGA256: set Super VGA 256-color graphics mode
- Source: svga256.asm ($svga.asm, $banks.asm)
-
- Call with: AX = 256-color mode desired
- AX = 0 for 640x400
- AX = 1 for 640x480
- AX = 2 for 800x600
- AX = 3 for 1024x768
-
- ASMLIB's SVGA subroutines are derived from John Bridges'
- public domain VGAKIT board identification and bank switching code.
-
- Equipment supported is listed under SVGA16, plus:
-
- Compaq (640x480 only)
-
-
- Returns: if CF = 0, no error
- if CF = 1, requested mode is not available
- SVGA256 cannot determine if the monitor you are using will
- work with the requested mode. Monitor damage may result
- from improper use of SVGA256.
-
- Example: see SVGA16
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- VGA13X: changes standard VGA systems to undocumented 256-color graphics
- modes. ASMLIB graphics subroutines support 4 VGA13X modes
- with up to 4 pages. See also XMode.
- VGA13X is based on public domain code from John Bridges and
- Themie Gouthas.
- Source: vga13x.asm (vga13x.inc, $graph.asm)
-
- Call with: AX = VGA13X mode number
- 0 = 320 x 200, 4 pages
- 1 = 320 x 240, 3 pages
- 2 = 320 x 400, 2 pages
- 3 = 360 x 480, 1 page
- assumes DS:@data
- Returns: nothing
- Uses: nothing
- Supports: VGA only: graphics mode
- Example:
-
- include asm.inc
-
- extrn vga13x:proc
-
- .code
- ; program fragment assumes DS:@data
- .
- .
- .
- call getcrt
- cmp al,3
- jne oops ; do something else if no VGA
- mov ax,2 ; 320 x 400, 2 pages
- call vga13x
-
-
-
- ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- XMODE16: establish SuperEGA/SuperVGA graphics mode and configure
- ASMLIB graphics subroutines to work with the mode.
- Source: xmode16.asm ($graph.asm)
-
- XMODE: public byte in DGROUP; used to restore ASMLIB's default
- configuration
- Source: $graph.asm
-
- Parameters: maximum x, maximum y, registers as required to set mode.
- XMode16 assumes that the mode is set with AH = 0.
- Returns: nothing
- Uses: All registers and flags saved.
- Supports: 16-color EGA/VGA-style graphics modes, up to 800 x 600 pixels.
- Various equipment. You must have the required equipment and
- use the correct mode number; hardware damage may result from
- improper use of XMode16. I cannot be held responsible for
- damage resulting from use or misuse of XMode16. Use XMode16
- if your equipment is not supported by SVGA16.
-
- If 800 horizontal pixels are available, maxX% should be 799.
- Similarly, if 600 vertical pixels are possible, maxY% should
- be 599.
-
- Your graphics card manual lists mode numbers, monitor
- requirements, and the number of horizontal and vertical
- pixels corresponding to the mode. Mode numbers are usually
- in hex format. Some modes and corresponding mode numbers
- are listed on the next pages.
-
-
-
- Equipment mode mode number Example
-
- Orchid ProDesigner 800x600 29h mov ax,799
- STB EM/16 push ax
- Genoa mov ax,599
- Sigma X16 push ax
- (Tseng chip set) mov al,29h
- call xmode16
-
-
- Everex MED EGA 640X480 AL = 70h, BL = 00h
- (Micro Enhancer Deluxe)
- 752x410 AL = 70h, BL = 01h
- mov ax,751
- push ax
- mov ax,409
- push ax
- mov al,70h
- mov bl,01h
- call xmode16
-
-
- ATI VGA Wonder 800x600 54h mov ax,799
- push ax
- mov ax,599
- push ax
- mov al,54h
- call xmode16
-
-
- ATI VIP 800x560 53h mov ax,799
- push ax
- mov ax,559
- push ax
- mov al,53h
- call xmode16
-
- (continued)
-
- Paradise Plus-16 800x600 58h mov ax,799
- Paradise Professional push ax
- mov ax,599
- push ax
- mov al,58h
- call xmode16
-
-
- Video 7 Fastwrite 800x600 62h mov ax,799
- Video 7 VRAM push ax
- mov ax,599
- push ax
- mov al,62h
- call xmode16
-
-
- Western Digital 800x600 6Ah (color) mov ax,799
- 6Bh (mono) push ax
- (VESA modes) mov ax,599
- push ax
- mov al,6Ah ; color
- call xmode16
-
-
- If any of this information conflicts with the specifications in your
- video card's instruction manual, the manual's recommendation is a safer
- bet. Note that all the above modes require a multi-frequency monitor.
-
- When you're all done with Graphics mode,
-
- CALL ModeColor
-
- to return to 80x25 text mode, and
-
- MOV XMode,0FFh
-
- to reset ASMLIB's graphics mode flags.
-
-
-
-