home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / v / vsave193.zip / VGASAVE.DOC < prev    next >
Text File  |  1993-03-07  |  86KB  |  1,691 lines

  1.  
  2.  
  3.  
  4.    VGAsave                    Version 1.93                      2/28/93
  5.    ====================================================================
  6.    Copyright (c) 1992, 1993     Bill Javurek
  7.    ====================================================================
  8.  
  9.  
  10.    System Requirements
  11.    ===================
  12.  
  13.    VGA.
  14.  
  15.    Important:  This product is not compatible with Microsoft Windows.  See
  16.                usage notes below for info regarding MS Windows.
  17.  
  18.  
  19.    Introduction to VGAsave
  20.    =======================
  21.  
  22.    VGAsave is yet another screen saver.  The design philosophy behind this
  23.    screen saver is twofold:
  24.  
  25.       1.  To use the smallest amount of memory possible.  VGAsave requires
  26.           352 bytes of memory (448 bytes with the int 33h handler
  27.           installed).
  28.       2.  To allow the user some control over the screen saver.
  29.  
  30.    VGAsave also has the ability to detect the use of a mouse and treat it
  31.    similar to keystroke on the keyboard.  This is a nice feature when using
  32.    programs, such as, the dosshell which use a mouse as the primary input
  33.    device.  However, due to the first requirement mentioned above VGAsave
  34.    does not suppress any mouse event used to restore a saved screen.
  35.    So, be forewarned that any action on the mouse used to restore a blanked
  36.    screen will be passed on to the program currently running as if nothing
  37.    happened.  Hence, if you press a button on the mouse to restore the
  38.    screen, the program currently running will also detect the button press.
  39.    I would strongly recommend sticking to some type of nondestructive action
  40.    like nudging the mouse slightly to restore a blanked screen.
  41.  
  42.    Note:  The keystrokes used to restore a blanked screen must be a
  43.           valid keystroke and will be suppressed by VGAsave.   By the
  44.           term "valid keystroke," it is meant that you have to hit a
  45.           letter, number, function key, etc. to restore the screen.
  46.           Hitting the alt, ctrl, or shift keys alone will NOT restore
  47.           the screen.  I usually use the space bar, but that's a matter
  48.           of preference.
  49.  
  50.  
  51.    Features
  52.    ========
  53.  
  54.             *   A hot key which may be used to blank the screen at anytime.
  55.  
  56.             *   Detects mouse movement to restore a blanked screen.
  57.  
  58.             *   User selected time out.
  59.  
  60.             *   User selected hot key.
  61.  
  62.             *   Help screen.
  63.  
  64.             *   Off and On options to disable and enable VGAsave once
  65.                 VGAsave is resident in memory.
  66.  
  67.             *   An interactive menu to control various options after
  68.                 it has been loaded into memory.  Simply type "VGAsave"
  69.                 at the DOS prompt to start VGAsave.  Then type "VGAsave"
  70.                 again to bring up the menu.
  71.  
  72.             *   Command line switches for controlling VGAsave directly
  73.                 from the DOS prompt or from batch files.
  74.  
  75.             *   Minimal resident memory requirements -- 352 bytes to be
  76.                 exact (448 if the int 33h handler is installed).
  77.  
  78.             *   Supports DOS 5.0 upper memory blocks when loaded with
  79.                 DOS 5.0's loadhigh command.
  80.  
  81.             *   Its freeware.
  82.  
  83.  
  84.  
  85.    Freeware Notice
  86.    ===============
  87.  
  88.    VGAsave is released as FREEWARE and may not be sold under any
  89.    condition.  The copyright for VGAsave remains the sole property
  90.    of the author.   Modifications are prohibited.
  91.  
  92.    If you redistribute VGAsave, please distribute the entire package which
  93.    consists of VGAsave.com, Whatsnew, Readme, and VGAsave.doc.
  94.  
  95.  
  96.    Disclaimer
  97.    ==========
  98.  
  99.    This program is provided as is without any written or implied
  100.    warranty.
  101.  
  102.  
  103.    Starting VGAsave
  104.    ================
  105.  
  106.    VGAsave may be started with a default time out of 2 minutes by entering
  107.    VGAsave at the DOS prompt.  You may optionally specify a new time out by
  108.    using /c:[time out in seconds] as a command line argument.  For example,
  109.    entering "VGAsave /c:300" will start VGAsave with a time out value of
  110.    300 seconds or 5 minutes.  The /m- command line switch to disable the
  111.    mouse intercept, and the /key: switch to override the default hot key
  112.    described below may also be used when starting VGAsave.
  113.  
  114.    The IRQ line that VGAsave uses for its mouse intercept may be specified
  115.    with the /mirq command line switch.  An int 33h handler can be loaded
  116.    by using the /int33 switch.  The usage of the /mirq and /int33 is
  117.    discussed in the section entitled "Mouse Problems".  See the section
  118.    entitled "Command Line Switches" for full explanation of the command line
  119.    switches.
  120.  
  121.    Below are some examples on starting VGAsave.
  122.  
  123.    Examples:     C:>VGAsave          Start VGAsave with default values.
  124.    ========                          (Default values are shown below.)
  125.  
  126.                  C:>VGAsave /m-      Start VGAsave and disable the mouse
  127.                                      intercept.  You can turn the mouse
  128.                                      intercept back on once VGAsave is loaded
  129.                                      by using the /m+ switch described below.
  130.                                      Note that since you can turn the mouse
  131.                                      back on when you load VGAsave with the
  132.                                      /m- switch.  When used during loading,
  133.                                      this switch has the same overall effect
  134.                                      if you were to start VGAsave then run
  135.                                      it again with the /m- switch.  Hence,
  136.                                      VGAsave will report the same information
  137.                                      concerning the mouse whether or not this
  138.                                      switch is used during start up.
  139.  
  140.                  C:>VGAsave /c:300   Start VGAsave with a time out value of
  141.                                      5 minutes.  Again, you can later change
  142.                                      this.
  143.  
  144.                  C:>VGAsave /key:Alt-9    Start VGAsave and use alt-9 as a
  145.                                           hot key to blank the screen on
  146.                                           demand.  This may be also changed
  147.                                           after VGAsave is loaded.
  148.  
  149.                  C:>VGASave /mirq:3       Start VGAsave and force VGAsave
  150.                                           to use IRQ 3 for the mouse
  151.                                           intercept.  See "Mouse Problems"
  152.                                           below before using the switch.
  153.  
  154.                  C:>VGAsave /int33        Start VGAsave with the hook int 33h.
  155.                                           Read the section "Mouse Problems"
  156.                                           before using this switch.
  157.  
  158.  
  159.                  Any combination of the command line switches shown above
  160.                  may be used when starting VGAsave.  For example,
  161.  
  162.                  C:>VGAsave /c:300 /m- /Key:Alt-9
  163.  
  164.                  Sets the time out value to 5 minutes, disables the mouse
  165.                  intercept, sets the hot key to Alt-9.
  166.  
  167.                  See the section entitled "Controlling VGAsave after loading"
  168.                  for information on how to change VGAsave's settings after
  169.                  it has been started.
  170.  
  171.    Once the time out value has been reached VGAsave, will blank the screen
  172.    and return control back the program that is currently running.  Hence,
  173.    your program will continue to run as if nothing happened even if the
  174.    screen is blanked.  Once the screen is blanked, it may be restored by
  175.    pressing any key on the keyboard or by moving the mouse.
  176.  
  177.  
  178.    Default Settings for VGAsave
  179.    =============================
  180.  
  181.        Saver:            Enabled
  182.        Mouse Intercept:  (Enabled if you have a mouse)
  183.        Time Out:         120 seconds
  184.        Hot Key:          Alt-0
  185.  
  186.  
  187.  
  188.    Controlling VGAsave after loading
  189.    =================================
  190.  
  191.    Once VGAsave has been loaded in memory, commands may be passed to it in
  192.    two ways.
  193.  
  194.        1.  Issuing "VGAsave" at the DOS prompt will bring up a menu of
  195.            choices.
  196.        2.  Issuing VGAsave save at the DOS command prompt with one
  197.            or more command line arguments.
  198.  
  199.  
  200.    Interactive Menu
  201.    ================
  202.  
  203.    Running VGAsave.com without any command line arguments once the screen
  204.    saver has been loaded into memory will bring up the following menu of
  205.    choices.  Note that this means you have to run VGAsave more than once
  206.    to get the menu.  The first time you run the program, VGAsave loads
  207.    the screen saver code into memory.  The second time you run VGAsave, the
  208.    menu will be displayed if no command line switches were used.
  209.  
  210.  
  211.                 VGAsave already installed.
  212.  
  213.                 Press <R>  to remove from memory
  214.                       <->  to disable VGAsave
  215.                       <+>  to enable VGAsave
  216.                       <N>  to blank the screen now
  217.                       <C>  for a new time out
  218.                       <M>  to enable mouse intercept
  219.                       <D>  to disable mouse intercept
  220.                       <K>  for new hot key
  221.                       <S>  for VGAsave settings
  222.                       <?>  for help
  223.  
  224.                 or any other key to continue:
  225.  
  226.  
  227.         *  All the functions listed in the menu above have a command
  228.            line equivalent which are outlined below along with an
  229.            explanation of what each function does.  A listing of the
  230.            command line parameters may be obtained by using "?" from
  231.            the above menu.  There is also a command line option, /i?,
  232.            which may be used in batch files to obtain the current status
  233.            of VGAsave, and an /unblank switch which can be used to force
  234.            the screen to unblank from within batch files.  See the
  235.            discussion on "Command Line Switches" below for further
  236.            information on the /i? and /unblank switches.
  237.  
  238.         *  Note that the keys used to select a menu option are not case
  239.            sensitive.  In other words, either "S" or "s" will select the
  240.            VGAsave settings option form the menu.
  241.  
  242.         *  Selecting option "C" for a new time out value will display the
  243.            current time out and bring up the following prompt:
  244.  
  245.               Enter the new time out in seconds or hit <enter> to quit:
  246.  
  247.            If you change you mind at this point and decide that you don't
  248.            to change the time out, just hit the enter key with an empty
  249.            input field.  Otherwise, just type in the desired time out in
  250.            seconds and hit enter.
  251.  
  252.            Destructive backspacing is supported and the escape key will
  253.            clear the entire input field.  Note the time out value must be a
  254.            whole number between 10 and 3600.  If you try and enter more
  255.            than 4 digits, VGAsave will beep at you since that is automatically
  256.            invalid.  If you enter a value too large or too small VGAsave
  257.            will report an error along with the proper command line syntax
  258.            for changing the time out value and kick you out of the program
  259.            without changing the time out value.
  260.  
  261.         *  Selecting option "K" from the menu will bring up the following
  262.            screen of possible hot key choices:
  263.  
  264.            Alt-A    Alt-B    Alt-C    Alt-D    Alt-E    Alt-F    Alt-G
  265.            Alt-H    Alt-I    Alt-J    Alt-K    Alt-L    Alt-M    Alt-N
  266.            Alt-O    Alt-P    Alt-Q    Alt-R    Alt-S    Alt-T    Alt-U
  267.            Alt-V    Alt-W    Alt-X    Alt-Y    Alt-Z
  268.  
  269.            Alt-0    Alt-1    Alt-2    Alt-3    Alt-4    Alt-5    Alt-6
  270.            Alt-7    Alt-8    Alt-9    None
  271.  
  272.            The hot key currently being used by VGAsave will be highlighted.
  273.            Simply use the cursor controls to move the highlight bar
  274.            to the desired key and hit the enter key or the space bar
  275.            to select that key.
  276.  
  277.            The highlight bar will "wrap" around the menu if you hit a
  278.            cursor key that points to a location off the menu.  Please note
  279.            that since the keys are divided into 2 groups on the screen,
  280.            numbers and letters, the highlight bar wraps as follows:
  281.  
  282.            Horizontal Wrapping           Vertical Wrapping
  283.             Alt-A <==> Alt-Z              Alt-A <==> Alt-7
  284.             Alt-G <==> Alt-H              Alt-B <==> Alt-8
  285.             Alt-N <==> Alt-O              Alt-C <==> Alt-9
  286.             Alt-U <==> Alt-V              Alt-D <==> None
  287.             Alt-0 <==> None               Alt-E <==> Alt-4
  288.             Alt-6 <==> Alt-7              Alt-F <==> Alt-5
  289.                                           Alt-G <==> Alt-6
  290.  
  291.            In other words, the vertical cursor controls fully wrap around
  292.            the menu.  But, the horizontal ones wrap in a manner so that
  293.            the highlight bar will always remain in the upper or lower portion
  294.            of the menu.
  295.  
  296.        Command Line Switches
  297.        =====================
  298.  
  299.          /?     Displays a help message -- Note that VGAsave need not
  300.                 be loaded in memory to display the help message.  In
  301.                 other words, issuing "VGAsave /?" at the DOS prompt
  302.                 when VGAsave is not currently loaded in memory will
  303.                 cause it to display a help message outlining the
  304.                 command line parameters without loading VGAsave into
  305.                 memory.
  306.  
  307.          /c:n   Changes the time out value to n seconds and
  308.                 10 ≤ n ≤ 3600 -- This command line argument may
  309.                 be specified when VGAsave is initially being loaded
  310.                 into memory.
  311.  
  312.          /off   Disables VGAsave -- useful for programs that don't
  313.                 require much user interaction, such as, gif viewers or
  314.                 programs, such as, Microsoft Windows which are not
  315.                 compatible with VGAsave.
  316.  
  317.          /on    Enables VGAsave -- when it has been disabled with /off
  318.                 Note:   /on and /off can be used to trick VGAsave into
  319.                 resetting its internal clock to 0 as follows:
  320.  
  321.                             VGAsave /off  ; disables VGAsave and
  322.                                           ; resets the current time
  323.                                           ; count to 0
  324.  
  325.                             VGAsave /on   ; enables VGAsave
  326.  
  327.                 This is sometimes useful in batch files.
  328.  
  329.          /r     Removes VGAsave from memory.
  330.                 See section below on "Removing VGAsave from Memory".
  331.  
  332.          /now   Forces the screen to immediately blank -- may be useful
  333.                 for batch files.  The same action can be accomplished
  334.                 directly from the keyboard by using the user-selected
  335.                 hot key (Alt-0 by default).  Note that this command
  336.                 forces VGAsave to be enabled otherwise there would be
  337.                 no means to restore the screen if VGAsave was disabled.
  338.  
  339.          /unblank  Forces the screen to immediately if it is blank.  If
  340.                    the screen is not blanked, the only effect this command
  341.                    will have is to set VGAsave's internal time count to
  342.                    zero.  This switch is intended for use in batch files.
  343.                    It makes no sense to type it in from the command line
  344.                    since the first key you hit to type in the command will 
  345.                    cause the screen to wake up.
  346.  
  347.                    Take the follow example for a batch file:
  348.  
  349.                             @echo off
  350.  
  351.                             rem this is optional
  352.                             vgasave /now
  353.  
  354.                             rem Now run some program(s) that
  355.                             rem take(s) a long time to complete
  356.                             slowpgm.exe
  357.  
  358.                             vgasave /unblank
  359.  
  360.                    If you are running DOS 5 or 4DOS, a similar thing
  361.                    can be accomplished from the command line using the
  362.                    command line separator (ctrl-T in DOS 5).
  363.                    Example:
  364.  
  365.                    C:>slowpgm.exe<ctrl-T>VGAsave /unblank
  366.  
  367.                    Note:  In the above line, <ctrl-T> means hold
  368.                           down the control key and hit the T key.
  369.                           This will produce a pilcrow character on the
  370.                           screen.
  371.  
  372.          /m-    Disables mouse intercept -- can be used to disable the
  373.                 screen restoring on mouse action feature.  This command
  374.                 line switch may be used when starting VGAsave.  (Only
  375.                 useful if you have a mouse.)
  376.  
  377.                 If you do use this command on start up, it has the overall
  378.                 effect of starting VGAsave and then issuing VGAsave /m- after
  379.                 VGAsave has been started.  Hence, the same behavior can be
  380.                 expected from VGAsave if you were to do the following:
  381.  
  382.                     C:>VGAsave       (load VGAsave into memory)
  383.                     C:>VGAsave /m-   (turn off mouse intercept)
  384.  
  385.  
  386.                 So, if VGAsave is giving an error related to the mouse
  387.                 when its initially loaded into memory, using the /m- switch
  388.                 on start up will not cause VGAsave to quit reporting the
  389.                 message.  VGAsave will load as usual then if the /m- switch
  390.                 is found, VGAsave will disable the mouse intercept.  The
  391.                 reason it works like this is that if you did load VGAsave
  392.                 with /m- for some reason you could later enable the mouse
  393.                 with /m+ without removing VGAsave from memory and
  394.                 re-installing it.  I'm not sure if I like it this way or
  395.                 not. 
  396.  
  397.          /m+    Enables mouse intercept  -- used to restore the screen
  398.                 restoring feature on a mouse action when it has been
  399.                 disabled with /m-.  (Only useful if you have a mouse.)
  400.  
  401.          /int33 Instructs VGAsave to install an int 33h handler during
  402.                 start up.  The interrupt 33h handler is required by VGAsave
  403.                 if VGAsave fails to unblank the screen with a mouse action
  404.                 after a program has been run or is running that has mouse
  405.                 support.  (Only useful if you have a mouse.)
  406.  
  407.                 THIS COMMAND LINE SWITCH MAY ONLY BE USED DURING START UP.
  408.  
  409.                 Read the section "Mouse Problems" before using this switch.
  410.  
  411.          /mirq: Allows the user to manually specify the IRQ line to be
  412.                 hooked by VGAsave for the mouse intercept.  (Only useful
  413.                 if you have a mouse.)
  414.  
  415.                 THIS COMMAND LINE SWITCH MAY ONLY BE USED DURING START UP.
  416.  
  417.                 THIS COMMAND SHOULD ONLY BE USED IF YOU ARE EXPERIENCING
  418.                 DIFFICULTIES WITH YOUR MOUSE RESTORING A BLANKED SCREEN.
  419.  
  420.                     Syntax:  /mirq:[num]
  421.  
  422.                 Where [num] is the IRQ line that you want VGAsave to
  423.                 hook.  Valid IRQ lines are from 2 to 15.  Read the section
  424.                 below entitled "Mouse Problems" before using this switch.
  425.  
  426.                     Example:  VGAsave /mirq:3
  427.  
  428.                 Tells VGAsave to hook up IRQ 3 which is typically
  429.                 used by COM2.  Hence, you are telling VGAsave that
  430.                 you have a serial mouse that is using IRQ 3.
  431.  
  432.          /key:  This command line switch changes the hot key used to
  433.                 blank the screen on demand.
  434.  
  435.                   Syntax:  /KEY:[key]
  436.                   where [key] is one of the following:
  437.  
  438.                       Alt-0 to Alt-9, Alt-A to Alt-Z
  439.                       None   (disables the hot key)
  440.                       Note that Alt-0 is the default
  441.  
  442.                  For example, to set the hot key to Alt-5, issue
  443.                  "VGAsave /Key:Alt-5" at the DOS prompt.  If the
  444.                  none option is selected (i.e. "VGAsave /Key:none"),
  445.                  then the hot key support to blank the screen will
  446.                  be disabled -- the hot key may be later enabled
  447.                  again by selecting a hot key other than None.
  448.  
  449.                  The /key: command line switch may also be used
  450.                  when VGAsave is initially loaded into memory.
  451.  
  452.                  You can also change the hot key interactively
  453.                  after starting VGAsave by issuing "VGAsave" at
  454.                  the DOS prompt and selecting option "K" from the
  455.                  menu.  This will bring up a menu of possible choices
  456.                  and some instructions.
  457.  
  458.          /S    Displays the current settings of VGAsave.  For example,
  459.                issuing "VGAsave /s" at the DOS prompt after starting
  460.                VGAsave without any command line options displays the
  461.                following information:
  462.  
  463.                     Copyright (c) 1992, 1993  Bill Javurek
  464.                     Freeware.  No Modifications. May not be sold.
  465.  
  466.                     Alt-0 may be used to blank the screen at any time.
  467.  
  468.                     Saver:            Enabled
  469.                     Mouse Intercept:  (Enabled if you have a mouse)
  470.                     Time Out:         120 seconds
  471.                     Hot Key:          Alt-0
  472.  
  473.                 which reflects VGAsave's default settings.
  474.  
  475.          /i?   Returns the status of VGAsave by means of an exit code.
  476.                This option provides a means for batch files to
  477.                obtain the current status of VGAsave and branch with
  478.                an ErrorLevel statement.  This option has no
  479.                interactive (i.e. menu option) equivalent like the other
  480.                command line options do.
  481.  
  482.                The possible exit codes are as follows:
  483.  
  484.                    Exit Code = 1  ==>  VGAsave is not installed
  485.                    Exit Code = 2  ==>  VGAsave is currently disabled
  486.                    Exit Code = 0  ==>  Neither of the above are true  :)
  487.  
  488.                These Exit codes may be used by a batch file in the
  489.                following manner:
  490.  
  491.                    VGAsave /i?
  492.                    If ErrorLevel == 2 Goto VGAsaveDisabled
  493.                    If ErrorLevel == 1 Goto VGAsaveNotInstalled
  494.  
  495.                Note that the ErrorLevel must be tested in "reverse
  496.                order" since DOS checks for greater than or equal to
  497.                when using an If statement in a batch file.
  498.  
  499.                IMPORTANT:  VGAsave will only return a non-zero
  500.                exit code when this command line switch is used.
  501.                In all other cases, the exit code for VGAsave will
  502.                be zero.
  503.  
  504.  
  505.      Notes On Command Line Usage
  506.      ===========================
  507.  
  508.      The "/i?" switch has highest priority.  Using this command will cause
  509.      VGAsave to return its current status and exit the program.  ALL OTHER
  510.      COMMANDS WILL BE IGNORED.
  511.  
  512.      The help command "/?" has second highest priority. Using this command
  513.      will cause VGAsave to display a help message and exit the program.  ALL
  514.      OTHER COMMANDS WILL BE IGNORED.
  515.  
  516.      The remaining commands may be used individually or in groups of
  517.      compatible commands.  The following table shows the INCOMPATIBLE command
  518.      groups.
  519.  
  520.              /r with any thing else  ==>  Can't remove the screen saver and
  521.                                           send commands to the resident code
  522.                                           at the same time.
  523.  
  524.              /off /on      ==>  Can't turn the screen saver on and off
  525.                                 at the same time.
  526.  
  527.              /m+ /m-       ==>  Can't have the mouse intercept enabled
  528.                                 and disabled at the same time.
  529.  
  530.              /off /now     ==>  The screen saver must be enabled to use
  531.                                 the /now switch.  (If the saver is
  532.                                 currently disabled, and the /now switch
  533.                                 is used without the /off switch, VGAsave
  534.                                 will enable itself and blank the screen).
  535.  
  536.      If VGAsave detects an invalid command group, it will ignore the
  537.      conflicting commands and report an error.  If any other valid commands
  538.      were included in the command line, they will be processed.  For example,
  539.      issuing "VGAsave /off /m+ /m-"  will disable VGAsave (/off switch) and
  540.      report an error message for the two conflicting commands (/m+ and /m-).
  541.      VGAsave is also capable of detecting multiple command line conflicts.
  542.      Try "VGAsave /m- /m+ /off /on /now /r".
  543.  
  544.      The command must be proceeded by either a forward slash, /, a back
  545.      slash, \, or a dash, -.  In other words, issuing "VGAsave /r",
  546.      "VGAsave \r", or "VGAsave -r" all have the same effect.  The forward
  547.      slash has been used above for purposes of illustration.  However, the
  548.      back slash or the dash may also be used.
  549.  
  550.      Also note that the command line is not case sensitive, i.e. the
  551.      command /r is identical to /R.
  552.  
  553.      One final point on command line usage, the /mirq and /int33 command
  554.      line switches may only be used when VGAsave is initially loaded into
  555.      memory.
  556.  
  557.  
  558.     Batch File Usage Notes
  559.     ======================
  560.  
  561.     If you call VGAsave in a batch file to disable it or whatever, you
  562.     can hide VGAsave's messages by redirecting its output to the DOS
  563.     NUL device.
  564.  
  565.     Example:   VGAsave /off >nul
  566.  
  567.     You can try the above example at the DOS command prompt for a test.
  568.     Then try VGAsave /on to enable VGAsave and see a message similar to
  569.     the one suppressed by the DOS I/O redirection.
  570.  
  571.  
  572.     Compatibility Issues
  573.     ====================
  574.  
  575.     Some software will not function properly with VGAsave due to the
  576.     manner in which the keyboard and mouse interrupts are used.  For
  577.     example, Microsoft Windows is completely incompatible with VGAsave.
  578.     On the other hand, some software is only partially compatible with
  579.     VGAsave.  In particular, some games capture the keyboard interrupt
  580.     to increase speed, and VGAsave will not be able to detect any
  581.     keystrokes.  Hence, when the screen blanks, it cannot be restored by
  582.     pressing a key -- any key pressed will be processed directly by the
  583.     game.  However, when using VGAsave in conjunction with some games
  584.     the screen may be restored by moving the mouse which can best be
  585.     described as a partial incompatibility.  The only way to find out if
  586.     a problem such as this exists is to try VGAsave.  If a problem does
  587.     exist, use VGAsave /off before starting the incompatible application.
  588.     Then VGAsave /on can be used after running the application.  If this
  589.     is a satisfactory solution a batch file can then be written to launch
  590.     the application which turns VGAsave off before running the program and
  591.     then turns VGAsave back on afterward.
  592.  
  593.     Some users have reported problems with the mouse support.  The
  594.     basic scenario is that everything is fine until an application is
  595.     launched that uses the mouse.  VGAsave then no longer recognizes
  596.     the presence of the mouse.  This topic is discussed in the section
  597.     entitled "Mouse Problems below.
  598.  
  599.     A potential compatibility problem also may exist with some keyboard
  600.     enhancement programs since VGAsave directly manipulates the BIOS keyboard
  601.     buffer.  This issue is discussed under the section entitled
  602.     Technical Info.
  603.  
  604.  
  605.     Note for Microsoft Windows
  606.     ==========================
  607.  
  608.      Since Windows is a multitasking environment, it handles the use
  609.      of software interrupts differently than DOS does, and in enhanced
  610.      mode windows uses a completely different memory addressing scheme.
  611.      Hence, most TSR's will not function properly under Windows.  In
  612.      the case of VGAsave, the screen will blank according to the specified
  613.      time out value.  However, Windows will not allow VGAsave to properly
  614.      detect any mouse motion or keyboard action to restore the screen.  So,
  615.      your stuck with a blank screen that can't restored without somehow
  616.      exiting Windows (which is tough when you can't see what you are doing)
  617.      or rebooting the system.  Therefore, I recommend launching Windows
  618.      from a batch file as follows:
  619.  
  620.                      VGAsave /off > nul
  621.                      Win.com
  622.                      VGAsave /on  > nul
  623.  
  624.      The "> nul" is used to hide VGAsave's messages and may be omitted.
  625.  
  626.      You can make the batch file a little more spiffy by using the /i?
  627.      option as follows:
  628.  
  629.                      VGAsave /i?
  630.                      If ErrorLevel == 2 Goto RunWindows
  631.                      rem  VGAsave is already off
  632.  
  633.                      If ErrorLevel == 1 Goto RunWindows
  634.                      rem  VGAsave not installed
  635.  
  636.                      rem  Get to this point if VGAsave is installed and
  637.                      rem  active
  638.  
  639.                      VGAsave /off  > nul
  640.                      win.com
  641.                      VGAsave /on   > nul
  642.                      Goto End
  643.  
  644.                      :RunWindows
  645.                      win.com
  646.  
  647.                      :End
  648.                      rem  End of batch file
  649.  
  650.  
  651.      This problem is not unique to VGAsave and has occurred with other
  652.      screen savers that I have tried in the past.  This is one of the
  653.      reasons that prompted me to write VGAsave.  At least with VGAsave,
  654.      you can temporarily disable it with /off while using Windows.  Whereas
  655.      with most other screen savers, you are forced to reboot the system
  656.      before running Windows to get the screen saver out of memory since a
  657.      means to disable the screen blanking function is not usually provided.
  658.  
  659.  
  660.      Windows 3.0
  661.      ===========
  662.  
  663.      The rstmouse utility is no longer needed with Windows 3.0 when VGAsave
  664.      1.93 is used.  VGAsave now forces a mouse reset with an int 33h, service
  665.      00h call each time the mouse is enabled or the VGAsave is enabled.
  666.      This was necessary for VGAsave to function properly when started with
  667.      the /int33 switch.
  668.  
  669.  
  670.  
  671.     What if VGAsave doesn't work?
  672.     =============================
  673.  
  674.     If VGAsave is having difficulty recognizing the mouse on your
  675.     system, read the section on Mouse Problems and follow the
  676.     recommendations outlined in that section.  Then if VGAsave is still
  677.     giving you trouble, the discussion here may be of some help.
  678.  
  679.     VGAsave was written in what I consider a robust manner.  But, some
  680.     problems still could arise.
  681.  
  682.     First, if you are experiencing problems and you are loading VGAsave
  683.     high, try loading it into base memory.  I've had some bad experiences
  684.     loading TSR's high which I don't really want to recall.  So, this could
  685.     be a problem.  If VGAsave works fine in base memory but malfunctions
  686.     when loaded high, the only thing that can be done is to rearrange
  687.     the order in which you load all your TSR's in the autoexec.bat.  My
  688.     understanding here is that you can run into problems loading TSR's
  689.     high since the UMB's are non-contiguous and fixed in size.
  690.  
  691.     If you are loading VGAsave in base memory and still having trouble, the
  692.     next logical step is to boot the system off of a floppy loading just
  693.     command.com, the mouse driver (if you have a mouse) and VGAsave.  If the
  694.     problem goes away then VGAsave is conflicting with another TSR that
  695.     you are using.  I can't stress this point enough.  If you are having
  696.     problems, remove all unnecessary TSR's and device drivers before you
  697.     determine that you have found a bug in VGAsave.  Now if VGAsave works
  698.     when it is the only thing loaded besides command.com and the mouse
  699.     driver, try restoring your config.sys and rebooting.  If all everything
  700.     is still fine at this point, start adding your TSR's back into your
  701.     autoexec.bat one by one rebooting after adding each one.  Eventually,
  702.     you should come to a point where VGAsave malfunctions.  Then you know
  703.     which TSR VGAsave is conflicting with.  Once you have reached that
  704.     point try loading VGAsave before and after the conflicting TSR, and you
  705.     should find that either loading VGAsave before or after makes both
  706.     VGAsave and the other TSR happy.  If not, then you have to make a choice
  707.     about which TSR you'd rather have.
  708.  
  709.     The problem here is not necessarily VGAsave or the other TSR.  It boils
  710.     down to the many different approaches used to write TSRs some are better
  711.     than others.  When I wrote VGAsave, as I mentioned, I did quite a bit of
  712.     research on the topic and tried to pick the most reliable configuration.
  713.     Unfortunately, TSR development is something not very well documented.
  714.     Hence, over the years, programmers have developed many different
  715.     approaches.  Thus, you may have to juggle the order in which you load
  716.     everything to make all your TSR's happy.
  717.  
  718.     Another possible situation that could arises is that all is well until
  719.     you add VGAsave to your autoexec.bat then some other TSR refuses to load.
  720.     In this case what is happening is that VGAsave is using the other TSR's
  721.     int 2fh or multiplex signature.  This is possible since when you first
  722.     load VGAsave into memory it will search for the first unused int 2fh
  723.     signature as explained in the section on Interrupt Usage below and use
  724.     it.  If this happens to be the signature of another TSR, that one may
  725.     refuse to load or corrupt VGAsave if the "other" TSR uses int 2fh,
  726.     service 00 in a nonstandard way.  In that case, the solution is
  727.     to load VGAsave at a different point in your autoexec.bat.  If you are
  728.     loading VGAsave first in your autoexec.bat, try loading it last and
  729.     vice versa.  TSR's are strange animals.  So, you may have to play around
  730.     a little bit to make all your TSR's function correctly.
  731.  
  732.     Another possibility is that VGAsave is not compatible with some application
  733.     that you have.  In that case, the best that can be done is to launch that
  734.     particular application from a batch file similar to the one described
  735.     above for windows.  In particular, games could pose a problem since
  736.     they may directly process the mouse and keyboard interrupts and directly
  737.     access the graphics card.
  738.  
  739.     Mouse Problems
  740.     ==============
  741.  
  742.     Several users have reported problems with VGAsave 1.91 recognizing the
  743.     mouse on their systems.  These problems fall into 2 categories.
  744.  
  745.          1.  The interrupt chain is corrupted by the mouse driver forcing
  746.              the mouse IRQ to point directly to the mouse driver with out
  747.              preserving the interrupt chain.  (The mouse IRQ hook is explained
  748.              below in the section "Mouse Hardware Interrupt", and the interrupt
  749.              chain concept is outlined in "Removing VGAsave from Memory".)
  750.  
  751.          2.  The mouse driver is not reporting or is incorrectly reporting
  752.              the IRQ line that the mouse is using.
  753.  
  754.     Try and bare with me while I attempt to explain all of this.  This mouse
  755.     issue is somewhat complicated.  After outlining the problems in detail,
  756.     the actions will be discussed.  So, here we go.
  757.  
  758.     Problem #1:  Interrupt chain corruption.
  759.     ----------------------------------------
  760.  
  761.     Interrupt chain corruption was first observed when running the dosshell
  762.     with VGAsave.  The symptoms are that VGAsave works fine until the dosshell
  763.     is launched then VGAsave fails to recognize the mouse even after the shell
  764.     has been exited.  The root cause of the problem has been traced to the
  765.     mouse driver.  In essence, what happens is that the dosshell makes a call
  766.     to the mouse driver via int 33h, and the mouse driver for whatever reason
  767.     forces the mouse IRQ to point directly to the mouse driver while it is
  768.     processing the int 33h call.  The mouse driver's interrupt handler for
  769.     the mouse IRQ terminates in an iret.  Hence, the interrupt chain is not
  770.     preserved, and all mouse actions become "invisible" to VGAsave.
  771.  
  772.     Thus, if VGAsave is unblanking the screen with mouse actions as it is
  773.     supposed to then quits recognizing the mouse after some application is
  774.     started.  Most likely the interrupt chain has become corrupted in the
  775.     manner described above.  Note again that the cause is the *mouse driver*.
  776.     So, the problem is application independent and depends only on the mouse
  777.     driver.
  778.  
  779.     The solution to this problem implemented was to add an int 33h hook
  780.     to VGAsave.   By default the int 33 handler is not installed to conserve
  781.     memory.  To use the int 33 handler start VGAsave with the /int33 switch.
  782.     When VGAsave is started in this manner, every call made to int 33h will
  783.     cause VGAsave to check the mouse IRQ.  Since the mouse driver corrupts
  784.     the interrupt chain as part of the int 33h service, VGAsave first calls
  785.     the mouse driver int 33h handler as a subroutine to process the interrupt
  786.     call.  Then VGAsave will check to see if the mouse IRQ is still pointing
  787.     to VGAsave.  If the IRQ is not pointing to VGAsave, VGAsave checks to see
  788.     if it is pointing at the mouse driver.  If the IRQ vector is pointing to
  789.     the mouse driver, VGAsave forces it to point back to VGAsave which is the
  790.     state that the mouse IRQ interrupt chain was in before the mouse driver
  791.     redirected the vector (the int table points to VGAsave, VGAsave points to
  792.     the mouse driver).  Strictly speaking, checking to see if the mouse IRQ is
  793.     pointing to the mouse driver if it is not pointing to VGAsave is not
  794.     necessary, but it is an insurance policy.
  795.  
  796.     The reason for the "insurance policy"  is that an assumption has been
  797.     made that VGAsave and the mouse driver are the only programs hooked to
  798.     the mouse IRQ vector. This assumption is reasonable since if some
  799.     other peripheral was to use the same IRQ vector as the mouse a conflict
  800.     probably would arise.  But, its difficult  if not impossible to depend
  801.     on that.  Hence, if for some reason another TSR/device driver takes
  802.     control of the mouse IRQ VGAsave will not change the IRQ vector as a
  803.     means of insuring system integrity.  The reason for this is that the
  804.     fundamental assumption that the int 33h hook was designed around has been
  805.     violated, and the state of the system is unknown at this point.  This case
  806.     *should* never occur.  But, if it did and a check (i.e. insurance policy)
  807.     was not implemented, VGAsave would update the interrupt table, and a system
  808.     crash becomes possible.  However, even if some weird case would occur that
  809.     would violate the fundamental assumption, the mouse will only be
  810.     temporarily be invisible to VGAsave since sooner or later the mouse driver
  811.     will force the IRQ vector to point back to the mouse driver.  Then on the
  812.     next int 33h call, VGAsave will point the mouse IRQ back to VGAsave.
  813.  
  814.     The other assumption buried in this is that VGAsave is loaded in memory
  815.     after the mouse.  This is true by default since during start up VGAsave
  816.     will not detect the presence of the mouse if VGAsave is loaded in memory
  817.     before the mouse driver.
  818.  
  819.     It should be clear at this point that installing the int 33h hook will
  820.     not influence VGAsave if the int 33h hook is not required.  The
  821.     reason that I have made this optional is that the int 33h hook will
  822.     increase the resident memory requirement of VGAsave to 448 bytes.
  823.     Granted, its a trivial increase, but why spend memory if its not required.
  824.  
  825.  
  826.     Problem 2:  Mouse Driver fails to report the IRQ line.
  827.     ------------------------------------------------------
  828.  
  829.     First, lets discuss how VGAsave uses the mouse driver during start up.
  830.  
  831.     When VGAsave is run for the first time, an int 33h, function 00h is
  832.     called to detect the presence of the mouse.  If a mouse is
  833.     detected, VGAsave then calls int 33h, function 36d to get the IRQ line
  834.     used by the mouse.  Several things can go wrong when function 36 is
  835.     called.
  836.  
  837.     The most common problem is that the mouse driver is old and
  838.     function 36 is not supported.  If VGAsave detects that this function
  839.     is not supported the following error will be reported:
  840.  
  841.        "Mouse function 36 not supported by the current mouse driver."
  842.  
  843.     It is possible that VGAsave does not detect that this function is
  844.     unsupported by the current mouse driver or that the mouse driver
  845.     is reporting nonstandard data.  If this is the case, VGAsave will
  846.     load up and act like everything is fine, but you won't be able to
  847.     unblank the screen with the mouse.
  848.  
  849.     Basically, there are two things you can do at this point, if either
  850.     one of these conditions are true:  get a new mouse driver or use the
  851.     /mirq command line switch.
  852.  
  853.  
  854.     The /mirq switch
  855.     ----------------
  856.  
  857.     As noted above, this switch allows the user to manually supply
  858.     the IRQ line that VGAsave will hook for the mouse interrupt.
  859.     This switch may only be used when VGAsave is initially loaded
  860.     into memory and will force VGAsave to skip the int 33h, function
  861.     36d call.  You are completely on your own here and you
  862.     have to find out what IRQ your mouse is using before this switch
  863.     may be used.
  864.  
  865.     If you are lucky, your mouse driver reports the IRQ usage when
  866.     the driver is loaded into memory.  So, all that you may have to
  867.     do is strip down your autoexec.bat and config.sys files so that
  868.     any messages the mouse driver prints when loading won't scroll
  869.     off the screen.  Another possibility is to check the documentation
  870.     that came with the mouse.
  871.  
  872.     If neither of these approaches work, you need to get a "bigger hammer".
  873.     The big hammer in this case would be some kind of memory mapping software
  874.     that will show you the interrupt usage.  Norton Utilities 6.01 has
  875.     a sysinfo program that will report IRQ usage, one user noted that
  876.     QEMM's manifest will report interrupt usage, the turbo assembler
  877.     comes with tdmem that reports software interrupt usage.  I assume that
  878.     PC Tools has something that will work too.  If you don't have access
  879.     to any of the mentioned tools or something similar, there are several
  880.     memory mapping programs at simtel that could probably be used for this
  881.     purpose.  If you need to download a memory mapper from simtel, try
  882.     in the msdos/sysutl and msdos/info directories.  Another possibility
  883.     is to check into some PC Magazine utilities.
  884.  
  885.     As explained in the "Mouse Hardware Interrupt" section below,
  886.     when an IRQ occurs the current program is suspended and the CPU
  887.     executes an int instruction to service the IRQ request.  The int
  888.     that the CPU issues does *NOT* have the same number as the IRQ since
  889.     IRQ refers to Interrupt Request and it is a hardware concept.  The
  890.     correspondence is as follows:  (Note h ==> hex and d ==> decimal number.)
  891.  
  892.          IRQ   ==>    software int             *Typical* Usage
  893.          ---          ------------             ---------------
  894.  
  895.         IRQ 00 ==> int 08h (int 08d)            Timer
  896.         IRQ 01 ==> int 09h (int 09d)            Keyboard
  897.         IRQ 02 ==> int 0ah (int 10d)            Slave PIC
  898.         IRQ 03 ==> int 0bh (int 11d)            COM 2
  899.         IRQ 04 ==> int 0ch (int 12d)            COM 1
  900.         IRQ 05 ==> int 0dh (int 13d)            LPT 2
  901.         IRQ 06 ==> int 0eh (int 14d)            Floppy disks
  902.         IRQ 07 ==> int 0fh (int 15d)            LPT 1
  903.  
  904.         IRQ 08 ==> int 70h (int 112d)           Real time clock
  905.         IRQ 09 ==> int 71h (int 113d)           IRQ 2 redirect
  906.         IRQ 10 ==> int 72h (int 114d)           ?
  907.         IRQ 11 ==> int 73h (int 115d)           ?
  908.         IRQ 12 ==> int 74h (int 116d)           Mouse on PS/2 50+
  909.         IRQ 13 ==> int 75h (int 117d)           Math Coprocessor
  910.         IRQ 14 ==> int 76h (int 118d)           Hard disk
  911.         IRQ 15 ==> int 77h (int 119d)           ?
  912.  
  913.  
  914.     Unless the software specifically indicates that it is reporting
  915.     hardware interrupts or IRQ lines, it is probably telling you the
  916.     software interrupt.  Most likely, the memory mapping software
  917.     will report the software interrupt in hexadecimal notation.  Also,
  918.     noted above is "typical" usage for the IRQ lines in a PC.  From
  919.     the research that I have done, the usage seems to vary.  So, its
  920.     difficult to say exactly what is going on.  IRQ 00 and IRQ 01 are
  921.     used as stated above as a standard, and the same appears to hold
  922.     true for IRQ 3 (COM 2) and IRQ 4 (COM 1).  But, for some of the
  923.     other IRQ lines the usage seems to be depended upon which book
  924.     you read.
  925.  
  926.     So, what we gain from the table above is that if you have a
  927.     serial mouse on COM 2 most likely the IRQ line that it is using
  928.     is #3.  Likewise, if your mouse is on COM 1, it is probably using
  929.     IRQ 4.  Microsoft bus mice usually use IRQ 5, and some IBM PS/2's use
  930.     IRQ 12 for the mouse.
  931.  
  932.     Now that you are armed with some memory mapping software and have
  933.     an approximate idea of the IRQ usage on the PC, you can now try
  934.     to determine which IRQ the mouse is using.  It would be best to
  935.     boot up the system loading only DOS and the mouse driver before
  936.     you start hunting for the mouse IRQ.  Rebooting the system is an
  937.     important to step since it will strip out all the unnecessary TSR's
  938.     and device drivers.  Failure to do this may result in an unclear
  939.     picture of the interrupts that the mouse driver is using since another
  940.     TSR or device driver may be using some of the interrupts used by the
  941.     mouse driver.  When two TSR's use the same interrupt, the memory
  942.     mapping software will report that the interrupt is pointing to the
  943.     last TSR in memory that uses it.
  944.  
  945.     It sounds complicated, but essentially all that is required to find
  946.     out which interrupt vectors are pointing to the mouse driver and used
  947.     the table above to determine which IRQ line is used by the mouse.
  948.     The memory mapping software should report an IRQ vector between
  949.     2 and 15 from the table above pointing to your mouse driver along
  950.     with int 33h, probably int 08 (IRQ 00), possibly int 09h (IRQ 01), and
  951.     maybe a few others.  The interrupts used by the mouse driver depend
  952.     upon the mouse.  So, its impossible to state which interrupts will
  953.     be used.
  954.  
  955.     Again note that a memory mapper will probably show the software
  956.     interrupts pointing to the mouse driver.  So, you'll have to use the
  957.     table above to determine the IRQ line that you want to use with VGAsave.
  958.  
  959.     For an example, the interrupt usage on my system when booting up
  960.     with just command.com and the mouse driver is as follows:
  961.  
  962.      PSP  bytes  owner    command line      hooked vectors
  963.     ----- -----  -------- ----------------  ---------------
  964.     0008  10816  config
  965.     0DFD  4704   command                    22 24 2E DB E5 E8
  966.     0F29  16896  N/A       N/A              08 0D 10 2F 33
  967.     134A  576352 free
  968.  
  969.     The "PSP" field shows where in memory the "owner" located.  The "bytes"
  970.     field is the size of the program, and the "hooked vectors" is what we
  971.     are interested in.  The first entry, config, is what is used by
  972.     DOS to set up its default drivers, COM, LPT, etc...  So, we ignore
  973.     that.  The next entry, command, is the kernel of command.com.  Then
  974.     finally we come to the "N/A" entry which is the mouse driver.  How do
  975.     I know its the mouse driver -- because I booted the system and loaded
  976.     only command.com and the mouse driver.  So, there is no doubt that it
  977.     is the mouse driver.  The reason that you don't see the program name,
  978.     mouse.com, is that the mouse driver frees its environment block when
  979.     loading to conserve memory.  VGAsave does the same thing.
  980.  
  981.     Now, consider the "hooked vector" field for the mouse driver.  It shows
  982.     the following:
  983.  
  984.         int 08h  ==>  System Clock (IRQ 00)
  985.         int 0dh  ==>  This is the Mouse IRQ (IRQ 5)
  986.         int 10h  ==>  Video services
  987.         int 2fh  ==>  Multiplex interrupt
  988.         int 33h  ==>  Mouse services
  989.  
  990.  
  991.     Since int 0dh indicates IRQ 5 and it falls in the range of 2 to 15,
  992.     that is the interrupt that VGAsave will use for the mouse intercept.
  993.     Don't confuse this with int 33h.  Int 33h is used at the software level.
  994.     For example, a program that needs to know the location of the mouse
  995.     pointer when you click the mouse would make an int 33h call.
  996.  
  997.     Once the mouse IRQ has been determined, you are ready to use the
  998.     /mirq switch with VGAsave.
  999.  
  1000.  
  1001.     /mirq switch usage
  1002.     ------------------
  1003.  
  1004.     IMPORTANT!!!
  1005.       No warranty is written or implied with VGAsave especially
  1006.       with the usage of the /mirq switch.  You are accessing the
  1007.       system on a very low level at this point.  Failure to use
  1008.       this switch properly may result in a serious system crash.
  1009.       BE CAREFUL!!!  If this bothers you, abort the process now
  1010.       and contact somebody that has experience in these matters or
  1011.       contact the manufacturer of your mouse for an updated driver.
  1012.  
  1013.  
  1014.  
  1015.     To manually specify the IRQ that VGAsave is to use for the mouse
  1016.     the /mirq switch can be used at start up.  Note that the /mirq switch
  1017.     can only be used when VGAsave is initially loaded into memory.  You cannot
  1018.     change the IRQ number without first removing VGAsave from memory.
  1019.  
  1020.     Syntax:
  1021.  
  1022.         VGAsave /mirq:[IRQ_num]
  1023.  
  1024.     Where IRQ_num ranges from 2 to 15.
  1025.  
  1026.     Note that IRQ 0 and IRQ 1 are not valid here since it makes no sense
  1027.     to hook either with the /mirq switch.  Recall that IRQ 0 is the system
  1028.     clock.  Hence, if VGAsave was launched with /mirq:00, the screen would
  1029.     never blank if the mouse was enabled since 18.2 times a second VGAsave's
  1030.     internal time count would be set to zero.  In other words, VGAsave will
  1031.     behave as if you were constantly moving the mouse.  IRQ 1 is invalid
  1032.     since hooking this interrupt is redundant.  IRQ 1 is already used by
  1033.     VGAsave to detect keyboard action and to implement the hot key.
  1034.  
  1035.     For the example above with my bus mouse, it was determined from the
  1036.     memory map that the mouse uses IRQ 5.  Hence, the proper syntax would be
  1037.  
  1038.         VGAsave /mirq:5
  1039.  
  1040.     This will bypass the autodetection of the mouse IRQ in VGAsave and set
  1041.     the IRQ to #5 for the mouse.  If you were now to reboot the system
  1042.     loading just command.com, the mouse driver, and VGAsave /mirq:5, you
  1043.     would see int 0dh pointing to VGAsave and not the mouse driver.  This
  1044.     concept is explained below in the section "Removing VGAsave from Memory".
  1045.     In a nutshell, int 0dh points at VGAsave and VGAsave points at the mouse
  1046.     driver.
  1047.  
  1048.     For another example, if you determined that your mouse is using
  1049.     IRQ 2, the proper syntax would be:
  1050.  
  1051.         VGAsave /mirq:2
  1052.  
  1053.  
  1054.     What VGAsave Does with the Mouse IRQ or what if you use the wrong IRQ?
  1055.     ----------------------------------------------------------------------
  1056.  
  1057.     In flow chart form, the mouse intercept in VGAsave works as follows:
  1058.  
  1059.  
  1060.            +------------+
  1061.         no | Is Mouse   |
  1062.      +-----| Enabled?   |
  1063.      |     +------------+
  1064.      |           |
  1065.      |           | yes
  1066.      |          \|/
  1067.      |     +------------+       +------------------+
  1068.      |     | Is VGAsave | yes   | Set the internal |
  1069.      |     | enabled?   |-----> | time count to 0  |
  1070.      |     +------------+       +------------------+
  1071.      |       |                           |
  1072.      |       | no                        |
  1073.      |       |                          \|/
  1074.      |       |           no     +------------------+
  1075.      |       |     +------------| Is screen blank? |
  1076.      |       |     |            +------------------+
  1077.      |       |     |                     |
  1078.      |       |     |                     |  yes
  1079.      |       |     |                     |
  1080.      |       |     |                    \|/
  1081.      |       |     |            +------------------+
  1082.      |       |     |    +-------|  Unblank screen  |
  1083.      |       |     |    |       +------------------+
  1084.     \|/     \|/   \|/  \|/
  1085.   +-----------------------+
  1086.   |  jmp to original IRQ  |
  1087.   +-----------------------+
  1088.  
  1089.  
  1090.     So, basically 3 steps:
  1091.  
  1092.         1.  Is Mouse enabled?
  1093.             A.  If not absolutely nothing happens.  VGAsave passes control
  1094.                 to the original IRQ vector which points to the mouse driver.
  1095.             B.  If true, VGAsave checks to see if the screen saver is
  1096.                 enabled.
  1097.  
  1098.         2.  Is VGAsave enabled?
  1099.             A.  If not, nothing happens again.  VGAsave passes control
  1100.                 to the original IRQ vector.
  1101.             B.  If true, VGAsave sets its internal time count to 0 which
  1102.                 involves moving a zero into the resident data segment.
  1103.  
  1104.         3.  Is the screen blank?
  1105.             A.  If not, nothing more happens.  VGAsave hands control
  1106.                 over to the original IRQ vector.
  1107.             B.  If true, VGAsave unblanks the screen.  This is done
  1108.                 by directly sending the command out to the VGA card
  1109.                 with "in" and "out" instructions.
  1110.  
  1111.  
  1112.     Thus, if you hook VGAsave to the wrong IRQ by mistake, your system
  1113.     integrity should not be corrupted.  Most likely what will happen is that
  1114.     VGAsave will act a bit strange.  One possibility is that VGAsave will
  1115.     unblanking the screen without the user hitting a key or moving the mouse.
  1116.     The other is that VGAsave will refuse to blank the screen since its
  1117.     internal time count is getting set to zero.  Both symptoms could appear
  1118.     "randomly" depending upon which IRQ you link VGAsave too.
  1119.  
  1120.     Just as a test, I hooked my copy of VGAsave to IRQ 6 (Floppy disk) using
  1121.     /mirq:6.  No, the system didn't crash when I did a dir on a:.  But, what
  1122.     did happen is that accessing the floppy caused the screen to unblank
  1123.     which could be demonstrated with the following test:
  1124.  
  1125.        C:>vgasave /now<ctrl-T>dir a:
  1126.  
  1127.     If your not using DOS 5 and cannot use the ctrl-T command line
  1128.     separator, a batch file can be used.  Since it survived a dir command,
  1129.     the "acid test" sort to speak was to copy a file from the hard disk
  1130.     to the floppy and read it back.  So, I do the following:
  1131.  
  1132.        C:>vgasave /now<ctrl-T>copy vgasave.asm a:
  1133.  
  1134.     The result was that the screen was unblanked during the file copy
  1135.     since I was hooked to IRQ 6 and that the file copied fine.
  1136.  
  1137.     So, if you get confused and give VGAsave the wrong IRQ, everything should
  1138.     be okay.  But, I am *NOT* guaranteeing it.  IRQ usage is system
  1139.     dependent.  Hooking the COM port which has the modem on my system may not
  1140.     cause a crash, but it could on yours.  So, be careful.  Based on the
  1141.     analysis of what VGAsave does when it gets the mouse IRQ, everything
  1142.     should be safe.  But, its impossible to bank on that.  Again, BE CAREFUL!
  1143.  
  1144.     The best way I think to tell if you have given VGAsave the correct IRQ
  1145.     number with the /mirq switch is to start VGAsave with the IRQ number
  1146.     desired then hit the hot key to blank the screen.  Now nudge the mouse if
  1147.     the screen unblanks, all is well.
  1148.  
  1149.     Now if you are curious, here is what the memory map of my system looks
  1150.     like loading just command.com the mouse driver (mouse.com) and
  1151.     VGAsave /mirq:5.  Note that the memory map shown below would be the same
  1152.     if I did not use /mirq:5 on start up since VGAsave properly detects the
  1153.     IRQ that my mouse is using.  Thus, in my situation, starting VGAsave
  1154.     with /mirq:5 makes no difference whatsoever.
  1155.  
  1156.  
  1157.      PSP  bytes owner    command line     hooked vectors
  1158.     ----- ----- -------- ---------------  -------------------
  1159.     0008  10816 config
  1160.     0DFD   4704 command                   22 24 2E DB E5 E8
  1161.     0F29  16896 N/A       N/A             08 33
  1162.     134A    352 N/A       N/A             09 0D 10 1C 2F
  1163.     1361  575984 free
  1164.  
  1165.     Note that VGAsave is the "352 N/A" line in the memory map and that
  1166.     int 0dh (IRQ 5) is pointing to VGAsave.
  1167.  
  1168.     Determining which mouse switch to use
  1169.     -------------------------------------
  1170.  
  1171.     1.  If VGAsave is in your autoexec.bat, use a rem statement so
  1172.         that VGAsave will not be loaded during boot up.
  1173.  
  1174.     2.  Reboot the system.
  1175.  
  1176.     3.  Start VGAsave from the command line.
  1177.  
  1178.     4.  If VGAsave reports that function 36 is not supported by the currnet
  1179.         mouse driver, the /mirq switch is required.  If this is the case,
  1180.         abort the test and determine which IRQ your mouse is using.  Then
  1181.         goto step 12.
  1182.  
  1183.     5.  Use the hot key or issue VGASave /now to blank the screen.
  1184.  
  1185.     6.  Move the mouse.
  1186.  
  1187.     7.  If the screen does *not* come back on, the /mirq switch is required
  1188.         even if VGAsave does not report that mouse function 36 is not
  1189.         supported .  If this is true, abort the test at this point and
  1190.         determine which IRQ line your mouse is using.  Then goto step 12.
  1191.  
  1192.     8.  Start some application that uses the mouse, such as the dosshell.
  1193.  
  1194.     9.  Use the hot key to blank the screen.
  1195.  
  1196.    10.  Move the mouse.  If the screen does not come back on, the /int33
  1197.         switch is required.  
  1198.  
  1199.    11.  If the screen is restored in step 10, exit the application and try
  1200.         step 10 again.  The situation with mouse driver is not 100 % clear
  1201.         since its impossible to predict the behavior of each and every mouse
  1202.         drive.  So, you may have to try several applications repeating steps
  1203.         10 and 11 before VGAsave will not recognize the mouse.
  1204.  
  1205.    12.  Note:  You should be using the /mirq switch if you get to this point.
  1206.         A.  Reboot the system.
  1207.         B.  Start VGAsave with the appropriate /mirq switch.
  1208.         C.  Do step 5 and step 6.  The screen should come back on when you
  1209.             move the mouse.  If it doesn't then you have the wrong IRQ for
  1210.             your mouse.
  1211.         D.  Do steps 8, 9, 10, and 11 above.
  1212.         E.  If the screen does not come back on in step 10 and/or 11, you 
  1213.             need to use the /int33 switch along with the /mirq switch when 
  1214.             starting VGAsave.
  1215.         F.  Add the appropriate command line switches to VGAsave in your
  1216.             autoexec.bat, remove the rem statement, and reboot.
  1217.  
  1218.  
  1219.     Mouse switch summary
  1220.     ====================
  1221.  
  1222.     /int33
  1223.         This switch may only be used during start up and directs VGAsave to
  1224.         install the interrupt 33h hook.  Should not be used unless necessary
  1225.         since this switch will increase the resident memory requirement of
  1226.         VGAsave to 448 bytes.  However, if memory usage is not an issue, this
  1227.         command may be used unconditionally.
  1228.  
  1229.     /mirq:[irq_num]  where  [irq_num] = 2 to 15
  1230.         Manual override for the mouse IRQ line.  This command bypasses the
  1231.         autodetection of the mouse IRQ line that VGAsave uses during start up.
  1232.         Does not increase the resident memory requirement of VGAsave, and may
  1233.         be used unconditionally when given the correct IRQ number.
  1234.  
  1235.     Removing VGAsave from Memory
  1236.     ============================
  1237.  
  1238.     VGAsave can be removed from memory with the /r command line switch
  1239.     or by selecting the "R" option from the interactive menu.  Note that
  1240.     VGAsave or any TSR for that matter can only be removed from memory if
  1241.     all the captured interrupts are currently pointing at it.  This usually
  1242.     means that it has to be loaded last.  If the TSR is not loaded last,
  1243.     then it is possible that it cannot be removed from memory.  VGAsave will
  1244.     detect this condition and refuse to remove itself from memory if all
  1245.     hooked interrupts are not currently pointing to the resident code.  In
  1246.     this case the only way to remove VGAsave from memory is to reboot the
  1247.     system.  However, keep in mind that VGAsave can always be disabled via
  1248.     the /off switch if it cannot be removed from memory.
  1249.  
  1250.     The reason for this is that when a TSR is removed from memory all the
  1251.     hooked interrupts must be restored to their original state for the
  1252.     pc to continue to function properly.  If one of the hooked interrupts
  1253.     no longer points to the TSR's resident code, then the TSR has no means
  1254.     to restore the proper vector to the interrupt table.  Consider the
  1255.     following to illustrate the point:
  1256.  
  1257.     Before Loading VGAsave            After loading VGAsave
  1258.  
  1259.         +-----------+                  +------------+
  1260.         |   TSR 1   |                  |    TSR 1   |
  1261.         +-----------+                  +------------+
  1262.              /|\                             /|\
  1263.               |                               |
  1264.               | Int X                         |  Int X
  1265.               |                               |
  1266.         +-----------+                   +-----------+
  1267.         | Int Table |                   |  VGAsave  |
  1268.         +-----------+                   +-----------+
  1269.                                              /|\
  1270.                                               |
  1271.                                               |  Int X
  1272.                                               |
  1273.                                         +-----------+
  1274.                                         | Int Table |
  1275.                                         +-----------+
  1276.  
  1277.  
  1278.     Before loading VGAsave assume that some TSR, TSR 1, is loaded in memory
  1279.     and has some interrupt (call it Int X) pointing at TSR 1 that is
  1280.     used by VGAsave.  In this case, the interrupt vector points directly
  1281.     to TSR 1 as shown above on the left.  When VGAsave is loaded,
  1282.     VGAsave make a copy of the int X vector and saves it as resident data.
  1283.     VGAsave then updates the interrupt table via an int 21h call
  1284.     so that int X points to VGAsave.  Hence, the interrupt table points to
  1285.     VGAsave, and VGAsave points to TSR 1 to form a chain as shown above on
  1286.     the right.  Thus, whenever int X is issued, control is passed to VGAsave,
  1287.     and VGAsave passes control to TSR 1.  When VGAsave is removed from
  1288.     memory, int X is restored back to its original vector using the
  1289.     data stored within VGAsave's resident data block to update the interrupt
  1290.     table via an int 21h call.  This operation then restores the PC back
  1291.     to its original state before VGAsave was loaded (figure on the left).
  1292.  
  1293.     Now consider the case when another TSR, TSR 2, is loaded after VGAsave
  1294.     as shown below.
  1295.  
  1296.                         +-----------+
  1297.                         |   TSR 1   |
  1298.                         +-----------+
  1299.                              /|\
  1300.                               |
  1301.                               |  Int X
  1302.                               |
  1303.                         +-----------+
  1304.                         |  VGAsave  |
  1305.                         +-----------+
  1306.                              /|\
  1307.                               |
  1308.                               |  Int X
  1309.                               |
  1310.                         +-----------+
  1311.                         |   TSR 2   |
  1312.                         +-----------+
  1313.                              /|\
  1314.                               |
  1315.                               |  Int X
  1316.                               |
  1317.                         +-----------+
  1318.                         | Int Table |
  1319.                         +-----------+
  1320.  
  1321.  
  1322.     In this case, the interrupt table points to TSR 2, TSR 2 points to
  1323.     VGAsave, and VGAsave points to TSR 1.  Hence, when int X is issued,
  1324.     control is passed to TSR 2, TSR 2 passes control to VGAsave, and
  1325.     VGAsave passes control to TSR 1.  If VGAsave were to be removed from
  1326.     memory under these conditions, the interrupt chain would become corrupted
  1327.     as shown below.
  1328.  
  1329.  
  1330.                               +-----------+
  1331.                               |   TSR 1   |
  1332.                               +-----------+
  1333.                                    /|\
  1334.                                     |
  1335.                                     +---------------+
  1336.        +--------+                                   |
  1337.        |  Free  |             +-----------+         |
  1338.        | Memory |<----------- |   TSR 2   |         |   int X
  1339.        +--------+             +-----------+         |
  1340.                                                     |
  1341.                                     +---------------+
  1342.                                     |
  1343.                               +-----------+
  1344.                               | Int Table |
  1345.                               +-----------+
  1346.  
  1347.  
  1348.     TSR 2 gets completely bypassed since VGAsave points to TSR 1 and that
  1349.     is the interrupt vector that gets restored to the interrupt table when
  1350.     VGAsave is removed from memory.  Thus, TSR 2 will no longer be part of
  1351.     the interrupt chain, and the interrupt vector stored within TSR 2 points
  1352.     to where VGAsave was which is now free memory.
  1353.  
  1354.     Note that in the event that VGAsave is not loaded last and can be
  1355.     remove from memory, beware that a "hole" will remain in DOS memory where
  1356.     VGAsave was residing since DOS cannot "pack" the pc's memory.  This
  1357.     idea gets involved with DOS memory allocation strategy which I'm not
  1358.     very familiar with.   Considering that we're only talking about 352 bytes
  1359.     of memory, this isn't a major concern.
  1360.  
  1361.  
  1362.     Memory Requirements/Loading VGAsave High
  1363.     ========================================
  1364.  
  1365.     The resident memory requirement of the VGAsave is 352 bytes.  Extended
  1366.     or expanded memory is not required.  VGAsave supports DOS 5.0 Upper
  1367.     Memory Blocks (UMB) when the loadhigh command is used.  Personally,
  1368.     I've run into some difficulties with loading TSR's high occasionally.
  1369.     So, if you are loading VGAsave high and its not working properly, try
  1370.     loading it in base memory before you decide that the software is buggy.
  1371.     Since the UMBs are fixed in size, sometimes you have to juggle the
  1372.     order in which you load TSR's to get them all to fit properly.  Don't
  1373.     ask me why.  This has just been my experience.  Keep in mind that all
  1374.     is not lost if you have to load VGAsave in base memory since it only
  1375.     requires 352 bytes of memory.
  1376.  
  1377.  
  1378.     Technical info
  1379.     ==============
  1380.  
  1381.     This section is intended to provide a general feeling for how VGAsave
  1382.     works and covers some of the common questions that I have encountered.
  1383.     It is by no means a complete discussion on TSR design.  One could
  1384.     easily write a book on that topic.
  1385.  
  1386.     VGAsave was written in assembler and employs direct access techniques
  1387.     to keep the size of the resident code small.  In particular, VGAsave
  1388.     directly accesses the VGA card to blank and restore the screen.  Thus,
  1389.     VGAsave WILL ONLY WORK ON VGA SYSTEMS.  The other direct access technique
  1390.     employed is the direct manipulation of the BIOS keyboard buffer area
  1391.     which is described below.
  1392.  
  1393.  
  1394.  
  1395.     Interrupts hooked:
  1396.  
  1397.     (See also the section, "Mouse Problems" above.)
  1398.  
  1399.        int 09h:  Keyboard hardware interrupt
  1400.        =====================================
  1401.  
  1402.        The hot key is implemented by hooking int 09h (kbd hardware int i.e.
  1403.        IRQ 01) and directly manipulating the BIOS keyboard buffer area to
  1404.        avoid making a call to BIOS from within the resident code.  A call
  1405.        to BIOS from within a TSR requires reserving stack space within the
  1406.        resident code for BIOS to use which increases the amount of memory
  1407.        required by the TSR significantly.
  1408.  
  1409.        In essence, what happens here is that every time a key is pressed or
  1410.        released an int 09h is issued by the keyboard so that the PC can
  1411.        detect and process keystrokes.  VGAsave takes advantage of this by
  1412.        hooking this interrupt to keep track of keyboard activity and to
  1413.        implement the hot key feature.
  1414.  
  1415.        Whenever an int 09h occurs, control is passed to VGAsave, and VGAsave
  1416.        makes a copy of the current BIOS keyboard buffer tail (the BIOS
  1417.        keyboard buffer is a circular buffer) and then calls the BIOS ISR
  1418.        (interrupt service routine) for the keyboard (int 09h) as a subroutine.
  1419.        After the BIOS ISR is called, control is returned to VGAsave, and the
  1420.        new keyboard buffer tail is compared to the old one.  If they are
  1421.        different, then a valid BIOS keystroke occurred.  This solves the
  1422.        problem of differentiating between key presses and releases both of
  1423.        which cause int 09h to occur.  If a keystroke is detected, the
  1424.        VGAsave reads the scan code directly from the BIOS keyboard buffer.
  1425.        By reading the scan code directly from the BIOS keyboard buffer, an
  1426.        int 16h call is not required which eliminates the need to reserve
  1427.        stack space within the resident code for the int 16h call.
  1428.  
  1429.        Once VGAsave obtains a keystroke, it is compared to the hot key
  1430.        scan code stored within VGSsave's resident code.  If a match is found,
  1431.        the VGAsave blanks the screen and removes the keystroke from
  1432.        the BIOS keyboard buffer.  If no match is found and the screen is
  1433.        blanked, VGAsave restores the screen, sets its internal time
  1434.        count to zero, and suppresses the keystroke.  The final possibility is
  1435.        that VGAsave does not detect its hotkey and the screen is not blanked.
  1436.        In this case, VGAsave sets its internal time count to zero and does
  1437.        not suppress the keystroke.
  1438.  
  1439.        Removing the keystroke from the BIOS keyboard buffer is accomplished
  1440.        by restoring the keyboard buffer tail back to its value before the
  1441.        BIOS int 09h ISR was invoked.  This is why a valid BIOS keystroke is
  1442.        required to restore a blanked screen, a scan code must be generated by
  1443.        BIOS for VGAsave to detect a keystroke.  If no hot key is selected,
  1444.        the hot key scan code used by VGAsave is set to 00h, and the int 09h
  1445.        ISR inside VGAsave remains active.
  1446.  
  1447.        NOTE:   Due to the direct manipulation of the BIOS keyboard buffer
  1448.                area, an incompatibility may occur between VGAsave and
  1449.                some keyboard buffer extension programs since the extended
  1450.                keyboard buffer is held some other place in memory.  However,
  1451.                extended buffers usually don't start stacking up keystrokes
  1452.                until the default BIOS keyboard buffer is full.  Hence, under
  1453.                normal circumstances, an extended keyboard buffer shouldn't
  1454.                cause any problem.  The problem occurs when the BIOS keyboard
  1455.                buffer spills over into the extended buffer.  In this case, if
  1456.                you try to blank the screen via the hot key, VGAsave has
  1457.                no means to detect or suppress the keystroke since it doesn't
  1458.                know where to look for the keystroke.  This leaves you with an
  1459.                extra alt-0 (or which ever hot key you are using) stuck in the
  1460.                extended keyboard buffer which may or may not be a problem
  1461.                when it is eventually processed by BIOS.  If this extra
  1462.                keystroke is a problem, I have two recommendations both of
  1463.                which accomplish the same thing:
  1464.  
  1465.                    1.  Don't use the hot key to blank the screen if you
  1466.                        have a large number of keystrokes waiting to be
  1467.                        processed.
  1468.                    2.  Disable the hot key support with "VGAsave /key:none"
  1469.                        or selecting "none" from the interactive menu.
  1470.  
  1471.  
  1472.        int 10h:  BIOS Video services
  1473.        =============================
  1474.  
  1475.        Used by VGAsave to keep the screen blanked once the selected
  1476.        time has passed even if a program is running which switches
  1477.        video modes via int 10h, service 00h.  Int 10h, service 00h
  1478.        forces most (if not all) of the registers on a VGA card to
  1479.        become re-initialized when the video mode is changed.  This will
  1480.        cause a blanked screen to be restored.  This causes no harm, but
  1481.        without hooking this interrupt VGAsave will not reblank the screen
  1482.        since it does not have a means to detect that the screen has been
  1483.        been turned back on.  In other words, VGAsave would think that
  1484.        the screen is blank even though it isn't without the int 10h hook.
  1485.        Thus, VGAsave would appear as if it quit working if the video mode
  1486.        is changed while the screen is blanked.  The other side effect that
  1487.        would occur without hooking int 10h is that once the screen comes back
  1488.        on due to a video mode change, the next key that is pressed will be
  1489.        suppressed by VGAsave since VGAsave thinks that the screen was blanked
  1490.        and needs to be restored.  Its a subtle point.  But it can be an
  1491.        irritant if you are running something that switches video modes such
  1492.        as, CAD packages.
  1493.  
  1494.  
  1495.        int 1ch:   User timer tick
  1496.        ==========================
  1497.  
  1498.        Used by VGAsave to keep track of the time that has elapsed since
  1499.        a keystroke or a mouse movement.  Note that this interrupt occurs
  1500.        18.2 times a second.  So if you use VGAsave /s, VGAsave may
  1501.        report a time out that off by a second or two due to round off
  1502.        error.  The reason for this is that the time out value provided
  1503.        by the user gets multiplied by 18.2 before being saved in the
  1504.        resident data block since the user provides a time out in seconds.
  1505.        Then when VGAsave /s is used to retrieve this value from the
  1506.        resident data block, it has to be divided by 18.2 in order for
  1507.        VGAsave to return the value in seconds.  These two operations
  1508.        are preformed by VGAsave using integer arithmetic i.e. the number
  1509.        of seconds are multiplied by 182 then divided by 10 to get system
  1510.        timer ticks and the reverse process is used to get the number of
  1511.        seconds from the number of timer ticks.  Hence, round off error
  1512.        becomes a possibility.
  1513.  
  1514.        int 2fh:   Multiplex Interrupt
  1515.        ==============================
  1516.  
  1517.        VGAsave hooks interrupt 2fh as a means for communication between
  1518.        the resident code and the transient code.  It is this hook which
  1519.        provides VGAsave the ability to change hot key, to remove itself
  1520.        from memory, to perform an installation check, etc.
  1521.  
  1522.        In order to understand how VGAsave handles this, it is necessary
  1523.        to first have a feeling for how an int 2fh hook works.  A TSR
  1524.        is a program which has two parts, a resident part and a transient
  1525.        part.  It is the resident part of the TSR which stays in memory
  1526.        after the program has terminated, and the transient part which takes
  1527.        care of initializing the TSR and communication with the resident
  1528.        portion.  Hence, the next time that the TSR is executed, the transient
  1529.        portion will detect that the TSR is already resident in memory and
  1530.        allow the user to communicate with the resident code.  An int 2fh hook
  1531.        can be used to accomplish this task.  A signature or id byte is assigned
  1532.        to the TSR which is placed in ah before calling int 2fh and al is set
  1533.        to 00h.  Typically, when the resident code finds its signature in ah,
  1534.        it will return ffh in al to denote that it is resident in memory and
  1535.        whatever other information is necessary for the transient part of the
  1536.        code to communicate with it.  So far, so good.  But, a problem arises
  1537.        when two or more TSR's use the same signature.  In that case, one TSR
  1538.        may attempt to communicate with another which will result in disaster
  1539.        since the two programs will be structured differently.
  1540.  
  1541.        VGAsave employs a more sophisticated installation check to avoid this
  1542.        problem.  During start up, VGAsave looks for an unused int 2fh
  1543.        signature starting with 0c0h and ranging to 0ffh.  Signatures
  1544.        below 0c0h are not considered since they are reserved by Microsoft.
  1545.        The search is accomplished by loading ah with the signature in
  1546.        question and al with 00h and then calling int 2fh.  If any non-zero
  1547.        value is returned in al by the int 2fh call, VGAsave assumes that
  1548.        that the signature in ah is currently being used.  Once VGAsave finds
  1549.        a free signature, VGAsave will save it in the resident portion of
  1550.        the program.  If VGAsave cannot find a free signature, it will report
  1551.        an error and refuse to load.  With this approach, VGAsave is not
  1552.        locked into using a fixed multiplex signature and can adapt itself to
  1553.        its environment.
  1554.  
  1555.        Note that the signature detection approach used by VGAsave conforms
  1556.        to the standard usage for this interrupt.   As stated the int 2fh
  1557.        is called with the signature in ah, and 00h in al.  The data in al
  1558.        can be though of as the function number 0 for the TSR using the
  1559.        signature in ah.  The standard usage for service 00h is an install
  1560.        check.  If a TSR is hooked to int 2fh, when its signature is placed
  1561.        in ah with al equal to zero, the TSR should return ffh in al to denote
  1562.        that it is installed.  This fact is very important for VGAsave
  1563.        to detect a free signature.  If there is a TSR loaded in memory that
  1564.        does not return a non-zero value in al for an install check, VGAsave
  1565.        will think that the signature it has made the int 2fh call with is
  1566.        not being used.  VGAsave will then use this signature for itself.  What
  1567.        happens now is that there is two TSR's using the same multiplex
  1568.        signature and there will be a conflict.  This conflict can cause
  1569.        both VGAsave and the other TSR to misbehave.  The symptoms for VGAsave
  1570.        could be something like you can't control it once its loaded (i.e.
  1571.        turn it off, etc.), VGAsave loads itself more than once in memory
  1572.        because its resident data/code is getting corrupted and it can't
  1573.        recognize itself in memory, or in the worst case the system may crash.
  1574.        The reason these possibilities exist is that VGAsave may intercept the
  1575.        other TSR's data/commands as its own on an int 2fh call and the
  1576.        resident code will become corrupted.  Unfortunately, it is impossible
  1577.        for me to know every non-standard usage the install check function
  1578.        on int 2fh.  Hence, the solution to this problem is to change the
  1579.        order in the autoexec.bat that your TSR's are loaded and hope that
  1580.        this will resolve the conflict.
  1581.  
  1582.        Once VGAsave is resident in memory and VGAsave is run again to
  1583.        take advantage of one of its options, a means must be provided for
  1584.        VGAsave to figure out what multiplex signature it is using.  This
  1585.        is accomplished in an almost identical manner.  A loop is set up
  1586.        to make int 2fh calls starting with 0c0h in ah ranging to 0ffh with
  1587.        al set to 00h.  Once VGAsave finds an int 2fh call that returns a
  1588.        non-zero value in al, it assumes that it has found the resident
  1589.        portion of VGAsave.  If it has actually found the resident portion
  1590.        of VGAsave, the bx register will contain the resident code segment.
  1591.        The trick here is that the transient portion of VGAsave doing
  1592.        the multiplex signature check has a copy of the resident code along
  1593.        with it.  Hence, to verify that the multiplex signature belongs
  1594.        to VGAsave, VGAsave compares the resident code to the copy of it
  1595.        in the transient portion.  If a match is found, then VGAsave knows
  1596.        that it has the correct multiplex signature.  If no match is found,
  1597.        VGAsave keeps looking.  The comparison used checks the first 38 bytes
  1598.        of the resident code which in effect gives VGAsave a 38 byte
  1599.        identification string with using any additional memory.
  1600.  
  1601.        There is one possible conflict that can occur with this approach.
  1602.        VGAsave grabs a mux signature that is used by some other TSR.  In
  1603.        this case, load VGAsave after the TSR causing problems.  VGAsave
  1604.        will detect that particular multiplex signature is being used, and
  1605.        VGAsave will use a different one.
  1606.  
  1607.  
  1608.        Mouse Hardware interrupt
  1609.        ========================
  1610.  
  1611.        The mouse intercept is achieved detecting the presence of the mouse
  1612.        by calling int 33h, service 00h.  The reason that this approach
  1613.        has been implemented in version 1.93 was that it has been found
  1614.        that some older mouse drivers need to be reset before the
  1615.        hardware will start issuing the IRQ when a mouse event occurs.
  1616.  
  1617.        Once the presence of the mouse is determined, the mouse hardware
  1618.        interrupt (i.e. IRQ number) is determined with a call to function 36d
  1619.        to the mouse driver (i.e. int 33h, service 36d).  The IRQ number is
  1620.        then translated to its corresponding software interrupt vector that
  1621.        processes the hardware interrupt so that VGAsave can link up with the
  1622.        mouse.  For example,  I have a Microsoft Bus Mouse on IRQ 5.  Hence,
  1623.        whenever something is done with the mouse, the PC is signaled by the
  1624.        mouse issuing a signal to the PIC (Programmable Interrupt Controller)
  1625.        on the mother board via request line #5.  The PIC then tells the CPU
  1626.        that an interrupt or IRQ has occurred.  The CPU then issues the
  1627.        appropriate *software* interrupt *instruction* (int 0dh for IRQ 5)
  1628.        which causes the mouse driver to swing into action.  This sequence
  1629.        repeats every time the mouse is moved or a button is pushed.  Thus,
  1630.        in essence, all the IRQ is doing is telling the mouse driver that
  1631.        something is going on with the mouse.  Its then up to the mouse
  1632.        driver to extract the data from the mouse hardware to see what the
  1633.        mouse is doing.  Since VGAsave doesn't care what the mouse is doing
  1634.        only that something is being done with the mouse, hooking the mouse
  1635.        IRQ line is a good way for VGAsave to link up with the mouse.
  1636.  
  1637.        For IRQ 5 in the example above as noted, via the PIC an IRQ 5 causes
  1638.        an int 0dh to occur.  Hence, VGAsave will hook interrupt 0Dh. Then
  1639.        whenever IRQ 5 occurs, int 0dh occurs, and whatever program is
  1640.        currently running is suspended, VGAsave detects the mouse event then
  1641.        passes control to the mouse driver which passes control back to the
  1642.        suspended program when it is done.
  1643.  
  1644.        Thus, by hooking the mouse hardware interrupt, any mouse event (button
  1645.        presses, releases, motion, etc.) can be detected by VGAsave and are used
  1646.        to reset the internal time count to zero and restore the screen if it is
  1647.        blanked.
  1648.  
  1649.        Int 33h:  Mouse Services
  1650.        ========================
  1651.  
  1652.        This hook is only present if VGAsave is started with the /int33
  1653.        switch.  The purpose is to allow VGAsave to work with mouse drivers
  1654.        that re-point the mouse IRQ vector to the directly to the mouse driver
  1655.        as part of the int 33h service without preserving the interrupt chain.
  1656.        The architecture of this hook is outlined in the section on "Mouse
  1657.        Problems" above.
  1658.  
  1659.  
  1660.     Author
  1661.     ======
  1662.  
  1663.     If you have any comments or suggestions, I may be reached via internet
  1664.     e-mail at javurek@msen.com.  If you send mail, please mention VGAsave
  1665.     in the subject header.
  1666.  
  1667.     As noted in the readme file, its getting difficult to thoroughly test
  1668.     all the possible combinations of command line switches, etc.  Every
  1669.     effort has been made to insure that this software is as bug free as
  1670.     possible, but a few may have slipped by.  If you do encounter a bug,
  1671.     please send me mail so that I can keep track of the problems that users
  1672.     are experiencing.
  1673.  
  1674.     Mail indicating that you are not having any problems and that you like
  1675.     the program is always welcome.  I've spent quite a bit of time on this
  1676.     project and it is nice to know that somebody besides me and a few other
  1677.     folks are using VGAsave.
  1678.  
  1679.     If you're wondering, no the source code is not available.  If you're
  1680.     not wondering then forget I mentioned it.
  1681.  
  1682.  
  1683.     Acknowledgements
  1684.     ================
  1685.  
  1686.     I would like to thank Tim Emmerich for his suggestions and beta testing.
  1687.  
  1688.     I'd also like to thank all the people who sent e-mail and helped me sort
  1689.     out the difficulties associated with the mouse in version 1.91 and
  1690.     provided suggestions for version 1.93.
  1691.