home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / UT / UT055.ZIP / BOSSKEY.DOC next >
Text File  |  1989-11-02  |  38KB  |  1,123 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                 The BOSSKEY Package
  8.                                           
  9.                             Version 1.4 (November, 1989)
  10.                                           
  11.                                           
  12.                           R E F E R E N C E   M A N U A L
  13.                                           
  14.                                           
  15.                                           
  16.                                           
  17.                                   Stephen Meredith
  18.                                     Data del Mar
  19.                                   10423 Byrne Ave
  20.                                 Cupertino, CA  95014
  21.                                    (408) 865-0706
  22.                                           
  23.                                           
  24.                                           
  25.             
  26.                                 _______
  27.                            ____|__     |               (TM)
  28.                         --|       |    |-------------------
  29.                           |   ____|__  |  Association of
  30.                           |  |       |_|  Shareware
  31.                           |__|   o   |    Professionals
  32.                         -----|   |   |---------------------
  33.                              |___|___|    MEMBER
  34.             
  35.             
  36.             
  37.             
  38.             
  39.                          Copyright 1989 by Stephen Meredith
  40.             
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.              The BOSSKEY Package                                  Page 2
  71.  
  72.  
  73.                                           
  74.                                           
  75.                                  Table of Contents
  76.             
  77.             
  78.             
  79.               Preface............................................3
  80.             
  81.             Chapter 1:  Legal Information
  82.               License............................................4
  83.               Warranty...........................................4
  84.               TesSeRact..........................................4
  85.             
  86.             Chapter 2:  General Inforamtion
  87.               Shareware..........................................6
  88.               Association of Shareware Professionals.............6
  89.               Technical Support..................................7
  90.               E-Mail Addresses...................................7
  91.               Ordering Information...............................7
  92.               Order Form.........................................8
  93.             
  94.             Chapter 3:  SCRSAVE
  95.               What it does.......................................9
  96.               How to use it......................................9
  97.               Known Incompatibilities............................9
  98.             
  99.             Chapter 4:  BOSSKEY and NEW-IMG
  100.               What it does......................................11
  101.               How to use it.....................................11
  102.               Changing the screen...............................12
  103.               Known Incompatibilities...........................12
  104.             
  105.             Chapter 5:  SHOW-IMG
  106.               What it does......................................13
  107.               How to use it.....................................13
  108.             
  109.             Chapter 6:  CONV-IMG
  110.               What is is........................................14
  111.               How to use it.....................................14
  112.               Example...........................................15
  113.             
  114.             Chapter 7:  SHOWLIB.OBJ
  115.               Using showlib from Turbo C........................16
  116.               Example...........................................17
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                          Copyright by Stephen Meredith, 1989
  131.  
  132.  
  133.  
  134.  
  135.  
  136.              The BOSSKEY Package                                  Page 3
  137.  
  138.  
  139.                                           
  140.                                           
  141.                                       Preface
  142.             
  143.             The Bosskey Package consists of five programs, an object
  144.             module, and a header file.  The programs include a text
  145.             screen saver, a saved screen viewer, a 'bosskey' program, a
  146.             bosskey utility program, and file conversion utility for
  147.             programmers.  The object module contains a C function for
  148.             displaying screens with special effects in C programs.  The
  149.             programs are named as follows:
  150.             
  151.             BOSSKEY.EXE
  152.             SCRSAVE.EXE
  153.             SHOW-IMG.EXE
  154.             NEW-IMG.EXE
  155.             CONV-IMG.COM
  156.             
  157.             The object module is:
  158.             
  159.             SHOWLIB.OBJ
  160.             
  161.             The header file is:
  162.             
  163.             SHOWLIB.H
  164.             
  165.             The BOSSKEY program is a program which allows you to pop-up
  166.             a previously saved screen of your choice when you hear the
  167.             boss coming.  When he is gone, you can get rid of the screen
  168.             and get back to whatever you where doing before he came in.
  169.             
  170.             The SCRSAVE program is a program for saving text screens to
  171.             disk.  First you run SCRSAVE, which loads into memory and
  172.             returns you to the DOS prompt.  Then you run whatever
  173.             program you wish.  When you want to save a screen, you hit a
  174.             special key combination, and a snapshot of whatever is on
  175.             your screen is saved to a file.  You can use these files
  176.             with BOSSKEY, SHOW-IMG, NEW-IMG, and CONV-IMG.  You can also
  177.             use them in C programs.
  178.             
  179.             SHOW-IMG shows you one or more saved screen snapshots.  You
  180.             can use it as a simple demo program.
  181.             
  182.             NEW-IMG is used to change the snapshot in use by the BOSSKEY
  183.             program.
  184.             
  185.             The CONV-IMG program (CONVert IMaGe) is a utility for
  186.             programmers who write in C.  It takes a screen image file
  187.             and converts it to an array.  It writes the array out to a
  188.             file which you can include in your C program for easy screen
  189.             manipulation.
  190.             
  191.             The SHOWLIB.OBJ module can be linked with a C program to
  192.             display screens using special effects.
  193.  
  194.  
  195.  
  196.                          Copyright by Stephen Meredith, 1989
  197.  
  198.  
  199.  
  200.  
  201.  
  202.              The BOSSKEY Package                                  Page 4
  203.  
  204.  
  205.             
  206.                                           
  207.                                           
  208.                            Chapter 1   Legal Information
  209.             
  210.             
  211.             License:
  212.             
  213.             The BOSSKEY Package, consisting of the included programs,
  214.             functions, and all supporting documentation, is copyrighted
  215.             by Stephen Meredith, 1989.  The copyright owner hereby
  216.             licenses you to use the software for evaluation purposes,
  217.             make as many copies of the software and documentation as you
  218.             wish, give exact copies of the original to anyone, and to
  219.             distribute the software and documentation in its original
  220.             unmodified form via electronic means.
  221.             
  222.             This software is shareware: it is not free software.  This
  223.             license allows you to use this software without charge for a
  224.             period of 30 days.  At the end of this trial period, you are
  225.             trusted to either register your copy of the BOSSKEY package,
  226.             or discontinue using it.
  227.             
  228.             You are specifically prohibited from charging or requesting
  229.             donations for any copies of this package.  Exceptions may be
  230.             granted to organizations which charge a small fee for
  231.             materials, postage and handling.  No organization is
  232.             authorized to charge any amount for distribution of the
  233.             software or documentation under any other conditions.
  234.             
  235.             In addition, no part of this package may be include with
  236.             another package, except for the SHOWLIB.OBJ object module
  237.             (as long as it is linked as part another program.)  You may
  238.             not use any screen image file created with the SCRSAVE
  239.             program in any other program, or in demonstration of some
  240.             other product, whether commercial, public domain, shareware
  241.             or other, until you have paid the registration fee.
  242.             
  243.             
  244.             Warranty:
  245.             
  246.             There is no warranty of any kind associated with this
  247.             software.  By using it, you agree to this.  Every effort has
  248.             been made to make this product error free.  However, it is
  249.             impossible to guarantee bug-free software.
  250.             
  251.             
  252.             TesSeRact:
  253.             
  254.             This product uses the TesSeRact(TM) Ram_Resident Library and
  255.             supports the TesSeRact Standard for Ram_Resident Program
  256.             Communication.  For information about TesSeRact, contact the
  257.             TesSeRact Development Team at:
  258.             
  259.  
  260.  
  261.  
  262.                          Copyright by Stephen Meredith, 1989
  263.  
  264.  
  265.  
  266.  
  267.  
  268.            Chapter 1                                               Page 5
  269.  
  270.  
  271.             
  272.                     TesSeRact Development Team
  273.                     1657 The Fairways
  274.                     Suite 101
  275.                     Jenkintown, PA 19046
  276.             
  277.                     Phone: 215-884-3373
  278.                     CIS: 70731,20
  279.                     MCI: 315-5415
  280.                     FAX: 215-886-4225
  281.             
  282.             If you are a programmer considering writing a TSR, I highly
  283.             recommend this package.  It is not for the complete novice,
  284.             but it simplifies the creation of TSR programs by one or two
  285.             orders of magnitude!  The time you save by using this
  286.             package will be immense.  There are TesSeRact libraries for
  287.             C, Pascal, and assembly language.  And it's another
  288.             shareware package, so you can try before you buy.
  289.             
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                          Copyright by Stephen Meredith, 1989
  329.  
  330.  
  331.  
  332.  
  333.  
  334.             Chapter 2                                              Page 6
  335.  
  336.  
  337.                                           
  338.                                           
  339.                           Chapter 2:  General Information
  340.             
  341.             
  342.             Shareware:
  343.             
  344.             This package is marketed as shareware, also known as user-
  345.             supported software.  Shareware is a method of marketing
  346.             software which allows potential buyers to try out programs
  347.             before actually purchasing them.  If you use the software
  348.             for a while, and like it, you are trusted to mail in the
  349.             registration fee.  If you don't like it, you don't have to
  350.             buy it.  What could be better for you?
  351.             
  352.             The shareware method is also benefitial to software authors.
  353.             It keeps the costs of marketing and packaging to a minimum.
  354.             The savings are reflected in the low price tag that comes
  355.             with the software.
  356.             
  357.             Registration for this package is only $10.00!  Payment of
  358.             this fee entitles you to:
  359.             
  360.              1: A disk with the latest version of the BOSSKEY Package.
  361.              2: The right to use the software as much as you like.
  362.              3: The right to distribute screen image files create with
  363.                 this package as part of other products.
  364.              4: Upgrades to future versions for a nominal fee.
  365.              5: The satisfaction of helping the shareware system work.
  366.             
  367.             
  368.             Association of Shareware Professionals:
  369.             
  370.             Stephen Meredith is a member of the Association of Shareware
  371.             Professionals (ASP).  This organization was formed in April
  372.             of 1987 to strengthen the future of shareware as an
  373.             alternative to commercial software.  Its members, all of
  374.             whom are programmers who subscribe to a code of ethics, are
  375.             committed to the concept of shareware as a method of
  376.             marketing.
  377.             
  378.             ASP wants to make sure that the shareware principle works
  379.             for you.  If you are unable to resolve a shareware-related
  380.             problem with an ASP member by contacting the member
  381.             directly, ASP may be able to help.  The ASP Ombudsman can
  382.             help you resolve a dispute or problem with an ASP member,
  383.             but does not provide technical support for members'
  384.             products.  Please write to the ASP Ombudsman at P.O. Box
  385.             5786, Bellevue, WA  98006, or send a Compuserve message via
  386.             easyplex to ASP Ombudsman 70007,3536.
  387.             
  388.             
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                          Copyright by Stephen Meredith, 1989
  395.  
  396.  
  397.  
  398.  
  399.  
  400.             Chapter 2                                              Page 7
  401.  
  402.  
  403.             Technical Support:
  404.             
  405.             If you have a problem with the software, please let me help.
  406.             You may call, write, or send E-Mail.  I have several E-Mail
  407.             addresses, and will answer with support as soon as I can.
  408.             
  409.             The only way I can learn about (and fix) bugs is if you let
  410.             me know what's happening.  I can't test every possible
  411.             machine configuration with the BOSSKEY product.  So please
  412.             let me know what kind of problems you have with the software
  413.             (and documentation.)  I am also looking for suggestions and
  414.             improvement ideas.
  415.             
  416.             
  417.             E-Mail Addresses:
  418.             
  419.             Compuserve:  [72571,1512]
  420.             Internet:    72571.1512@compuserve.com
  421.             
  422.             
  423.             Ordering Information:
  424.             
  425.             To order, please fill out the order form on the next page.
  426.             Send it to me with a check or money order for $10.00 made
  427.             out to Stephen Meredith.  Sorry, I don't take credit cards
  428.             yet.  (U.S. Funds, please.)
  429.             
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                          Copyright by Stephen Meredith, 1989
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                Registration                                    Page 8
  467.  
  468.  
  469.             
  470.             
  471.                           The BOSSKEY Package Registration
  472.             
  473.             
  474.             
  475.             NAME________________________________________________________
  476.             
  477.             STREET ADDRESS______________________________________________
  478.             
  479.             CITY, STATE, ZIP____________________________________________
  480.             
  481.             
  482.             Where did you get this copy of BOSSKEY (if BBS, say which)?
  483.             
  484.             ____________________________________________________________
  485.             
  486.             
  487.             What would you do to improve this product?
  488.             
  489.             ____________________________________________________________
  490.             
  491.             ____________________________________________________________
  492.             
  493.             ____________________________________________________________
  494.             
  495.             Would you benefit from a full screen editor for image files?
  496.             
  497.             ___YES   ___NOT REALLY
  498.             
  499.             Would you like to see BOSSKEY.EXE cover graphics screens?
  500.             
  501.             ___YES   ___NOT REALLY
  502.             
  503.             Can you use a program to convert screens for use with BASIC
  504.             or Pascal?
  505.             
  506.             ___YES   ___NOT REALLY
  507.             
  508.             ------------------------------------------------------------
  509.             Please send this form with a check or money order for $10.00
  510.             to:
  511.                                           
  512.                                           
  513.                                   Stephen Meredith
  514.                                     Data del Mar
  515.                                   10423 Byrne Ave.
  516.                                 Cupertino, CA  95014
  517.                                           
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.                          Copyright by Stephen Meredith, 1989
  527.  
  528.  
  529.  
  530.  
  531.  
  532.             Chapter 3                                              Page 9
  533.  
  534.  
  535.                                           
  536.                                           
  537.                                 Chapter 3:  SCRSAVE
  538.             
  539.             
  540.             What it does:
  541.             
  542.             SCRSAVE is a memory-resident program (also called a TSR,
  543.             short for Terminate but Stay Resident) which can be used to
  544.             save a snapshot of a program's non-graphics screen to a
  545.             file.  This snapshot file may then be used with BOSSKEY, or
  546.             as part of a demo, or in some other way.  The screen is
  547.             stored in the standard CHAR-ATTRIBUTE format.
  548.             
  549.             How to use it:
  550.             
  551.             You invoke SCRSAVE just as you would any other program.
  552.             First, make sure you are in the directory which contains the
  553.             SCRSAVE program (or be sure it's in the DOS search path.)
  554.             At the DOS prompt (A> or C> for example) type SCRSAVE and
  555.             press the [ENTER] or [RETURN] key.  The program will load
  556.             into memory, and you will be returned to the DOS prompt.
  557.             SCRSAVE is now ready to go to work saving screens to disk at
  558.             your command.  You save the image of a screen by pressing
  559.             [ALT] [PRN-SCREEN].  On some keyboards, you may have to
  560.             press [ALT] [(GREY)*]  (that's the * over on the numeric
  561.             keypad.)
  562.             
  563.             If SCRSAVE has already been loaded into memory and you try
  564.             to load it in again, it will tell you.  Only one copy of the
  565.             program will be loaded into memory at one time.  You can
  566.             remove the program from memory by typing SCRSAVE OFF at the
  567.             DOS prompt.  In order for the program to be removed from
  568.             memory, it must have been the last memory resident program
  569.             loaded.  If you type SCRSAVE OFF, and some other programs
  570.             have gone resident since you loaded SCRSAVE, it will be told
  571.             to leave memory as soon as the other programs have also been
  572.             removed.  While it is in this waiting state, the SCRSAVE
  573.             program is essentially off--it will not continue to save
  574.             screens.  To reactivate the program, type SCRSAVE again.
  575.             
  576.             After the program is loaded into memory, you can take a
  577.             snapshot of any screen from most any program.  The only
  578.             exceptions are that you can't take a snapshot of a screen
  579.             which is using graphics mode and you can't take a snapshot
  580.             of another memory resident program's pop-up screen.  If you
  581.             attempt one of these illegal operations, you will hear a
  582.             short series of descending tones (I'll call them 'error
  583.             tones' from now on.)  You will also hear the error tones if
  584.             there is already disk access when you try to save the
  585.             screen, or when there is not enough free disk space to save
  586.             the screen.
  587.             
  588.  
  589.  
  590.  
  591.  
  592.                          Copyright by Stephen Meredith, 1989
  593.  
  594.  
  595.  
  596.  
  597.  
  598.            Chapter 3                                              Page 10
  599.  
  600.  
  601.             To take a snapshot of a screen and save it to disk as a
  602.             screen image file, simply press the [ALT] key and hold it,
  603.             and then press the [PRT-SCREEN] key.  You will either hear
  604.             the error tones (telling you that you can't take a picture
  605.             of this screen) or you will see a prompt at the very top of
  606.             your screen.  At this point, the snapshot has already been
  607.             taken.  The program is asking you for the name of the file
  608.             to save the screen  under.  Enter a filename.  Only one
  609.             screen is saved in each file.  Filenames are limited to
  610.             eight characters, and an optional '.' (period) followed by
  611.             another three letters (commonly called the 'extension.')  If
  612.             you enter a filename that already exists on the disk, you
  613.             will hear the error tones, and the screen will not be saved.
  614.             
  615.             You may also press [RETURN] by itself at the filename
  616.             prompt.  Doing so causes the screen to be save in the
  617.             current directory.  A filename will be chosen for you for
  618.             this screen and all others you wish to save after this.
  619.             SCRSAVE will try to save the screen in a file called 1.IMG.
  620.             If that file exists, it will try the name 2.IMG, then 3.IMG,
  621.             and so on, until it finds a number which does not exist as a
  622.             filename.  From now on, each time you press [ALT] [PRT-
  623.             SCREEN] the snapshot of the screen will be given one of
  624.             these automatic filenames.  This feature comes in handy when
  625.             making many snapshots of a program's screens for use in a
  626.             demo or some similar application.
  627.             
  628.             It is a good idea to name all your screen image file with
  629.             the same extension.  This makes it easy to keep track of
  630.             them.  I use .IMG.  If you have some other naming convention
  631.             which you already use, that's fine; none of the programs in
  632.             this package require the .IMG convention.
  633.             
  634.             Known Imcompatibilities:
  635.             
  636.             This program will not work with programs that steal the
  637.             interrupts it needs.  Most programs that steal interrupts
  638.             restore them at the end of the program.  Thus, SCRSAVE is
  639.             only disabled while these programs are in use.  It works
  640.             again as soon as the offending program terminates.  Programs
  641.             which fall into this catagory include:
  642.             
  643.             SNIPES          SuperSet Software
  644.             BUGS!           Michael Ouye
  645.             
  646.             
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.                          Copyright by Stephen Meredith, 1989
  659.  
  660.  
  661.  
  662.  
  663.  
  664.            Chapter 4                                               Page 11
  665.  
  666.  
  667.                                           
  668.                                           
  669.                           Chapter 4:  BOSSKEY and NEW-IMG
  670.             
  671.             
  672.             What it does:
  673.             
  674.             BOSSKEY is another TSR which is used to hide the screen of
  675.             whatever program you are using by covering it with the image
  676.             of a screen from some other application which has been saved
  677.             to disk.  Use SCRSAVE for the job of saving the screens--see
  678.             chapter 3.
  679.             
  680.             
  681.             How to use it:
  682.             
  683.             To invoke BOSSKEY, type BOSSKEY at the DOS prompt, followed
  684.             by the filename of the screen to use as the cover, followed
  685.             by [RETURN] or [ENTER].  The filename you give it must be
  686.             the name of a screen image file saved with SCRSAVE (or some
  687.             other compatible program--all that matters is that the image
  688.             file is in CHAR-ATTRIB format.)  It easy to recognize screen
  689.             image files.  They are 4000 bytes long.  Those created with
  690.             the SCRSAVE automatic naming feature will end in .IMG.
  691.             BOSSKEY will read the screen image file and itself into
  692.             memory.
  693.             
  694.             If you still have the SCRSAVE program in memory when you
  695.             call this program, you will be given a warning (in case you
  696.             don't want both in memory at the same time.)
  697.             
  698.             If something goes wrong during the load process, you will be
  699.             given an error message.  In this case, you may not have
  700.             given the program the correct filename, or no filename at
  701.             all.
  702.             
  703.             To cover up a screen with the screen read from the image
  704.             file, simply press any [CTRL] or [CONTROL] key  and press
  705.             the shift key located on the right hand side of keyboard.
  706.             Pressing the left shift key will not work.  If the disk
  707.             drive lights are not on and you are not in graphics mode,
  708.             whatever you where doing will be suspended and you will see
  709.             the screen from the image file on your screen, just as it
  710.             appeared when you saved it.  To get back to whatever you
  711.             where just doing before covering up the screen, hit [CTRL]
  712.             [RIGHT-SHIFT] again.  This will unfreeze your program.  Its
  713.             normal screen will come back.  You can now continue where
  714.             you left off.
  715.             
  716.             
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.                          Copyright by Stephen Meredith, 1989
  725.  
  726.  
  727.  
  728.  
  729.  
  730.            Chapter 4                                               Page 12
  731.  
  732.  
  733.             Changing the screen:
  734.             
  735.             You can press the [CTRL] [RIGHT-SHIFT] keys as many times as
  736.             you like.  The same screen will pop up each time.  If you
  737.             are done with BOSSKEY, type BOSSKEY OFF to mark it for
  738.             removal from memory.  If you would like to change the screen
  739.             which pops up, type
  740.             
  741.             NEW-IMG filename.
  742.             
  743.             Replace the word 'filename' with the name of the new image
  744.             file which holds the screen you would to pop-up when you
  745.             press [CTRL] [RIGHT-SHIFT].
  746.             
  747.             For example, if you origianlly loaded BOSSKEY with the image
  748.             file SCREEN1.IMG but would rather see the image stored in
  749.             SCREEN2.IMG, type
  750.             
  751.             NEW-IMG SCREEN2.IMG
  752.             
  753.             Now each time you hit [CTRL] [RIGHT-SHIFT] you will see the
  754.             screen stored in SCREEN2.IMG.
  755.             
  756.             Known Imcompatibilities:
  757.             
  758.             BOSSKEY will not work with programs that steal the
  759.             interrupts it needs.  Most programs that steal interrupts
  760.             restore them at the end of the program.  Thus, BOSSKEY is
  761.             only disabled while these programs are in use.  It works
  762.             again as soon as the offending program terminates.  Programs
  763.             which fall into this catagory include:
  764.             
  765.             SNIPES          SuperSet Software
  766.             BUGS!           Michael Ouye
  767.             
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                          Copyright by Stephen Meredith, 1989
  791.  
  792.  
  793.  
  794.  
  795.  
  796.            Chapter 5                                               Page 13
  797.  
  798.  
  799.                                           
  800.                                           
  801.                                 Chapter 5:  SHOW-IMG
  802.             
  803.             
  804.             What it does:
  805.             
  806.             SHOW-IMG is a utility program for viewing screen image
  807.             files, like those created with SCRSAVE.  You can use it as a
  808.             simple demo program.
  809.             
  810.             
  811.             How to use it:
  812.             
  813.             To view a screen image file, type SHOW-IMG filename.
  814.             Replace the word 'filename' with the name of the image file
  815.             you would like to view.  The screen saved in the image file
  816.             will appear on your screen.  Press any key to return to the
  817.             DOS prompt.
  818.             
  819.             To use SHOW-IMG as a demo program, list all the names of the
  820.             screen images you wish to view.  For example, to see the
  821.             three file 1.IMG, 2.IMG, and 3.IMG, type:
  822.             
  823.                     SHOW-IMG 1.IMG 2.IMG 3.IMG
  824.             
  825.             1.IMG will show first and wait for you to press a key.  Then
  826.             2.IMG will appear.  Press a key one more time to see 3.IMG.
  827.             
  828.             You may also use wildcards in the names of the screen image
  829.             files.  For example,
  830.             
  831.                     SHOW-IMG *.IMG
  832.             
  833.             will show all the image files ending in the .IMG extension.
  834.             It shows the files in the order in which they appear in the
  835.             directory.
  836.             
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.                          Copyright by Stephen Meredith, 1989
  857.  
  858.  
  859.  
  860.  
  861.  
  862.            Chapter 6                                               Page 14
  863.  
  864.  
  865.                                           
  866.                                           
  867.                                 Chapter 6:  CONV-IMG
  868.             
  869.             
  870.             What it is:
  871.             
  872.             CONV-IMG is a utility program for C programmers who wish to
  873.             use saved screens in their programs.  Actually, there are 2
  874.             ways to accomplish this.  First, you can use the CONV-IMG to
  875.             turn a screen image file into an array and compile it into
  876.             your program.  The other way to do it is to read the screen
  877.             from disk as your program is running.  There are advantages
  878.             and disadvantages to each method.
  879.             
  880.             
  881.             How to use it:
  882.             
  883.             To use CONV-IMG, you must first have a screen image file
  884.             saved to disk.  You can create screen image files with
  885.             SCRSAVE.  To convert an image file to an array, type
  886.             
  887.             CONV-IMG filename
  888.             
  889.             where filename is the name of the screen image file.  The
  890.             resulting array will have the same filename as the original
  891.             image file, except that it will have the extension '.H'
  892.             instead of the original extension.
  893.             
  894.             The resulting .H file will be quite a bit larger than the
  895.             original image file.  The array will be named
  896.             screen_filename, where filename is the name of the image
  897.             file, less any extension that may be present.  The .H file
  898.             created from the image file s2.img will look something like
  899.             this:
  900.             
  901.             char screen_s2[] = {
  902.             0x20,0x70,0x20,0x70,0xE2,0x70,0xC2,0x70,0x20,0x70,0x20,
  903.             0x41,0x70,0x72,0x70,0xE2,0x70,0xC2,0x70,0x20,0x70,0x20,
  904.             .
  905.             .    ( 246 more lines of similar stuff )
  906.             .
  907.             0x20,0x70,0x20,0x70,0xE2,0x70,0xC2,0x70,0x20,0x70,0x20,
  908.             0x41,0x70,0x72,0x70,0xE2,0x70,0xC2,0x70,0x20,0x70,0x20,
  909.             }; /* screen_s2 */
  910.             
  911.             Note that the array name is screen_s2[].  To use this .H
  912.             file in your programs, you use the #include directive.  You
  913.             can then refer to the variable name in your program.
  914.             
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                          Copyright by Stephen Meredith, 1989
  923.  
  924.  
  925.  
  926.  
  927.  
  928.            Chapter 6                                               Page 15
  929.  
  930.  
  931.             Here is a short example program written for Turbo C 2.0:
  932.             
  933.             #include <conio.h>
  934.             #include "S2.H"         /* your screen will be loaded */
  935.                                     /* at compile time and is     */
  936.                                     /* called screen_s2           */
  937.             
  938.             void main()
  939.             {
  940.                 puttext(1,1,80,25,screen_s2); /* display the screen */
  941.                 getch();                      /* wait for key */
  942.             }
  943.             
  944.             
  945.             This short program displays the screen and waits for a
  946.             keystroke.  It uses the Turbo C library function puttext(),
  947.             which puts a block of text on the screen.  Using this
  948.             technique, you can switch between several screens very
  949.             rapidly for animation.  Or you can create stand-alone demos
  950.             which don't require disk access for each frame.  You might
  951.             also find it handy to make help screens this way.  (See
  952.             chapter 7 for another way of displaying screens--the
  953.             showscreen() function.)
  954.             
  955.             You can also compile the .H files into object modules which
  956.             you link with your program.  To do this, you must treat the
  957.             variables as extern.  This will save compilation time.
  958.             
  959.             Here is another short program demonstrating how to read an
  960.             image file from disk at run-time and display the screen
  961.             stored in the file.  Again, I am using the example S2.IMG,
  962.             which is assumed to be on disk.
  963.             
  964.             #include <conio.h>
  965.             #include <stdio.h>
  966.             
  967.             void main()
  968.             {
  969.                     FILE *fp;
  970.                     char scr_buff[ 4000 ];
  971.             
  972.                     fp = fopen( "S2.IMG", "rb" );   
  973.                     fread( &scr_buff, 4000, 1, fp );
  974.                     fclose( fp );
  975.                     puttext( 1,1,80,25, scr_buff );
  976.                     getch();
  977.             }
  978.             
  979.             The utility SHOW-IMG is written similary, but the image read
  980.             directly into screen memory.
  981.             
  982.             You can also use the showscreen() function (provided in
  983.             object form with this package) to display screens with
  984.             special effects.  It is descibed in detail in Chapter 7.
  985.  
  986.  
  987.  
  988.                          Copyright by Stephen Meredith, 1989
  989.  
  990.  
  991.  
  992.  
  993.  
  994.            Chapter 6                                               Page 16
  995.  
  996.  
  997.             
  998.             
  999.             
  1000.                                Chapter 7: SHOWLIB.OBJ
  1001.                                           
  1002.             
  1003.             
  1004.             Using with Turbo C:
  1005.             
  1006.             
  1007.             SHOWLIB.OBJ contains a Turbo C function showscreen().  The
  1008.             function showscreen() can be used to move a screen from a
  1009.             character array to video memory using special effects.  Note
  1010.             that this function works with the Large memory model only.
  1011.             Use MK_FP to get a far pointer to your video memory (see
  1012.             example below.)  Don't forget to link SHOWLIB.OBJ with your
  1013.             program.  Do this by placing the line
  1014.             SHOWLIB.OBJ
  1015.             in your project file, or adding SHOWLIB.OBJ to the command
  1016.             line list of object files when invoking TLINK.
  1017.             
  1018.             
  1019.             FUNCTION:
  1020.             
  1021.             Shows an array of 4000 bytes (one screen) with special
  1022.             effects.
  1023.             
  1024.             
  1025.             SYNTAX:
  1026.             
  1027.             #include "showlib.h"
  1028.             void showscreen( char far *dest, char far *source, int func,
  1029.             int speed );
  1030.             
  1031.             
  1032.             PROTOTYPE IN:
  1033.             
  1034.             showlib.h
  1035.             
  1036.             
  1037.             REMARKS:
  1038.             
  1039.             Copies a block of 4000 bytes from memory pointed to by the
  1040.             pointer 'source' into video memory located at 'dest' using
  1041.             one of the methods specified by 'func' at a rate specified
  1042.             by 'speed' (0 is fastest.)  The constants to use in the
  1043.             'func' parameter are defined in showlib.h.  Each is a
  1044.             different special effect.  They are:
  1045.             
  1046.             SLIDE_RIGHT     
  1047.             SLIDE_LEFT      
  1048.             SLIDE_UP        
  1049.             SLIDE_DOWN      
  1050.             WIPE_UP         
  1051.  
  1052.  
  1053.  
  1054.                          Copyright by Stephen Meredith, 1989
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.            Chapter 7                                               Page 17
  1061.  
  1062.  
  1063.             WIPE_DOWN       
  1064.             WIPE_RIGHT      
  1065.             WIPE_LEFT
  1066.             PUSH_UP
  1067.             PUSH_DOWN
  1068.             PUSH_LEFT
  1069.             PUSH_RIGHT
  1070.             PUSH_LEFT1      
  1071.             PUSH_RIGHT1     
  1072.             FLASH           
  1073.             
  1074.             RETURN VALUE:
  1075.             
  1076.             None.
  1077.             
  1078.             
  1079.             EXAMPLE:
  1080.             
  1081.             #include <conio.h>
  1082.             #include <bios.h>
  1083.             #include <dos.h>
  1084.             #include "showlib.h"
  1085.             
  1086.             /*1.h contains array screen_1 -- use SCRSAVE and CONV-IMG*/
  1087.             #include "1.h"
  1088.             
  1089.             #define MONOCARD 0x0030
  1090.             #define MONOMEM  0xB000
  1091.             #define COLORMEM 0xB800
  1092.             
  1093.             
  1094.             /* shows screen_1 (from 1.h) and waits for a key */
  1095.             main()  {
  1096.                     char far *scrbuff;
  1097.                     scrbuff = MK_FP( (((biosequip() & MONOCARD ) ==
  1098.                               MONOCARD ) ? MONOMEM:COLORMEM), 0x00 );
  1099.             
  1100.                     showscreen( scrbuff, screen_1, WIPE_LEFT, 2 );
  1101.                     getch();
  1102.             }
  1103.             
  1104.             
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.                          Copyright by Stephen Meredith, 1989
  1121.  
  1122.  
  1123.