home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / asmlib37.zip / MODE.DOC < prev    next >
Text File  |  1993-05-24  |  15KB  |  396 lines

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