home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / asm32 / mode.doc < prev    next >
Text File  |  1993-12-07  |  15KB  |  412 lines

  1.  
  2. ****************************  VIDEO MODES  ***********************************
  3.  
  4. ASM32 video mode subroutines (C) Copyright 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, ECX, 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. TOCOLOR:     switches system to color text mode; may be used to switch
  90.              monitors on a 2-monitor system, or to switch to the standard
  91.              80-column, 25-rows color mode from other color modes
  92. Source:      tocolor.asm ($6845.asm)
  93.  
  94. Call with:   no parameters
  95. Returns:     CF = 1 if no color monitor
  96.              CF = 0 if successful
  97. Uses:        CF; all registers and all other flags are saved
  98. Example:
  99.  
  100. extrn   tocolor:near
  101.  
  102. include codeseg.inc
  103.  
  104.         .
  105.         .
  106.         .
  107.         call  tocolor
  108.         jc    no_color
  109.         .
  110.         .
  111.         .
  112.  
  113.  
  114. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  115.  
  116. TOMONO:      switches system to monochrome text mode; may be used either
  117.              to switch active monitors on a 2-monitor sysem or to switch
  118.              to monchrome text mode (80x25) from graphics mode (EGA or
  119.              Hercules).
  120. Source:      tocolor.asm ($6845.asm)
  121.  
  122. Call with:   no parameters
  123. Returns:     CF = 1 if no monochrome or InColor monitor
  124.              CF = 0 if successful
  125. Uses:        CF; all registers and all other flags are saved
  126. Example:
  127.  
  128. extrn   tomono:near
  129.  
  130. include codeseg.inc
  131.  
  132.         .
  133.         .
  134.         .
  135.         call  modemono
  136.         jc    no_mono
  137.         .
  138.         .
  139.         .
  140.  
  141.  
  142. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  143.  
  144. MODE43:      switch EGA to 80x43 text mode or VGA to 80x50 text mode
  145.              Mode43 switches an EGA to the 80-column, 43-row text mode from
  146.              any color mode or any EGA monochrome mode, or switches a color
  147.              VGA to 80x50 text mode from any other color mode.
  148. Source:      mode43.asm
  149.  
  150. Call with:   no parameters
  151. Returns:     if CF = 1, AX = 0 if no EGA or VGA in system
  152.                         AX = -1 if EGA connected to CGA monitor
  153.              if CF = 0, AX = 3 if EGA or VGA connected to color monitor
  154.                         AX = 7 if EGA or VGA connected to monochrome monitor
  155. Uses:        AX, CF; all other registers and flags are saved
  156. Example:     call  mode43
  157.              jc    noega
  158.  
  159.  
  160.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  161.  
  162. SVGA132:     set 132-column text mode on supported SEGA and SVGA systems
  163. Source:      svga132.asm ($sega.asm, $svga.asm)
  164.  
  165. Call with:   AX = mode number
  166.               0 = 25 rows
  167.               1 = 30 rows (approx)
  168.               2 = 43 rows (approx)
  169.               3 = 50 rows (SVGA only)
  170.               4 = 60 rows (SVGA only)
  171. Returns:     if CF = 0, no error
  172.              if CF = 1, mode not supported
  173. Uses:        flags
  174. Example:
  175.  
  176. include model.inc
  177.  
  178. public  set132mode
  179. extrn   svga132:near
  180.  
  181. include codeseg.inc
  182.  
  183. set132mode      proc near
  184.         mov    ax,4
  185. try_to_set_mode:
  186.         call    svga132
  187.         jnc     short all_done   ; all done if it worked
  188.         sub     ax,1             ;  else try next lower mode number
  189.         jnc     try_to_set_mode  ;  unless modes exhausted
  190.                                  ;  then exit with CF = 1
  191. all_done:
  192.         ret
  193.  
  194.  
  195.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  196.  
  197. SVGA16:      set Super VGA mode
  198. Source:      svga16.asm (banks.asm, $graph.asm)
  199.  
  200. Call with:   AX = 16-color mode desired
  201.              AX = 0 for 800x600
  202.              AX = 1 for 1024x768
  203.  
  204.              ASM32'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
  221.              Video 7
  222.  
  223.              I have not been able to test SVGA16 on all boards; please
  224.              let me know if you encounter difficulties.
  225.  
  226. Returns:     if CF = 0, AX = extended BIOS mode number
  227.              if CF = 1, requested mode is not available
  228.              SVGA16 cannot determine if the monitor you are using will
  229.              work with the requested mode.  Monitor damage may result
  230.              from improper use of SVGA16.
  231.  
  232. Example:
  233.  
  234. public mygraph
  235. extrn  whichvga:near, svga16:near
  236.  
  237. include codeseg.inc
  238.  
  239. mygraph proc   near
  240. ; I want to use a 16-color 1024x768 mode if available
  241. ; start by calling WhichVGA to determine if the equipment is capable
  242.         call   whichvga
  243.         or     ax,ax            ; SuperVGA installed?
  244.         jz     no_svga          ; nope, use some other mode
  245.         mov    ax,1             ; specify 1024x768 mode
  246.         call   svga16
  247.  
  248.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  249.  
  250. SVGA256:     set Super VGA 256-color mode
  251. Source:      svga256.asm (banks.asm)
  252.  
  253. Call with:   AX = 256-color mode desired
  254.              AX = 0 for  640x400
  255.              AX = 1 for  640x480
  256.              AX = 2 for  800x600
  257.              AX = 3 for 1024x768
  258.  
  259.              ASM32's SVGA256 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:     if CF = 0, AX = extended BIOS mode number
  268.              if CF = 1, 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.  
  278. VGA13X:      changes standard VGA systems to undocumented 256-color graphics
  279.              modes.  ASM32 graphics subroutines support 4 VGA13X modes
  280.              with up to 4 pages.  See also XModeClear.
  281.              VGA13X is derived from public domain code from John Bridges
  282.              and Themie Gouthas.
  283. Source:      vga13x.asm (crtc.13x, $graph.asm)
  284.  
  285. Call with:   AX = VGA13X mode number
  286.               0 = 320 x 200, 4 pages
  287.               1 = 320 x 240, 3 pages
  288.               2 = 320 x 400, 2 pages
  289.               3 = 360 x 480, 1 page
  290. Returns:     nothing
  291. Uses:        nothing
  292. Supports:    VGA or SVGA only: graphics mode
  293. Example:
  294.  
  295. extrn   vga13x:proc
  296.  
  297. include codeseg.inc
  298.         .
  299.         .
  300.         .
  301.         call   getcrt
  302.         cmp    al,3
  303.         jne    short oops            ; do something else if no VGA
  304.         mov    ax,2                  ; 320 x 400, 2 pages
  305.         call   vga13x
  306.  
  307.  
  308.  
  309. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  310.  
  311. XMODE16:     establish SuperEGA/SuperVGA graphics mode and configure
  312.              ASM32 graphics subroutines to work with the mode.
  313. XMODECLEAR:  restore ASM32's default graphics configuration
  314. Source:      xmode16.asm ($graph.asm)
  315.  
  316. Parameters:  maximum x, maximum y, registers as required to set mode.
  317.              XMode16 assumes that the mode is set with AH = 0.
  318. Returns:     nothing
  319. Uses:        All registers and flags saved.
  320. Supports:    16-color EGA/VGA-style graphics modes, up to 800 x 600 pixels.
  321.              Various equipment.  You must have the required equipment and
  322.              use the correct mode number;  hardware damage may result from
  323.              improper use of XMode16.  I cannot be held responsible for
  324.              damage resulting from use or misuse of XMode16.  Use XMode16
  325.              if your equipment is not supported by SVGA16.
  326.  
  327.              If 800 horizontal pixels are available, maxX% should be 799.
  328.              Similarly, if 600 vertical pixels are possible, maxY% should
  329.              be 599.
  330.  
  331.              Your graphics card manual lists mode numbers, monitor
  332.              requirements, and the number of horizontal and vertical
  333.              pixels corresponding to the mode.  Mode numbers are usually
  334.              in hex format.  Some modes and corresponding mode numbers
  335.              are listed on the next pages.
  336.  
  337.  
  338.  
  339.     Equipment            mode     mode number   Example
  340.  
  341.     Orchid ProDesigner   800x600        29h     mov   ax,799
  342.     STB EM/16                                   push  ax
  343.     Genoa                                       mov   ax,599
  344.     Sigma X16                                   push  ax
  345.     (Tseng chip set)                            mov   al,29h
  346.                                                 call  xmode16
  347.  
  348.  
  349.     Everex MED EGA       640X480   AL = 70h, BL = 00h
  350.     (Micro Enhancer Deluxe)
  351.                          752x410   AL = 70h, BL = 01h
  352.                                                 mov   ax,751
  353.                                                 push  ax
  354.                                                 mov   ax,409
  355.                                                 push  ax
  356.                                                 mov   al,70h
  357.                                                 mov   bl,01h
  358.                                                 call  xmode16
  359.  
  360.  
  361.     ATI VGA Wonder       800x600        54h     mov   ax,799
  362.                                                 push  ax
  363.                                                 mov   ax,599
  364.                                                 push  ax
  365.                                                 mov   al,54h
  366.                                                 call  xmode16
  367.  
  368.  
  369.     ATI VIP              800x560        53h     mov   ax,799
  370.                                                 push  ax
  371.                                                 mov   ax,559
  372.                                                 push  ax
  373.                                                 mov   al,53h
  374.                                                 call  xmode16
  375.  
  376. (continued)
  377.  
  378.     Paradise Plus-16     800x600        58h     mov   ax,799
  379.     Paradise Professional                       push  ax
  380.                                                 mov   ax,599
  381.                                                 push  ax
  382.                                                 mov   al,58h
  383.                                                 call  xmode16
  384.     
  385.  
  386.     Video 7 Fastwrite    800x600        62h     mov   ax,799
  387.     Video 7 VRAM                                push  ax
  388.                                                 mov   ax,599
  389.                                                 push  ax
  390.                                                 mov   al,62h
  391.                                                 call  xmode16
  392.  
  393.  
  394.     Western Digital      800x600   6Ah (color)  mov   ax,799
  395.                                    6Bh (mono)   push  ax
  396.     (VESA modes)                                mov   ax,599
  397.                                                 push  ax
  398.                                                 mov   al,6Ah   ; color
  399.                                                 call  xmode16
  400.     
  401.  
  402.     If any of this information conflicts with the specifications in your
  403.     video card's instruction manual, the manual's recommendation is a safer
  404.     bet.  Note that all the above modes require a multi-frequency monitor.
  405.  
  406.     When you're all done with Graphics mode, CALL ModeColor to return to
  407.     80x25 text mode, and CALL XModeClear to reset ASM32's graphics mode
  408.     flags.
  409.  
  410.  
  411.  
  412.