home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / asmlib.zip / MODE.DOC < prev    next >
Text File  |  1992-06-13  |  15KB  |  378 lines

  1.  
  2. ****************************  VIDEO MODES  ***********************************
  3.  
  4. ASMLIB video mode subroutines (c) Copyright 1991 Douglas Herr
  5. All rights reserved
  6.  
  7. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  8.  
  9. HGRAPH:      establishes Hercules graphics mode, pages 0 & 1
  10. HGRAPH0:     establishes Hercules graphics mode, clear page 0 only
  11. Source:      hgraph.asm (a$herc.asm, hmode.asm)
  12.  
  13. Hercules or compatible required
  14. (including Hercules InColor)
  15.  
  16. Call with:   no parameters
  17. Returns:     if CF = 1, no Hercules installed
  18.              if CF = 0, AX = code for Hercules model
  19.              128 = HGC
  20.              144 = HGC+
  21.              208 = InC
  22. Uses:        AX, CX, CF
  23. Supports:    Hercules graphics cards and compatibles: graphics mode
  24.              see also Use64k in SYSTEM.DOC
  25. Example:     call    hgraph      ; establish graphics mode
  26.              jc      no_hercules ; drat!
  27.  
  28.  
  29. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  30.  
  31. HRAM8043:    establish an 80-column, 43-row RamFont mode, loading a
  32.              standard 8x8 character font in RAM
  33. Source:      hram8043.asm (a$herc.asm, hmode.asm, hload8x8.asm)
  34.  
  35. HRAM9025:    establish a 90-column, 25-row RamFont mode using
  36.              standard ROM characters
  37. Source:      hram9025.asm (a$herc.asm, hmode.asm)
  38.  
  39. HRAM9043:    establish a 90-column, 43-row RamFont mode, loading a
  40.              standard 8x8 character font in RAM
  41. Source:      hram9043.asm (a$herc.asm, hload8x8.asm, hmode.asm)
  42.  
  43. Hercules RamFont card required
  44. (including Hercules InColor)
  45.  
  46. Note:        use htext to restore normal 80 x 25 text mode
  47.  
  48. Call with:   no parameters
  49. Returns:     if CF = 1, no RamFont card installed
  50.              if CF = 0, AX = code for Hercules model
  51.              144 = HGC+
  52.              208 = InC
  53. Uses:        AX, CF; all other flags and registers are saved
  54. Supports:    HGC+ and InC cards: 4k RamFont mode
  55. Example:     call  hram8043      ; RamFont mode: 80x43
  56.              jc    no_ramfont    ; drat!
  57.  
  58.  
  59. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  60.  
  61. HTEXT:       establish (or restore) Hercules text mode
  62. Source:      htext.asm (a$herc, hmode)
  63.  
  64. Call with:   no parameters
  65. Returns:     if CF = 1, no Hercules installed
  66.              if CF = 0, AX = code for Hercules model
  67.              128 = HGC
  68.              144 = HGC+
  69.              208 = InC
  70. Uses:        AX, CF
  71. Supports:    Hercules graphics cards and compatibles: text mode
  72.              (including Hercules InColor)
  73. Example:     call  htext         ; Hercules text mode
  74.              jc    no_herc       ; drat!
  75.  
  76.  
  77. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  78.  
  79. MODE13243:   switches supported systems to 132 column, 43 row text mode
  80. MODE13225:   switches supported systems to 132 column, 25 row text mode
  81. Source:      mode132.asm (isevga.asm)
  82.  
  83. Call with:   AX = SuperEGA/VGA code returned by IsSEVGA
  84. Returns:     CF = 1 if mode not supported
  85.              if CF = 0, AX = mode number
  86. Uses:        AX, CF; all other registers and flags are saved
  87. Supports:    Equipment detected by IsSEVGA (see IsSEVGA in SYSTEM.DOC).
  88.              Most VGA boards require a multi-frequency monitor to
  89.              use 132-column modes; consult your board's documentation.
  90.              The Paradise EGA 480 requires an EGA monitor; the Everex
  91.              EGA works with Monochrome and EGA monitors, and the 25-row
  92.              mode also works with a CGA monitor.
  93. Example:
  94.  
  95.     call  issevga        ; test for Super EGA or Super VGA
  96.     jc    no132          ; no good - skip
  97.     call  mode13243      ; set mode
  98.     jc    no132          ; no good
  99.           .
  100.           .
  101.           .
  102.  
  103.  
  104.  
  105. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  106.  
  107. MODECOLOR:   switches system to color text mode; may be used to switch
  108.              monitors on a 2-monitor system, or to switch to the standard
  109.              80-column, 25-rows color mode from other color modes
  110. Source:      mode.asm (find6845.asm)
  111.  
  112. Call with:   no parameters
  113. Returns:     CF = 1 if no color monitor
  114.              CF = 0 if successful
  115. Uses:        CF; all registers and all other flags are saved
  116. Example:     call  modecolor
  117.              jc    nocolor
  118.                 .
  119.                 .
  120.                 .
  121.  
  122. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  123.  
  124. MODEMONO:    switches system to monochrome text mode; may be used either
  125.              to switch active monitors on a 2-monitor sysem or to switch
  126.              to monchrome text mode (80x25) from graphics mode (EGA or
  127.              Hercules).
  128. Source:      mode.asm (find6845.asm)
  129.  
  130. Call with:   no parameters
  131. Returns:     CF = 1 if no monochrome monitor
  132.              CF = 0 if successful
  133. Uses:        CF; all registers and all other flags are saved
  134. Example:     call  modemono
  135.              jc   nomono
  136.                 .
  137.                 .
  138.                 .
  139.  
  140. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  141.  
  142. MODE43:      switch EGA to 80x43 text mode or VGA to 80x50 text mode
  143.              Mode43 switches an EGA to the 80-column, 43-row text mode from
  144.              any color mode or any EGA monochrome mode, or switches a color
  145.              VGA to 80x50 text mode from any other color mode.
  146. Source:      mode43.asm
  147.  
  148. Call with:   no parameters
  149. Returns:     if CF = 1, AX = 0 if no EGA or VGA in system
  150.                         AX = -1 if EGA connected to CGA monitor
  151.              if CF = 0, AX = 3 if EGA or VGA connected to color monitor
  152.                         AX = 7 if EGA or VGA connected to monochrome monitor
  153. Uses:        AX, CF; all other registers and flags are saved
  154. Example:     call  mode43
  155.              jc    noega
  156.  
  157.  
  158.  
  159. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  160.  
  161. SUPER13:     changes standard VGA systems to an undocumented 320x400
  162.              256-color graphics mode.  ASMLIB supports 2 graphics pages
  163.              in this mode.  See also XModeClear.
  164. Source:      super13.asm (a$graph.asm)
  165.  
  166. Call with:   no parameters
  167. Returns:     if CF = 1, no VGA installed
  168.              if CF = 0, all OK
  169. Uses:        AX, CF
  170. Supports:    VGA only: graphics mode
  171. Example:     call   super13
  172.              jc     oops             ; do something else if no VGA
  173.  
  174.  
  175. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  176.  
  177. SUPER13A:    an undocumented 360x480 256-color mode for any VGA system.
  178.              One page is available in this mode.  See Super13 for example.  
  179.              ASMLIB graphics subroutines recognize this mode.
  180.              Super13a is based on John Bridges' code and parameters.
  181. Source:      super13a.asm
  182.  
  183. Call with:   no parameters
  184. Returns:     if CF = 1, no VGA installed
  185.              if CF = 0, all OK
  186. Uses:        AX, flags
  187. Supports:    VGA only: graphics mode
  188. Example:     call   super13a
  189.              jc     oops             ; do something else if no VGA
  190.  
  191.  
  192.  
  193.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  194.  
  195. SVGA16:      set Super VGA mode
  196. Source:      svga16.asm (banks.asm)
  197.  
  198. Call with:   AX = 16-color mode desired
  199.              AX = 0 for 800x600
  200.              AX = 1 for 1024x768
  201.  
  202.              !! DO NOT USE ANY VALUE FOR AX OTHER THAN 0 OR 1 !!
  203.  
  204.              ASMLIB's SVGA subroutines are derived from John Bridges'
  205.              public domain VGAKIT board identification and bank switching code.
  206.              Boards supported are:
  207.  
  208.              Ahead Technologies
  209.              ATI
  210.              Chips & Technologies
  211.              Everex
  212.              Genoa GVGA
  213.              NCR
  214.              Oak Technologies
  215.              Paradise (Western Digital)
  216.              Trident
  217.              Trident 8900
  218.              Tseng (Genoa, Orchid, Willow)
  219.              Tseng 4000
  220.              VESA standard  (800x600 only)
  221.              Video 7
  222.  
  223. Returns:     AX = mode number
  224.              if AX = 0, requested mode is not available
  225.              SVGA16 cannot determine if the monitor you are using will
  226.              work with the requested mode.  Monitor damage may result
  227.              from improper use of SVGA16.
  228.  
  229. Example:
  230.  
  231. include asm.inc
  232.  
  233. public mygraph
  234. extrn  whichvga:proc, extrn  svga16:proc
  235.  
  236. .code
  237. mygraph proc
  238. ; I want to use a 16-color 1024x768 mode if available
  239. ; start by calling WhichVGA to determine if the equipment is capable
  240.         call   whichvga
  241.         or     ax,ax            ; SuperVGA installed?
  242.         jz     no_svga          ; nope, use some other mode
  243.         mov    ax,1             ; specify 1024x768 mode
  244.         call   svga16
  245.  
  246.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  247.  
  248. SVGA256:     set Super VGA 256-color mode
  249. Source:      svga256.asm (banks.asm)
  250.  
  251. Call with:   AX = 256-color mode desired
  252.              AX = 0 for  640x400
  253.              AX = 1 for  640x480
  254.              AX = 2 for  800x600
  255.              AX = 3 for 1024x768
  256.  
  257.              !! DO NOT USE ANY AX VALUES OTHER THAN 0, 1, 2 & 3 !!
  258.  
  259.              ASMLIB's SVGA subroutines are derived from John Bridges'
  260.              public domain VGAKIT board identification and bank switching code.
  261.  
  262.              Equipment supported is listed under SVGA16, plus:
  263.  
  264.              Compaq (640x480 only)
  265.  
  266.  
  267. Returns:     AX = mode number
  268.              if AX = 0, requested mode is not available
  269.              SVGA256 cannot determine if the monitor you are using will
  270.              work with the requested mode.  Monitor damage may result
  271.              from improper use of SVGA256.
  272.  
  273. Example:     see SVGA16
  274.  
  275. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  276.  
  277. XMODE16:     establish SuperEGA/SuperVGA graphics mode and configure
  278.              ASMLIB graphics subroutines to work with the mode.
  279. XMODECLEAR:  restore ASMLIB's default graphics configuration
  280. Source:      xmode16.asm, a$graph.asm
  281.  
  282. Parameters:  maximum x, maximum y, registers as required to set mode.
  283.              XMode16 assumes that the mode is set with AH = 0.
  284. Returns:     nothing
  285. Uses:        All registers and flags saved.
  286. Supports:    16-color EGA/VGA-style graphics modes, up to 800 x 600 pixels.
  287.              Various equipment.  You must have the required equipment and
  288.              use the correct mode number;  hardware damage may result from
  289.              improper use of XMode16.  I cannot be held responsible for
  290.              damage resulting from use or misuse of XMode16.  Use XMode16
  291.              if your equipment is not supported by SVGA16.
  292.  
  293.              If 800 horizontal pixels are available, maxX% should be 799.
  294.              Similarly, if 600 vertical pixels are possible, maxY% should
  295.              be 599.
  296.  
  297.              Your graphics card manual lists mode numbers, monitor
  298.              requirements, and the number of horizontal and vertical
  299.              pixels corresponding to the mode.  Mode numbers are usually
  300.              in hex format.  Some modes and corresponding mode numbers
  301.              are listed on the next pages.
  302.  
  303.  
  304.  
  305.     Equipment            mode     mode number   Example
  306.  
  307.     Orchid ProDesigner   800x600        29h     mov   ax,799
  308.     STB EM/16                                   push  ax
  309.     Genoa                                       mov   ax,599
  310.     Sigma X16                                   push  ax
  311.     (Tseng chip set)                            mov   al,29h
  312.                                                 call  xmode16
  313.  
  314.  
  315.     Everex MED EGA       640X480   AL = 70h, BL = 00h
  316.     (Micro Enhancer Deluxe)
  317.                          752x410   AL = 70h, BL = 01h
  318.                                                 mov   ax,751
  319.                                                 push  ax
  320.                                                 mov   ax,409
  321.                                                 push  ax
  322.                                                 mov   al,70h
  323.                                                 mov   bl,01h
  324.                                                 call  xmode16
  325.  
  326.  
  327.     ATI VGA Wonder       800x600        54h     mov   ax,799
  328.                                                 push  ax
  329.                                                 mov   ax,599
  330.                                                 push  ax
  331.                                                 mov   al,54h
  332.                                                 call  xmode16
  333.  
  334.  
  335.     ATI VIP              800x560        53h     mov   ax,799
  336.                                                 push  ax
  337.                                                 mov   ax,559
  338.                                                 push  ax
  339.                                                 mov   al,53h
  340.                                                 call  xmode16
  341.  
  342. (continued)
  343.  
  344.     Paradise Plus-16     800x600        58h     mov   ax,799
  345.     Paradise Professional                       push  ax
  346.                                                 mov   ax,599
  347.                                                 push  ax
  348.                                                 mov   al,58h
  349.                                                 call  xmode16
  350.     
  351.  
  352.     Video 7 Fastwrite    800x600        62h     mov   ax,799
  353.     Video 7 VRAM                                push  ax
  354.                                                 mov   ax,599
  355.                                                 push  ax
  356.                                                 mov   al,62h
  357.                                                 call  xmode16
  358.  
  359.  
  360.     Western Digital      800x600   6Ah (color)  mov   ax,799
  361.                                    6Bh (mono)   push  ax
  362.     (VESA modes)                                mov   ax,599
  363.                                                 push  ax
  364.                                                 mov   al,6Ah   ; color
  365.                                                 call  xmode16
  366.     
  367.  
  368.     If any of this information conflicts with the specifications in your
  369.     video card's instruction manual, the manual's recommendation is a safer
  370.     bet.  Note that all the above modes require a multi-frequency monitor.
  371.  
  372.     When you're all done with Graphics mode, CALL ModeColor to return to
  373.     80x25 text mode, and CALL XModeClear to reset ASMLIB's graphics mode
  374.     flags.
  375.  
  376.  
  377.  
  378.