home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / screen / video / video.doc < prev    next >
Text File  |  1988-12-22  |  7KB  |  289 lines

  1. Module  : VIDEO.ASM - Direct Video Access Routines for TASM Version 1
  2. Author  : Dave Bennett
  3. Version : 1.0
  4. Date    : 11/9/88
  5. CIS PPN : 74635,1671
  6.  
  7. Description:
  8. ------------
  9.  
  10.   This is a module of FAST direct video routines for TASM.  At this time they
  11.   are released to the public domain.  Much thanks to Brian Foley for
  12.   FASTWR.PAS (Turbo Pascal V3 Inline Assember Screen Routines) which gave much
  13.   insight on screen positioning and snow suppresion (horiz retrace waiting)
  14.  
  15.   These routines are dying to have someone write an accompaning windowing
  16.   module... (hint hint)
  17.  
  18.   Please contact me a tell me what you think via EPlex, IBMNET, Borland
  19.   forums etc...  I am very interested in your opinions, bug reports, etc..
  20.  
  21.   --Dave
  22.  
  23. Files in the distributed archive
  24. --------------------------------
  25.  
  26.   Name     Ext    Size      Description
  27.   ----     ---    -----     -----------
  28.   VIDDEMO  ASM    20487     Demonstration program
  29.   VIDEO    ASM    26416     Video routines
  30.   VIDEO    DOC     6792     This file
  31.   VIDDEMO  EXE     2662     Compiled video demo (Not bad for 2.5K!)
  32.   VIDEO    INC     2366     Global Declareations & equates for VIDEO.ASM
  33.   VIDDEMO  MAK      165     Turbo Make file for VIDDEMO.EXE
  34.  
  35. Features:
  36. ---------
  37.  
  38.   - Video mode detection
  39.   - Monochrome/CGA/EGA support
  40.   - Snow suppression
  41.   - Direct character & string writing
  42.   - Screen saving & restoring
  43.   - Area fills (character, attribute, and both)
  44.   - Cursor on & off control
  45.   - All commands w/ or w/o attribute changes
  46.  
  47.  
  48. Global Data:
  49. ------------
  50.  
  51.   BaseOfScreen          Word value set by GetVideoMode proc.  This is
  52.             set to B800h / B000h depending video mode.
  53.  
  54.   SnowCheck             Byte value set by GetVideoMode.  Set to 1 if
  55.             adapter is CGA (Not EGA) by default.  Mono and
  56.             EGA cards will set this to 0 by default.
  57.  
  58.   VideoMode             Video mode set by GetVideoMode.  This holds the
  59.             video mode at the time of the last GetVideoMode
  60.             call (Set by BIOS INT 10 func 0Fh).
  61.  
  62.  
  63. Global Procedures:
  64. ------------------
  65.  
  66. Note: No routines preserve the flags register!
  67.  
  68. See VIDDEMO.ASM for examples of all routines,  all references to this module
  69. and VIDEO.INC have been highlighted with a ($) so that you may better
  70. scan VIDDEMO.ASM for examples of how to apply these routines.  --Dave
  71.  
  72.  
  73.   EGAInstalled
  74.   ------------
  75.     This procedure checks to see if the current adapter card is an
  76.     EGA.
  77.  
  78.     Output
  79.       AL = 1 if EGA Adapter is found / 0 if not
  80.  
  81.     Modified
  82.       AX
  83.  
  84.  
  85.   GetVideoMode
  86.   ------------
  87.     This procedure checks the video mode and sets the BaseOfScreen
  88.     accordingly.  It also sets SnowCheck to 1 if adapter is a CGA.
  89.  
  90.     Output
  91.       BaseOfScreen
  92.       VideoMode
  93.       SnowCheck
  94.  
  95.     Uses
  96.       EGAInstalled
  97.  
  98.  
  99.   DWriteCH
  100.   --------
  101.     Writes a character to the screen using direct memory access.
  102.  
  103.     *** IMPORTANT -- CALL GetVideoMode Before using this routine!
  104.  
  105.     Input
  106.       AH      Row on screen 1-25
  107.       AL      Column on screen 1-80
  108.       BH      Video Attribute
  109.       BL      Character
  110.       CX      Number of times
  111.  
  112.     Output
  113.       Screen memory (B000:0000 or 8000 CGA/MONO
  114.  
  115.  
  116.   DWriteCHNA
  117.   ----------
  118.     Writes a character to the screen using direct memory access.
  119.     This procedure does not disturb current attr setting.
  120.  
  121.     *** IMPORTANT -- CALL GetVideoMode Before using this routine!
  122.  
  123.     Input
  124.       AH      Row on screen 1-25
  125.       AL      Column on screen 1-80
  126.       BL      Character
  127.       CX      Number of times
  128.  
  129.     Output
  130.       Screen memory (B000:0000 or 8000 CGA/MONO
  131.  
  132.  
  133.     DWriteStr
  134.     ---------
  135.     This procedure writes a null delimited string to the screen using
  136.     direct memory access.
  137.  
  138.     *** IMPORTANT -- CALL GetVideoMode Before using this routine!
  139.  
  140.     Input
  141.       DS:SI   Null terminated string to print
  142.       AH      Row on screen 1-25
  143.       AL      Column on screen 1-80
  144.       BH      Video Attribute
  145.  
  146.     Output
  147.       Screen memory (B000:0000 or 8000 CGA/MONO
  148.  
  149.     Modifies
  150.       SI - Returns 1 byte past null of displayed string
  151.  
  152.  
  153.   DWriteStrNA
  154.   -----------
  155.     This procedure writes a null delimited string to the screen using
  156.     direct memory access, attribute is not changed.
  157.  
  158.     *** IMPORTANT -- CALL GetVideoMode Before using this routine!
  159.  
  160.     Input
  161.       DS:SI   Null terminated string to print
  162.       AH      Row on screen 1-25
  163.       AL      Column on screen 1-80
  164.  
  165.     Output
  166.       Screen memory (B000:0000 or 8000 CGA/MONO)
  167.  
  168.     Modifies
  169.       SI - Returns 1 byte past null of displayed string
  170.  
  171.  
  172.   DFillCH
  173.   -------
  174.     This procedure fills an area of the screen with the specified
  175.     character and attribute.
  176.  
  177.     *** IMPORTANT -- CALL GetVideoMode Before using this routine!
  178.  
  179.     Input
  180.       AH      = Top Row
  181.       AL      = Left Column
  182.       BH      = Number of rows
  183.       BL      = Number of columns
  184.       DH      = Attribute
  185.       DL      = Character
  186.  
  187.  
  188.   DFillCHNA
  189.   ---------
  190.     This procedure fills an area of the screen with the specified
  191.     character. Attribute remains the same.
  192.  
  193.     *** IMPORTANT -- CALL GetVideoMode Before using this routine!
  194.  
  195.     Input
  196.       AH      = Top Row
  197.       AL      = Left Column
  198.       BH      = Number of rows
  199.       BL      = Number of columns
  200.       DL      = Character
  201.  
  202.  
  203.   DFillAttr
  204.   ---------
  205.     This procedure fills an area of the screen with the specified
  206.     attribute. Character remains the same.
  207.  
  208.     *** IMPORTANT -- CALL GetVideoMode Before using this routine!
  209.  
  210.     Input
  211.       AH      = Top Row
  212.       AL      = Left Column
  213.       BH      = Number of rows
  214.       BL      = Number of columns
  215.       DH      = Attribute
  216.  
  217.  
  218.   StoreToMem
  219.   ----------
  220.     This procedure moves an image from the screen to the designated
  221.     memory area.
  222.  
  223.     *** IMPORTANT -- CALL GetVideoMode Before using this routine!
  224.  
  225.     Input
  226.       AH      = Top Row
  227.       AL      = Left Column
  228.       BH      = Number of rows
  229.       BL      = Number of columns
  230.       ES:DI   = Memory Destination
  231.  
  232.     Modifies
  233.       DI
  234.  
  235.  
  236.   StoreToScr
  237.   ----------
  238.     This procedure moves an image from memory to the designated
  239.     screen location.
  240.  
  241.     *** IMPORTANT -- CALL GetVideoMode Before using this routine!
  242.  
  243.     Input
  244.       AH      = Top Row
  245.       AL      = Left Column
  246.       BH      = Number of rows
  247.       BL      = Number of columns
  248.       DS:SI   = Memory Area of image
  249.  
  250.     Modifies
  251.       SI
  252.  
  253.  
  254.   CursorOff
  255.   ---------
  256.     This procedure simply turns the Cursor off
  257.  
  258.  
  259.   CursorOn
  260.   --------
  261.     This procedure simply turns the Cursor on
  262.  
  263.  
  264. Disclaimer
  265. ----------
  266.  
  267.   The current status of these routines is public domain.  Author makes no
  268.   claims to the usefullness of these routines and cannot be held responsible
  269.   for any situation resulting from the use of these routines.
  270.  
  271.   - David Bennett
  272.  
  273. v1.1, 1.2 : Toad Hall Tweak, 22 Dec 88
  274. v1.1:
  275.  -    Modified for MASM (early versions .. none of the new v5.0 stuff)
  276.     instead of the TASM assembler.
  277.  -    Rewritten into a simpler .COM file instead of the .EXE version
  278.     (e.g., single segment).
  279.  -    VIDEO1.ASM rewritten to be source INCLUDEd in VIDDEMO1 (or whatever
  280.     program you're writing.
  281.  -    VIDEO1.INC rewritten to be an INCLUDE file for VIDDEMO1 or your
  282.     program.
  283.  -    Slight tweaks, no functional changes.
  284. v1.2:
  285.  -    VIDEO2.ASM rewritten to be compiled separately into its own
  286.     .OBJ file (for later linking with VIDDEMO2 or your program).
  287.  -    VIDDEMO2.ASM also rewritten with this linking in mind.
  288.  -    Still a .COM file format (e.g., single segment).
  289.