home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / turbopas / qwik55.arc / QWIK55.DOC < prev    next >
Text File  |  1989-08-24  |  82KB  |  2,236 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                               QWIK SCREEN UTILITIES
  21.                                   USER'S GUIDE
  22.  
  23.                                    Version 5.5
  24.                                   March 4, 1989
  25.  
  26.  
  27.                Copyright (C) 1988-1989 Eagle Performance Software
  28.                               All Rights Reserved.
  29.  
  30.  
  31.  
  32.                                _______
  33.                           ____| _     |               (tm)
  34.                        --|       |    |-------------------
  35.                          |   ____|__  |  Association of
  36.                          |  |       |_|  Shareware
  37.                          |__|   o   |    Professionals
  38.                        -----|   |   |---------------------
  39.                             |___|___|    MEMBER
  40.    QWIK Screen Utilities                            User's Guide, Version 5.5
  41.  
  42.  
  43.  
  44.                        T A B L E   O F   C O N T E N T S
  45.  
  46.         1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . 3
  47.              Features .  . . . . . . . . . . . . . . . . . . . . . 3
  48.              Using the Manuals . . . . . . . . . . . . . . . . . . 3
  49.              Licensing . . . . . . . . . . . . . . . . . . . . . . 4
  50.              Customer Service  . . . . . . . . . . . . . . . . . . 4
  51.              ASP . . . . . . . . . . . . . . . . . . . . . . . . . 5
  52.  
  53.         2. GETTING STARTED . . . . . . . . . . . . . . . . . . . . 6
  54.              Distribution Files  . . . . . . . . . . . . . . . . . 6
  55.              Demonstration . . . . . . . . . . . . . . . . . . . . 6
  56.              Simple Programming  . . . . . . . . . . . . . . . . . 6
  57.              Procedures and Functions  . . . . . . . . . . . . . . 8
  58.  
  59.         3. BASIC TECHNIQUES  . . . . . . . . . . . . . . . . . . . 11
  60.              Number to String Conversion . . . . . . . . . . . . . 11
  61.              Cursor Mode Routines  . . . . . . . . . . . . . . . . 11
  62.              Cursor Location Routines  . . . . . . . . . . . . . . 13
  63.              EOS Marker  . . . . . . . . . . . . . . . . . . . . . 13
  64.              Scrolling . . . . . . . . . . . . . . . . . . . . . . 14
  65.              Pop-Up Windows  . . . . . . . . . . . . . . . . . . . 15
  66.  
  67.         4. ADVANCED TECHNIQUES . . . . . . . . . . . . . . . . . . 17
  68.              Virtual Screens . . . . . . . . . . . . . . . . . . . 17
  69.              Video Pages . . . . . . . . . . . . . . . . . . . . . 18
  70.              Video Modes . . . . . . . . . . . . . . . . . . . . . 19
  71.              Multi-tasking Environments  . . . . . . . . . . . . . 20
  72.              Interrupts  . . . . . . . . . . . . . . . . . . . . . 20
  73.  
  74.         5. HARDWARE DETECTION  . . . . . . . . . . . . . . . . . . 21
  75.              Display Combination Code  . . . . . . . . . . . . . . 21
  76.              Snow Checking . . . . . . . . . . . . . . . . . . . . 22
  77.              System Hardware . . . . . . . . . . . . . . . . . . . 23
  78.              Tips  . . . . . . . . . . . . . . . . . . . . . . . . 23
  79.  
  80.         APPENDIX A: Video Mode Table . . . . . . . . . . . . . . . 24
  81.  
  82.         APPENDIX B: Cursor Mode Data . . . . . . . . . . . . . . . 26
  83.              Cursor Mode Tables  . . . . . . . . . . . . . . . . . 26
  84.              Cursor Emulation  . . . . . . . . . . . . . . . . . . 26
  85.  
  86.         APPENDIX C: Performance  . . . . . . . . . . . . . . . . . 29
  87.              Code Size . . . . . . . . . . . . . . . . . . . . . . 29
  88.              Speed . . . . . . . . . . . . . . . . . . . . . . . . 29
  89.              TP4 Usage . . . . . . . . . . . . . . . . . . . . . . 30
  90.  
  91.         APPENDIX D: Application Products . . . . . . . . . . . . . 31
  92.  
  93.         APPENDIX E: Revision History . . . . . . . . . . . . . . . 34
  94.  
  95.         APPENDIX F: References and Credits . . . . . . . . . . . . 37
  96.  
  97.  
  98.  
  99.  
  100.                                        2
  101.    QWIK Screen Utilities                            User's Guide, Version 5.5
  102.  
  103.  
  104.    1.  I N T R O D U C T I O N
  105.  
  106.  
  107.    FEATURES
  108.  
  109.    Welcome to QWIK Screen Utilities!
  110.  
  111.    You have just obtained a copy of the highest performance screen writing
  112.    tools available today for Turbo Pascal 5.5 (TP5).  Both novice and
  113.    professional programmers will appreciate these simple and very powerful
  114.    utilities that gives you absolute control over your CRT displays in all
  115.    text modes.
  116.  
  117.    Here are some of the features you will discover:
  118.  
  119.      . Writes on all IBM compatible computers, displays and
  120.        adapters including the new PS/2 systems and Hercules.
  121.      . Superior video detection routine.
  122.      . Eliminates snow and flicker.
  123.      . Writes directly to the screen in absolute coordinates.
  124.      . Writes in all text modes and column modes.
  125.      . Writes on all video pages.
  126.      . Writes on virtual screens in RAM.
  127.      . Writes text and attribute, text only, or attribute only.
  128.      . Reads strings, characters and attributes.
  129.      . Uses End-Of-String (EOS) marker for quick string chaining.
  130.      . Provides standardized cursor control for all adapters.
  131.      . Enhanced cursor movement.
  132.      . 650+% faster than TP5 direct screen writing.
  133.      . Works in multi-tasking environments.
  134.      . Only 2.7k bytes of code if all 45 utilities are used.
  135.      . Optimized by the compiler and drops unused code.
  136.      . Used in all other Eagle products.
  137.  
  138.    QWIK is an enhancement unit providing capabilities not offered in the CRT
  139.    unit that came with TP5.  In contrast to the CRT unit which does window-
  140.    relative writing, QWIK knows how to write directly to the screen in
  141.    absolute screen coordinates for any video configuration.
  142.  
  143.  
  144.    USING THE MANUALS
  145.  
  146.    Disk Based Guides - The manuals for QWIK are on disk so that you can
  147.    conveniently scan for the topic you are seeking.  You can do this with any
  148.    list or search utility with a search function.  You can also make a printed
  149.    copy.  If you have not already printed this manual, refer to the READ.ME
  150.    file for instructions.  At the present time, no bound manuals are being
  151.    offered with registration.
  152.  
  153.    User's Guide - This manual, the one your are reading now, assumes that as a
  154.    programmer you are already familiar with Turbo Pascal 4.0 and that you have
  155.    a working knowledge of your disk operating system (DOS).  It will provide
  156.    you the basic principles of direct screen writing and powerful tips on some
  157.    previously unavailable techniques.
  158.  
  159.  
  160.  
  161.    Chapter 1, Introduction                                             Page 3
  162.    QWIK Screen Utilities                            User's Guide, Version 5.5
  163.  
  164.  
  165.    Reference Guide - This manual describes in detail all procedures, functions
  166.    and variables used in QWIK.  It is alphabetically arranged for easy access
  167.    in a format similar to the TP5 manual.  Use this manual when you have
  168.    become familiar with the basic principles in the User's guide.
  169.  
  170.  
  171.    LICENSING
  172.  
  173.    Registration - These utilities and the documentation have been released for
  174.    distribution as Shareware.  You have been given the chance to sample the
  175.    full capability of QWIK without risk!  If you find that QWIK is a valuable
  176.    tool, then you are expected to register.  You will find a reasonable
  177.    licensing schedule found in LICENSE.ARC to meet private or commercial
  178.    needs.  When registering, be sure to specify the version for Turbo Pascal
  179.    (such as TP4 or TP5) you wish to receive.
  180.  
  181.    Source Code - All registered users will receive source code when the signed
  182.    license agreement is returned with the registration.
  183.  
  184.  
  185.    CUSTOMER SERVICE
  186.  
  187.    If you have questions, comments, or suggestions, the Eagle can be contacted
  188.    by four means - (1) CompuServe, (2) telephone, (3) The Eagle BBS, or
  189.    (4) mail.
  190.  
  191.    CompuServe - The most dependable way to contact the Eagle is through
  192.    CompuServe.  James (Jim) H. LeMay has written the TP5 version of QWIK, but
  193.    the person to contact is Jordan Gallagher who can be contacted on the
  194.    Borland Forum by typing GO BPROGA from the CompuServe main menu.  You will
  195.    enter the Forum for Turbo Pascal.  You can contact Jordan with his PPN
  196.    number of 73557,2342.  Messages can also be left through EasyPlex.
  197.  
  198.    Telephone - Jordan can also be reached by phone at (214) 539-7855 on
  199.    weekdays and Saturday from 9:00 a.m. to 8:00 p.m CST.
  200.  
  201.    The Eagle BBS - You can also contact us on our 24-hour BBS at (214) 539-
  202.    9878, 1200/2400 N81.
  203.  
  204.    Mail - For registration or problems, please write:
  205.  
  206.        Eagle Performance Software
  207.        TP/TC products
  208.        P.O. Box 292786
  209.        Lewisville, TX  75029-2786
  210.  
  211.    In your written request for resolving problems, be sure to include:
  212.  
  213.      . A 5 1/4 inch diskette of compilable source code of the problem.
  214.      . The Eagle product and version number.
  215.      . The computer make and model.
  216.      . The type of video card, video monitor and keyboard.
  217.  
  218.  
  219.  
  220.  
  221.  
  222.    Chapter 1, Introduction                                             Page 4
  223.    QWIK Screen Utilities                            User's Guide, Version 5.5
  224.  
  225.  
  226.    ASP
  227.  
  228.    QWIK is a shareware program conforming to the standards of the Association
  229.    of Shareware Professionals (ASP).  You can get more information about ASP
  230.    by writing to:
  231.  
  232.      Association of Shareware Professionals
  233.      P.O. Box 5786
  234.      Bellevue,WA 98006
  235.  
  236.    This program is produced by a member of the Association of Shareware
  237.    Professionals (ASP).  ASP wants to make sure that the shareware principle
  238.    works for you.  If you are unable to resolve a shareware-related problem
  239.    with an ASP member by contacting the member directly, ASP may be able to
  240.    help.  The ASP Ombudsman can help you resolve a dispute or problem with an
  241.    ASP member, but does not provide technical support for member's products.
  242.    Please write to:
  243.  
  244.      ASP Ombudsman
  245.      P.O. Box 5786
  246.      Bellevue,WA 98006
  247.  
  248.    or send a CompuServe message via EasyPlex to ASP Ombudsman 7007,3536.
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.    Chapter 1, Introduction                                             Page 5
  284.    QWIK Screen Utilities                            User's Guide, Version 5.5
  285.  
  286.  
  287.    2.  G E T T I N G   S T A R T E D
  288.  
  289.    This section will acquaint you with the files on disk and show you a
  290.    brief demonstration.  You will also run your first program with QWIK and
  291.    then become familiar with all of the utilities.
  292.  
  293.  
  294.    DISTRIBUTION FILES
  295.  
  296.    In this version, QWIK55.ARC contains:
  297.  
  298.      Qwik55  .tpu:  Compiled unit of 2000 lines of assembly for TP5.
  299.      Qwik55  .pas:  Source code for QWIK55.TPU.  (MASM source code and
  300.                     object files are not included.)
  301.      Qwik55  .doc:  This document - a user's guide to QWIK.
  302.      QwikDemo.pas:  A demonstration program showing the features and
  303.                     speed of all procedures and is written primarily
  304.                     for color cards, but also works on mono cards.
  305.      QwikRef .doc:  QWIK Reference Guide document covering each
  306.                     procedure and variable in detail.
  307.      Qinitest.pas:  A program that verifies the equipment detected by
  308.                     the Qinit procedure.
  309.      Qbench  .pas:  A timing program that shows "screens/second" for
  310.                     typical QWIK procedures.
  311.      Strs    .pas:  Supplementary unit for number to string
  312.                     conversions.
  313.      TimerD12.inc:  Include file to measure elapsed time.
  314.      License .arc:  ARC file containing license agreements.
  315.  
  316.  
  317.    DEMONSTRATION
  318.  
  319.    To get an overview of the speed and features of QWIK, let's run a
  320.    demonstration program that came with the utilities.  Do the following
  321.    steps.
  322.  
  323.      1. Copy QWIK55.TPU to QWIK.TPU for TP5.
  324.      2. If you are running programs in a multi-tasking
  325.         environment, instruct the environment that you are NOT
  326.         writing direct to the screen.  Also set text pages to 2.
  327.      3. Make, compile and run QWIKDEMO.PAS to get a feel for
  328.         features and speed.
  329.      4. Press return when the screen prompts you to continue with
  330.         "... press any key".
  331.      5. Before running QINITEST.PAS, read the source code header
  332.         to see if you want to test for a computer submodel ID.
  333.  
  334.  
  335.    SIMPLE PROGRAMMING
  336.  
  337.    First Program - Let's write a short program to see how simple it is to
  338.    write with QWIK.  While in the TP editor, enter the following code:
  339.  
  340.      uses Crt,Qwik;
  341.      begin
  342.  
  343.  
  344.    Chapter 2, Getting Started                                          Page 6
  345.    QWIK Screen Utilities                            User's Guide, Version 5.5
  346.  
  347.  
  348.        TextAttr := Yellow+BlackBG;
  349.        ClrScr;
  350.        Qwrite (5, 1,Yellow+BlueBG,'QWIK writing');
  351.        Qwrite (5,13,Yellow+BlueBG,' is easy!');
  352.      end.
  353.  
  354.    Assuming you have already copied QWIK55.TPU to QWIK.TPU, compile and run
  355.    the code.  You can then see the text "QWIK writing is easy!" starting on
  356.    row 5, column 1.  On color monitors, the text is a yellow foreground with a
  357.    blue background while monochrome monitors show high intensity on black.
  358.  
  359.    Row/Col vs. X/Y - You probably noticed that the row parameter is first and
  360.    the column parameter is second.  Since QWIK is entirely for text modes, it
  361.    is more intuitive to specify the row first and the column second just like
  362.    any word processor.  The X/Y scheme is better suited for graphics.
  363.  
  364.    Attributes - Notice that our example uses the constant "BlueBG".  QWIK
  365.    provides eight convenient background color constants to use along with
  366.    Turbo's 16 foreground colors.  The same names are used, but the "BG" suffix
  367.    is added:
  368.  
  369.       BlackBG       RedBG
  370.       BlueBG        MagentaBG
  371.       GreenBG       BrownBG
  372.       CyanBG        LightGrayBG
  373.  
  374.    These allow QWIK to make the most of Turbo's constant folding.  By simply
  375.    adding the foreground and background constants together, the compiler saves
  376.    the result as a single word.  And, by simply reading the Qwrite statement,
  377.    what you see is what you get (WYSIWYG).
  378.  
  379.    Readable Code - As an added benefit, QWIK was designed with human factors
  380.    in mind and was made so that it is very easy to read the code you create.
  381.    With the row, column, and attribute parameters first and the string last,
  382.    you can see that the two Qwrite statements were easily aligned.  WYSIWYG to
  383.    the rescue again!
  384.  
  385.    Chaining - Notice that we had to calculate the string length of "QWIK
  386.    writing" before we could locate the string " is easy".  Let's modify the
  387.    last statement to indeed make it easier to locate the last string:
  388.  
  389.      uses Crt,Qwik;
  390.      begin
  391.        TextAttr := Yellow+BlackBG;
  392.        ClrScr;
  393.        Qwrite (5, 1,Yellow+BlueBG,'QWIK writing');
  394.        QwriteEos   (Yellow+BlueBG,' is easy!');
  395.      end.
  396.  
  397.    Now that was really easy!  How did QwriteEos know where to write?  QWIK
  398.    internally keeps track of an End-Of-String (EOS) marker so that any
  399.    subsequent "Eos" procedure like QwriteEos will chain the next string right
  400.    there - no rows or columns to calculate!  And you can chain as many as you
  401.    want on to any other QWIK procedure.
  402.  
  403.  
  404.  
  405.    Chapter 2, Getting Started                                          Page 7
  406.    QWIK Screen Utilities                            User's Guide, Version 5.5
  407.  
  408.  
  409.    Same Attribute - But suppose we did not want to change the attribute that
  410.    was already on the screen and don't even know what it is.  How is that
  411.    done?  Just modify the attributes to the following:
  412.  
  413.      uses Crt,Qwik;
  414.      begin
  415.        TextAttr := LightGray+BlackBG;
  416.        ClrScr;
  417.        Qwrite (5, 1,SameAttr,'QWIK writing');
  418.        QwriteEos   (SameAttr,' is easy!');
  419.      end.
  420.  
  421.    The special constant SameAttr (which is negative) tells QWIK to simply
  422.    enter the text on the screen without changing the attribute.  The result of
  423.    the program would show the text with LightGray on Black attributes.  This
  424.    special constant works on all QWIK utilities.  When assigned to a variable,
  425.    the attribute can even be switched at run time.
  426.  
  427.    Centering - Rather than having the text left justified, let's center the
  428.    text on the screen by modifying a portion of the code:
  429.  
  430.      ...
  431.        ClrScr;
  432.        QwriteC (5, 1,80,SameAttr,'QWIK writing is easy!');
  433.      end.
  434.  
  435.    This will place the text on row 5 centered between columns 1 and 80 which
  436.    is perfect for an 80 column text mode.  But what if other text or column
  437.    modes are used?  How can we ensure that it is always centered?  Only one
  438.    simple change is needed:
  439.  
  440.      ...
  441.        ClrScr;
  442.        QwriteC (5, 1,CRTcols,SameAttr,'QWIK writing is easy!');
  443.      end.
  444.  
  445.    The variable CRTcols always has the value of the column width that is
  446.    currently being used.  How does it know?  QWIK is initialized at startup by
  447.    executing a procedure called Qinit.  It detects a host of information about
  448.    your video configuration, everything from the type of video card you are
  449.    using to the shape of the cursor being used.  You can see a list of all
  450.    these variables available for your use in QWIKREF.DOC.
  451.  
  452.  
  453.    PROCEDURES AND FUNCTIONS
  454.  
  455.    Now that you have a basic idea of what QWIK can do, let's make a brief
  456.    survey of all the utilities in QWIK.TPU to just know what is available:
  457.  
  458.      One initializing procedure:
  459.  
  460.          Qinit       - Initializing procedure executed by QWIK.TPU which
  461.                        sets the global variables for the QWIK procedures.
  462.                        It should be executed again after a change from one
  463.                        text mode to another.
  464.  
  465.  
  466.    Chapter 2, Getting Started                                          Page 8
  467.    QWIK Screen Utilities                            User's Guide, Version 5.5
  468.  
  469.  
  470.  
  471.      Three quick direct screen writing procedures, all work with or
  472.      without attribute change:
  473.  
  474.          Qwrite      - For any type string or character (char).
  475.          QwriteC     - For any type string or char; self-centering.
  476.          QwriteA     - For any type variable, arrays or substrings.
  477.  
  478.      Four quick direct screen filling procedures in Rows-by-Cols block
  479.      parameters:
  480.  
  481.         Qfill        - Repetitive filling with the same character; with or
  482.                        without attribute change.
  483.         QfillC       - Same as Qfill, but self-centering.
  484.         Qattr        - Repetitive filling with an attribute only.
  485.         QattrC       - Same as Qattr, but self-centering.
  486.  
  487.      Two quick screen storing procedures:
  488.  
  489.         QstoreToMem  - Saves a Rows-by-Cols block to memory.
  490.         QstoreToScr  - Restores a Rows-by-Cols block to any screen page.
  491.  
  492.      Two quick screen storing procedures for copying blocks between a
  493.      screen (Scr) and a virtual screen (Vscr - a screen in memory):
  494.  
  495.         QScrToVscr   - Copies a Rows-by-Cols block from QWIK screen to
  496.                        virtual screen.
  497.         QVscrToScr   - Restores a Rows-by-Cols block from a virtual screen
  498.                        to the QWIK screen.
  499.  
  500.      Three quick screen reading functions for reading data from any
  501.      screen:
  502.  
  503.          QreadStr    - Reads a string of text.
  504.          QreadChar   - Reads a single character.
  505.          QreadAttr   - Reads an attribute.
  506.  
  507.      Two quick scrolling procedures work on any video page and also
  508.      virtual screens without flicker or snow:
  509.  
  510.          QscrollUp   - Scroll affected rows-by-cols block up.
  511.          QscrollDown - Scroll affected rows-by-cols block down.
  512.  
  513.      Two quick video page changing procedures:
  514.  
  515.          QviewPage   - Changes the page to be displayed - up to 8!
  516.          QwritePage  - Sets the page on which the QWIK procedures are
  517.                        writing.  You don't have to write just on the
  518.                        displayed page!
  519.  
  520.      Three quick cursor procedures and functions which work on any video
  521.      page.  They now work on the page being written rather than viewed:
  522.  
  523.          GotoRC      - Move cursor to absolute row and column coordinates
  524.                        rather than relative to a window.
  525.  
  526.  
  527.    Chapter 2, Getting Started                                          Page 9
  528.    QWIK Screen Utilities                            User's Guide, Version 5.5
  529.  
  530.  
  531.          WhereR      - Returns absolute cursor row.
  532.          WhereC      - Returns absolute cursor column.
  533.  
  534.      Eight quick EOS (End-Of-String) marker procedures and functions that
  535.      alter its position and/or the cursor.  The marker can be moved on the
  536.      CRT and virtual screens, while the cursor movement is only on the
  537.      page being written:
  538.  
  539.           GotoEos      - Moves cursor to EOS marker (like TP write).
  540.           EosR         - Returns absolute row of EOS marker.
  541.           EosC         - Returns absolute col of EOS marker.
  542.           EosToRC      - Sets EOS to a given row and column.
  543.           EosToRCrel   - Relatively shifts EOS by a number of rows and
  544.                          columns, and can be negative or positive.
  545.           EosToCursor  - Matches EOS to the cursor position.
  546.           EosLn        - Moves EOS to column 1 of the next row.
  547.           QEosLn       - Like EosLn, but scrolls up if past last row.
  548.  
  549.      Three cursor routines alter the cursor mode:
  550.  
  551.          GetCursor    - Get current cursor mode from low memory.
  552.          SetCursor    - Sets new cursor mode.
  553.          ModCursor    - Modifies cursor mode to on, off or erratic
  554.                         blink saving current scan lines.
  555.  
  556.      Four quick EOS writing procedures that chain write at the EOS marker:
  557.  
  558.          QwriteEos    - like Qwrite.
  559.          QwriteEosA   - like QwriteA.
  560.          QfillEos     - like Qfill.
  561.          QattrEos     - like Qattr.
  562.  
  563.      A Submodel identification routine:
  564.  
  565.          GetSubModelID - Optional procedure to find IBM submodel ID.
  566.  
  567.      A routine to set screen pointers to Multi-tasking video buffers:
  568.  
  569.          SetMultiTask - Alters QWIK to write to the multi-tasking buffer.
  570.  
  571.      Five string functions that convert integers and reals to strings by
  572.      using the supplementary STRS unit:
  573.  
  574.          StrL   - converts LongInt to string
  575.          StrLF  - converts LongInt to string in a fixed Field
  576.          StrR   - converts Real to string
  577.          StrRF  - converts Real to string in a fixed Field
  578.          StrRFD - converts Real to string in a fixed Field with a
  579.                   specified number of Decimals
  580.  
  581.    For a full description of each utility with its parameters, please refer to
  582.    QWIKREF.DOC for a summary of details and examples.
  583.  
  584.  
  585.  
  586.  
  587.  
  588.    Chapter 2, Getting Started                                          Page 10
  589.    QWIK Screen Utilities                            User's Guide, Version 5.5
  590.  
  591.  
  592.    3.  B A S I C   T E C H N I Q U E S
  593.  
  594.  
  595.    NUMBER TO STRING CONVERSION
  596.  
  597.    Str Procedure - TP5 handily converts numbers into strings with the Str
  598.    procedure.  For example:
  599.  
  600.      var MyNumber: integer;
  601.          MyString: string;
  602.      begin
  603.        Str (MyNumber:7,MyString);
  604.        Qwrite ( 1, 1,SameAttr,MyString);
  605.      end.
  606.  
  607.    But this means that a data area must be reserved and the code isn't as
  608.    readable as it could be.
  609.  
  610.    Str Functions - Instead, QWIK and the supplementary STRS unit let you use a
  611.    function form of Str:
  612.  
  613.      uses Qwik, Strs;
  614.      var MyNumber: integer;
  615.      begin
  616.        Qwrite ( 1, 1,SameAttr,StrLF(MyNumber,7));
  617.      end.
  618.  
  619.    Just like WriteLn, this lets the number remain in the Qwrite statement.
  620.    There are five functions in the STRS unit and they can be used just like
  621.    any other function:
  622.  
  623.      StrL   - converts LongInt to string
  624.      StrLF  - converts LongInt to string in a fixed Field
  625.      StrR   - converts Real to string
  626.      StrRF  - converts Real to string in a fixed Field
  627.      StrRFD - converts Real to string in a fixed Field with a specified
  628.               number of Decimals
  629.  
  630.    The suffixes mean:
  631.  
  632.      L - LongInt, but any scalar will work
  633.      R - Real
  634.      F - Field width that is right justified format
  635.      D - Number of decimals in the format
  636.  
  637.    The Str* functions actually use the Str procedure from TP5 to do the
  638.    conversion.  But with an InLine code trick, functions were created that
  639.    don't recopy the string for the greatest speed.  The code useage is
  640.    also reduced.
  641.  
  642.  
  643.    CURSOR MODE ROUTINES
  644.  
  645.    Three Routines - If you have ever struggled with controlling the shape of
  646.    the cursor, your life is about to be made easier.  With just three
  647.  
  648.  
  649.    Chapter 3, Basic Techniques                                         Page 11
  650.    QWIK Screen Utilities                            User's Guide, Version 5.5
  651.  
  652.  
  653.    routines, SetCursor, GetCursor, and ModCursor, you can consistently and
  654.    reliably control the cursor mode (shape and visibility) on any video card!
  655.  
  656.    Four Standard Modes - To make it even easier, four standard cursor mode
  657.    variables are initialized at startup to fit the exact requirements of the
  658.    detected video card.  They are:
  659.  
  660.      CursorUnderline - The standard underline cursor.
  661.      CursorHalfBlock - The half block shape usually used for insert
  662.                        editing.
  663.      CursorBlock     - An easy to find full cell cursor.
  664.      CursorInitial   - The mode detected at start up.
  665.  
  666.    So, if we wanted a full block cursor, only one line of code is needed:
  667.  
  668.      SetCursor (CursorBlock);
  669.  
  670.    And that's it!  There's nothing else to figure out - even if you are using
  671.    something like 43-row mode on an EGA card.  When ending your programs, you
  672.    can get back to the original cursor mode by using:
  673.  
  674.      SetCursor (CursorInitial);
  675.  
  676.    Hidden Cursor - Many programs need to hide the cursor altogether.  This can
  677.    be done with ModCursor:
  678.  
  679.      ModCursor (CursorOff);
  680.  
  681.    Why use ModCursor instead of SetCursor?  ModCursor leaves the shape of the
  682.    cursor alone, and only alters bits 13 and 14 of the cursor mode to turn it
  683.    on or off.  In fact there are three constants that are useful with
  684.    ModCursor:
  685.  
  686.      CursorOff   ($2000) - To turn the cursor off.
  687.      CursorOn    ($0000) - To turn the cursor back on with the same shape.
  688.      CursorBlink ($6000) - To create erratic blinking on MDA/CGA.  (On
  689.                            EGA/VGA, it turns the cursor off.)
  690.  
  691.    Using your imagination, you can also mix and match the constants and
  692.    variables by logically summing them.  Let's say we want to change the shape
  693.    of the cursor to a block while it is still turned off:
  694.  
  695.      SetCursor (CursorBlock or CursorOff);
  696.  
  697.    So, the next time ModCursor(CursorOn) is used, the cursor will be a full
  698.    block.  As a suggestion for terminating your program, be sure to restore
  699.    the cursor in your exit procedure with:
  700.  
  701.      SetCursor (CursorInitial);
  702.  
  703.    GetCursor - This function simply returns the current cursor mode value
  704.    stored in low memory allowing you to save it for later use.
  705.  
  706.  
  707.  
  708.  
  709.  
  710.    Chapter 3, Basic Techniques                                         Page 12
  711.    QWIK Screen Utilities                            User's Guide, Version 5.5
  712.  
  713.  
  714.    CURSOR LOCATION ROUTINES
  715.  
  716.    QWIK has three routines that complement the CRT unit - GotoRC, WhereR, and
  717.    WhereC.  They correspond with the familiar GotoXY, WhereX, and WhereY.
  718.    However, there are some important differences:
  719.  
  720.      . The QWIK routines are absolute to the screen and are not restricted
  721.        by the Turbo window.
  722.      . The suffixes "R" and "C" mean row and column, so the parameters of
  723.        GotoRC are reversed from GotoXY.
  724.      . The QWIK routines will also work on any video page.  This is
  725.        explained in the Advanced Techniques section later.
  726.  
  727.    This is not the only way to move the cursor.  The EOS marker is also a very
  728.    powerful aid as you will see in the next topic.
  729.  
  730.  
  731.    EOS MARKER
  732.  
  733.    Invisible Alternate Cursor - From the examples in the Simple Programming
  734.    topic, we found that we could easily chain two strings together using the
  735.    EOS marker.  In fact, this marker is so versatile, the EOS marker utilities
  736.    can be made interchangeable with the cursor, but much faster.  You could
  737.    think of it as an alternate cursor that is invisible.
  738.  
  739.    Keeping Track - Any time a QWIK writing procedure is used, the EOS marker
  740.    is updated.  It is actually saved as the global variable QEosOfs.
  741.    Technically, the value is the offset from the screen base and is a 0-based
  742.    byte count.  For example, if the following procedure was executed:
  743.  
  744.      Qwrite (6,5,Yellow,'Important Data');
  745.  
  746.    the EOS would be at row 6, column 19, right after the word "Data".  The
  747.    value of QEosOfs on an 80 column screen would be:
  748.  
  749.      QEosOfs = ((Row-1)*CRTcols + (Col-1)) * 2 = 836
  750.  
  751.    QWIK does not need to calculate this value, but simply saves it after
  752.    writing, so it is very efficient.  From the overview, you are already aware
  753.    of the four routines that will start writing at this marker - QwriteEos,
  754.    QwriteEosA, QfillEos, and QattrEos.  But what about changing the location
  755.    of the marker itself?  Keep reading.
  756.  
  757.    Moving the Marker - QWIK has four routines that will manually move the EOS
  758.    marker:
  759.  
  760.      EosToRC      - Sets EOS to a given row and column.
  761.      EosToRCrel   - Relatively shifts EOS by a number of rows and
  762.                     columns, and can be negative or positive.
  763.      EosLn        - Moves EOS to column 1 of the next row.
  764.      QEosLn       - Like EosLn, but scrolls up if past last row.
  765.  
  766.    The basic procedure EosToRC moves the EOS marker exactly like GotoRC does
  767.    for the cursor.  But there are also several ways to move the marker
  768.    relatively.  Let's test a short program:
  769.  
  770.  
  771.    Chapter 3, Basic Techniques                                         Page 13
  772.    QWIK Screen Utilities                            User's Guide, Version 5.5
  773.  
  774.  
  775.  
  776.      uses Crt,Qwik;
  777.      begin
  778.        TextAttr := Yellow;
  779.        ClrScr;
  780.        Qwrite     ( 1, 1,Yellow+BlueBG,'First  Row ');
  781.        EosLn;                                           { Jump to (2,1) }
  782.        QwriteEos        (Yellow+BlueBG,'Second Row ');
  783.        EosToRC    ( 3, 1);                              { Jump to (3,1) }
  784.        QwriteEos        (Yellow+BlueBG,'Third  Row ');
  785.        EosToRCrel ( 1,-4);                              { Jump to (4,8) }
  786.        QwriteEos        (Yellow+BlueBG,       'etc.');
  787.        EosToRC    (succ(EosR),8);                       { Jump to (5,8) }
  788.        QwriteEos        (Yellow+BlueBG,       'etc.');
  789.      end.
  790.  
  791.    Compile and run the program.  You should see "Row" and "etc." all aligned
  792.    in one column.  So, you can see that there are several simple ways to move
  793.    the marker!
  794.  
  795.    EOS and the Cursor - You can also interface the EOS marker and the cursor
  796.    with two procedures:
  797.  
  798.      GotoEos      - Moves cursor to match the EOS marker.
  799.      EosToCursor  - Sets the EOS marker to match the cursor position.
  800.  
  801.    It can't get any simpler than that!  Now you can see that:
  802.  
  803.      Qwrite (1,1,Yellow,'Test Line');
  804.      GotoEos;
  805.  
  806.    and,
  807.  
  808.      TextAttr := Yellow;
  809.      GotoXY (1,1);
  810.      Write ('Test Line');
  811.  
  812.    produce identical results.  But QWIK is much faster!
  813.  
  814.  
  815.    SCROLLING
  816.  
  817.    Improved Control - With the CRT unit, you can only control the full screen
  818.    size with WriteLn.  But with the two QWIK routines, QscrollUp and
  819.    QscrollDown, you can define any area to be scrolled:
  820.  
  821.       QscrollUp ( 2, 2,CRTrows-2,CRTcols-2,MyAttr);
  822.  
  823.    This example scrolls a portion of the screen starting at (2,2) leaving a
  824.    one character border.  In a 25x80 text mode, it clears row 24 from column 2
  825.    to 79.  In addition, the cleared row attribute is MyAttr.
  826.  
  827.    Improved Performance - With QscrollDown and QscrollUp (called Qscroll* for
  828.    brevity), your programs can overcome the BIOS problems on many machines.
  829.    Transparent to you, these procedures work on all cards and machines without
  830.  
  831.  
  832.    Chapter 3, Basic Techniques                                         Page 14
  833.    QWIK Screen Utilities                            User's Guide, Version 5.5
  834.  
  835.  
  836.    flicker or snow and operate at three speeds:
  837.  
  838.      Maximum  - for video cards without snow
  839.      Fast CGA - for CGA cards on 80286 machines or better
  840.      Slow CGA - for CGA cards on 8086/8088 machines
  841.  
  842.    Qinit detects the CPU ID and video card to select the fastest algorithm.
  843.    All speeds use 16-bit transfers rather than 8-bit.  So, you can be assured
  844.    of the highest performance.
  845.  
  846.    Cursor Location - These routines do not move the cursor.  However, EOS is
  847.    pointing to the first column of the blank line and GotoEos will move the
  848.    cursor there if needed.
  849.  
  850.    QEosLn - This procedure is another alternative to full screen scrolling.
  851.    It has the same function as EosLn, but will additionally scroll the screen
  852.    up if the EOS marker is past the last row.  Then it simply calls QscrollUp.
  853.    The attribute of the cleared row is the global variable ScrollAttr.  You
  854.    must set this prior to using QEosLn.
  855.  
  856.  
  857.    POP-UP WINDOWS
  858.  
  859.    QWIK has the basic tools to create and remove pop-up windows.  Let's try to
  860.    create one.  While in the TP editor, enter the following code:
  861.  
  862.      uses Crt,Qwik;
  863.      var
  864.        MyWindow,MyUnderlay: array[1..250] of word;
  865.      begin
  866.        { -- Fill the screen with a hatch character. -- }
  867.        Qfill ( 1, 1,CRTrows,CRTcols,LightGray+BlackBG,#176);
  868.        { -- Create a pop-up window.-- }
  869.        QstoreToMem ( 5,12,10,25,MyUnderlay);  { Save area to be covered }
  870.        Qfill       ( 5,12,10,25,Black+LightGray,' ');  { Clear the area }
  871.        QwriteC (9,12,36,SameAttr,'Pop-Up Window');     { Label window   }
  872.        delay (1000);                                   { Wait a sec     }
  873.        QstoreToMem ( 5,12,10,25,MyWindow);             { Save a copy    }
  874.        QstoreToScr ( 5,12,10,25,MyUnderlay);           { Restore screen }
  875.        { -- Move window some where else. -- }
  876.        QstoreToMem ( 8,25,10,25,MyUnderlay);  { Save area to be covered }
  877.        QstoreToScr ( 8,25,10,25,MyWindow);             { Move window    }
  878.        delay (1000);                                   { Wait a sec     }
  879.        { -- Remove window. -- }
  880.        QstoreToScr ( 8,25,10,25,MyUnderlay);           { Restore screen }
  881.      end.
  882.  
  883.    Compile and run the code.  You will see a 10 row by 25 column window
  884.    located at (5,12) which is row 5, column 12 .  After one second, it will be
  885.    moved to (8,25).  Then after another second, it is removed from the screen.
  886.    We did a lot of work with very little code!
  887.  
  888.    Rows-by-Cols - QstoreToScr and QstoreToMem are screen saving and restoring
  889.    procedures that conveniently work in row-by-column blocks.  They
  890.    accommodate any column mode, so there is no need to be concerned about
  891.  
  892.  
  893.    Chapter 3, Basic Techniques                                         Page 15
  894.    QWIK Screen Utilities                            User's Guide, Version 5.5
  895.  
  896.  
  897.    screen width.
  898.  
  899.    Memory Requirements - Notice that QstoreToMem wrote the data direct to
  900.    memory in MyWindow.  It is important that the memory allocated to that
  901.    variable is correct to prevent it from overwriting any other variables.
  902.    The array size chosen was a 250 word array which is a perfect fit since one
  903.    word is needed for each character and attribute on the screen.  If you
  904.    prefer, the heap can also be used such as:
  905.  
  906.      var MyUnderlay: pointer;
  907.      begin
  908.        GetMem (MyUnderlay,500);
  909.        QstoreToMem ( 5,12,10,25,MyUnderlay^);
  910.        { ... }
  911.        FreeMem (MyUnderlay,500);
  912.      end.
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.    Chapter 3, Basic Techniques                                         Page 16
  955.    QWIK Screen Utilities                            User's Guide, Version 5.5
  956.  
  957.  
  958.    4.  A D V A N C E D   T E C H N I Q U E S
  959.  
  960.    This section will acquaint you with the powerful virtual screen writing
  961.    features already built into QWIK.  You will also find out easy it is to
  962.    work on multiple video pages and how to accommodate video mode changes.
  963.  
  964.  
  965.    VIRTUAL SCREENS
  966.  
  967.    This topic will show you how to create and use powerful virtual screens.
  968.  
  969.    Virtual Screen - Just what is a virtual screen?  It is a screen maintained
  970.    in RAM of any dimensions that can be reproduced on the CRT in full or in
  971.    part.  The advantages are:
  972.  
  973.      . Variable row-by-column screen
  974.      . Large video buffer up to 64k
  975.      . High speed in RAM
  976.      . Unlimited number of screens
  977.  
  978.    Screen Record - QWIK uses seven variables to define any screen.  At start
  979.    up, QWIK initializes them to the video system detected:
  980.  
  981.      CRTrows  - Number of rows
  982.      CRTcols  - Number of columns
  983.      CRTsize  - Byte allocation for screen
  984.      Qsnow    - True if snow checking needed
  985.      QEosOfs  - EOS offset
  986.      QScrOfs  - Screen offset
  987.      QScrSeg  - Screen segment
  988.  
  989.    To make data access even easier, all these variables are contained in the
  990.    record QScrRec of VScrRecType.  In addition, QScrPtr is absolute to QScrOfs
  991.    and QScrSeg.  This gives QWIK a true far pointer, so screens can be
  992.    anywhere in memory and not just paragraph aligned!
  993.  
  994.    Creating Virtual Screens - In three easy steps, you can easily create a
  995.    virtual screen:
  996.  
  997.      1. Allocate memory for the screen.
  998.      2. Save the current screen record.
  999.      3. Modify the screen record for the virtual screen.
  1000.  
  1001.    Let's write some code that does just that:
  1002.  
  1003.      uses Qwik;
  1004.      var  CRTrec,VScrRec: VScrRecType;
  1005.      begin
  1006.        with VScrRec do             { create specs for virtual screen }
  1007.          begin
  1008.            Vrows := 80;            { Let's choose 80 rows }
  1009.            Vcols := 100;           { Let's choose 100 columns }
  1010.            Vsize := Vrows * Vcols shl 1;
  1011.            Vsnow := false;         { Can always be false }
  1012.            VEosOfs := 0;           { Be safe and start at the base }
  1013.  
  1014.  
  1015.    Chapter 4, Advanced Techniques                                      Page 17
  1016.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1017.  
  1018.  
  1019.            GetMem (VScrPtr,Vsize); { Allocate heap space }
  1020.          end;
  1021.        CRTrec  := QScrRec;         { Save CRT specs     }
  1022.        QScrRec := VScrRec;         { Set virtual specs  }
  1023.        { ... }                     { Write to the virtual screen }
  1024.        QScrRec := CRTrec;          { Restore CRT specs when done! }
  1025.      end.
  1026.  
  1027.    Now, when you use any QWIK routine, they can be directed to the virtual
  1028.    screen - writing, reading, scrolling, wrapping, and everything you would
  1029.    expect.  Qsnow can always be false when writing to virtual screens since
  1030.    RAM is used and not video card memory.
  1031.  
  1032.    Cursor Control - One thing not available to virtual screens is cursor
  1033.    movement, because the cursor location is reserved by DOS for just video
  1034.    pages.  That means there is no cursor available for virtual screens.  So,
  1035.    how can we get around this?  The EOS marker comes to the rescue as an
  1036.    indispensable cursor!  All EOS routines can still be used as before.
  1037.  
  1038.    Taking a Peek - At some time, we will need to take a look at all or a
  1039.    portion of the virtual screen by copying it to the CRT.  Two inter-screen
  1040.    procedures do this by blocks at high speed - QScrToVscr and QVscrToScr.
  1041.    Here are the parameters of QVscrToScr:
  1042.  
  1043.      QVscrToScr (Row,Col,Rows,Cols,Vrow,Vcol,Vwidth,VScrPtr);
  1044.  
  1045.    Just like QstoreToScr, Row, Col, Rows, and Cols describe the position and
  1046.    size on the screen (Scr).  This screen is specified by QScrRec which is
  1047.    usually the CRT.  VScrPtr points to the virtual screen (Vscr).  Now, where
  1048.    is the same size block on Vscr?  It's at Vrow and Vcol.  But the Vscr may
  1049.    have a different column width than CRTcols.  So you specify that with
  1050.    Vwidth.  Only the Scr side checks for possible snow.  These procedures are
  1051.    extremely fast making virtual screens very practical.  See QScrToVscr and
  1052.    QVscrToScr in QWIKREF.DOC for more examples.
  1053.  
  1054.    Multiple Virtual Screens - By changing QScrRec, you can even copy blocks
  1055.    from one virtual screen to another!  These routines do not affect QEosOfs.
  1056.  
  1057.  
  1058.    VIDEO PAGES
  1059.  
  1060.    Multi-page Cards - TP5 procedures such as Write, Window, and GotoXY are
  1061.    dedicated to just page 0, but many video cards have more than one page.  If
  1062.    you have a CGA or better, you already have memory on your card for 4 to 8
  1063.    pages.  Since the BIOS recognizes them as well, QWIK gives you access to
  1064.    these extra pages.
  1065.  
  1066.    Page Control - QwritePage and QviewPage give you the power to use QWIK on
  1067.    all video pages and display which ever you choose.  On a multiple-video
  1068.    page card like CGA, you can simply code:
  1069.  
  1070.      QwritePage (MyPage);
  1071.  
  1072.    to make all QWIK routines be directed to your selected video page even
  1073.    though you could be viewing another page.  To view a page, you can in turn
  1074.  
  1075.  
  1076.    Chapter 4, Advanced Techniques                                      Page 18
  1077.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1078.  
  1079.  
  1080.    simply code:
  1081.  
  1082.      QviewPage (MyPage);
  1083.  
  1084.    Tips About Pages - Here are some tips to keep in mind when using several
  1085.    video pages:
  1086.  
  1087.      . The highest valid video page is detected by Qinit and saved in the
  1088.        variable MaxPage.
  1089.      . Invalid page parameters are just ignored.
  1090.      . The BIOS reserves a separate cursor location for each of up to 8
  1091.        video pages.
  1092.      . There is only one possible cursor mode which is always displayed on
  1093.        the CRT.
  1094.      . The cursor location routines operate on the page being written
  1095.        rather than viewed.
  1096.      . The current video page viewed is found with VideoPage.
  1097.      . The current video page set by QwritePage is saved in QvideoPage.
  1098.      . Be sure to end your programs with "QviewPage (0);".
  1099.  
  1100.  
  1101.    VIDEO MODES
  1102.  
  1103.    CRT Unit - If you intend to use the CRT unit with QWIK, it is best to place
  1104.    the CRT unit first in the "USES" list.  When the CRT runs its
  1105.    initialization code, it checks for the video mode to see if it is a valid
  1106.    text mode (0..3,7).  If so, it remains in that mode.  If not, it is in a
  1107.    graphics or extended column mode and is forced back into the computer's
  1108.    default text mode as set by the equipment flag at $40:$10.  By having the
  1109.    CRT unit first, you can be assured of a valid text mode when Qinit is run.
  1110.  
  1111.    Changing Text Modes - Your application may require a change in video modes
  1112.    for different row or column modes.  If so, after the mode is changed, run
  1113.    Qinit again so the video variables will be correct.
  1114.  
  1115.    TextAttr - Be advised that a change of text modes with the CRT unit will
  1116.    also change TextAttr.  It is set to what ever attribute is at the cursor.
  1117.  
  1118.    Graphic Modes - If you need to alternate with a graphics mode, Qinit does
  1119.    not need to be run provided you return back to the same text mode.  Of
  1120.    course you may want to save the screen with QstoreToMem before switching to
  1121.    graphics.
  1122.  
  1123.    Changing Monitors - The technique to change monitors is to simply change
  1124.    the text mode.  This means Qinit should be run again.  Be sure to toggle
  1125.    the video mode bits in the equipment list byte at $40:$10 so other
  1126.    applications can behave properly.
  1127.  
  1128.    CursorInitial - When QWIK is initialized, CursorInitial saves what it
  1129.    detects for the current video mode.  Whenever Qinit is run again,
  1130.    CursorInitial is also changed.  This may affect how you restore the cursor
  1131.    when terminating.  If needed, the value should be saved before using Qinit.
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.    Chapter 4, Advanced Techniques                                      Page 19
  1138.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1139.  
  1140.  
  1141.    MULTI-TASKING ENVIRONMENTS
  1142.  
  1143.    Multi-Tasking - QWIK works very well with multi-tasking environments such
  1144.    as DESQview.  For examples on how to let QWIK work in DESQview
  1145.    specifically, see a file called DESQ5X.ARC or a later version.
  1146.  
  1147.    SetMultiTask - A simple procedure has been included that generically
  1148.    detects the presence of DESQview, TopView, TaskView, OmniView, MS Windows
  1149.    or IBM 3270 PC multi-tasking video buffers (MTVB).  If they are being used,
  1150.    SetMultiTask will alter QScrPtr, Page0seg, and Qsnow correctly.  This is a
  1151.    very simple task.  All of the *.PAS files included with the code show where
  1152.    the SetMultiTask declaration is to be placed early in the program.  If you
  1153.    are unsuccessful in getting it to work as you would expect, give us a call.
  1154.  
  1155.    InMultiTask - If SetMultiTask did indeed alter QScrPtr for the MTVB, then
  1156.    InMultiTask is set to true.
  1157.  
  1158.    Multiple Video Pages - Be sure to instruct the multi-tasking environment of
  1159.    the number of video pages that are being used for your program.  Since some
  1160.    environments cannot correctly use multiple pages with the MTVB such as
  1161.    DESQview 2.01, it has been disabled in the demos with the use of
  1162.    InMultiTask.
  1163.  
  1164.    Cursor Routines and the BIOS - All cursor routines that change the mode and
  1165.    location use the BIOS.  This way multi-tasking environments can handle
  1166.    redirection properly.
  1167.  
  1168.  
  1169.    INTERRUPTS
  1170.  
  1171.    Within QWIK - QWIK only uses video interrupt $10 for Qinit and the cursor
  1172.    routines so there no problem with DOS re-entry.  Please read about "System
  1173.    Hardware" on page 22 for more information on procedure GetSubModelID which
  1174.    uses INT $15.
  1175.  
  1176.    Creating Handlers - If you use interrupt calls (like a clock display)
  1177.    within your program that use QWIK routines, be sure to save and restore the
  1178.    value of QScrRec in the call so it won't return to the main program with
  1179.    unexpected results.  You should also be aware that main program may be
  1180.    writing to a virtual screen during the interrupt, so it is best that you
  1181.    initialize a copy of a QScrRec solely for the interrupt.
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.    Chapter 4, Advanced Techniques                                      Page 20
  1199.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1200.  
  1201.  
  1202.    5.  H A R D W A R E   D E T E C T I O N
  1203.  
  1204.  
  1205.    DISPLAY COMBINATION CODE
  1206.  
  1207.    Qinit Procedure - Qinit initializes all the variables needed for the QWIK
  1208.    procedures.  And specifically checks for ALL IBM video equipment including
  1209.    dual monitors.  Qinit is initialized by the unit at start up.
  1210.  
  1211.    Display Combination Code (DCC) - The PS/2 video BIOS has a new function
  1212.    that simplifies equipment detection called the Read/Write Display
  1213.    Combination Code.  Using interrupt $10 with AH = $1A00, the call will
  1214.    return the Active Display Device in BL and the Alternate Display Device in
  1215.    BH.  If the function is supported, it also returns $1A to AL.  For the
  1216.    possible Display Device codes which have been assigned by IBM, see
  1217.    QWIKREF.DOC.
  1218.  
  1219.    Conforming to DCC - No results are obtained for the DCC on anything other
  1220.    than PS/2 equipment.  However, to be consistent, Qinit was reprogrammed to
  1221.    conform to the DCC for ALL equipment.  To see if a CGA is in use, simply
  1222.    check to see if ActiveDispDev=CgaColor.  Qinit only sets the parameters for
  1223.    the active display.
  1224.  
  1225.    Dual Monitors - Qinit detects dual monitors and saves both the active and
  1226.    alternate display device codes.  The alternate display device code is for
  1227.    testing purposes only.  If you change monitors in a running program, Qinit
  1228.    should be executed again.
  1229.  
  1230.    Testing for Dual Monitors - Qinit makes an attempt to detect for a second
  1231.    monitor by several means.  If no alternate cards like EGA or VGA are found,
  1232.    an alternate 6845 video chip (CGA, MDA, or Hercules) is checked.  If the
  1233.    chip is found, then further tests are made to find which card it could be.
  1234.    The chip existence test is highly reliable.  If no alternate display device
  1235.    is found, then AltDispDev=NoDisplay.
  1236.  
  1237.    HavePS2 - Qinit sets HavePS2 to true if the DCC is supported.  This means
  1238.    that the program has detected a PS/2 video card whether it is integrated in
  1239.    a Model 30, a PS/2 Display Adapter installed on an IBM XT, or the like.  It
  1240.    also means that either MCGA or VGA is present, but not necessarily active.
  1241.    To know which, just check the DCC.
  1242.  
  1243.    Have3270 - If Qinit detects 3270 PC equipment/software, this variable is
  1244.    set to true.  In addition, the ActiveDispDev is either MdaMono or CgaColor.
  1245.    Note: There may or may not be graphics capability in either case; Qinit is
  1246.    not meant to detect graphics.  If Have3270 is true, then ActiveDispDev3270
  1247.    will be set to the proper code.  On the 3270 PC, dual monitors are not
  1248.    possible as they use the same physical buffer space.  In addition, even
  1249.    though a color monitor maybe used, there is only one video page unless
  1250.    there is a special adapter.  However, Qinit will determine if more than
  1251.    just one page is available.  The 3270 PC also does not support 40 column
  1252.    modes.
  1253.  
  1254.    EGA Switches - By checking the value of this byte, you can determine the
  1255.    monitor connected to the EGA, the alternate video system, and the start up
  1256.    default.  The byte is a copy of how the dip switches are set on the card
  1257.  
  1258.  
  1259.    Chapter 1, Hardware Detection                                       Page 21
  1260.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1261.  
  1262.  
  1263.    where on=0 and off=1.  The primary is the default.  When the ECD is set for
  1264.    640x200, it is emulating the CD including the cursor mode.  Qinit now
  1265.    directly tests for the alternate device rather than assuming it.
  1266.  
  1267.    EGA Information - The byte located at $0040:$0087 has hardware status
  1268.    information when the EGA (or VGA) is present.
  1269.  
  1270.    PC Convertible (PCC) - Since the PCC also does not support the DCC, a
  1271.    separate code is used.  If the 5140 LCD is used in mode 7, the Active
  1272.    Display Device is set to MdaMono which is close enough.  This set up can be
  1273.    verified by testing if MaxPage=3.  The alternate display is found by using
  1274.    interrupt $10 with AH=$15.  The result is saved in AltDispDevPCC.  Of
  1275.    course the variable is undefined if a PCC is not used.
  1276.  
  1277.    Hercules - Hercules cards are also detected.  If either the active or
  1278.    alternate DCC is MdaMono, which is found by verifying a responsive 6845
  1279.    video chip at the mono register port, then an attempt is made to find if
  1280.    any Hercules card is attached.  If no Hercules card is found, then
  1281.    HercModel=NoHerc; it is then assumed that just an MDA card is attached.
  1282.    Because the test can take up to 1/3 of a second on slower computers, this
  1283.    test is only run once, even if Qinit is executed again.  The tests for the
  1284.    Hercules cards are the ones recommended by Hercules Computer Technology,
  1285.    which also admits that sometimes the tests will fail during multi-tasking
  1286.    activity.  Hercules clones may not be detected by these tests, but the DCC
  1287.    will be correct.
  1288.  
  1289.  
  1290.    SNOW CHECKING
  1291.  
  1292.    CGA Snow - QWIK is conservative with CGA cards and uses snow checking when
  1293.    the card is detected.  However, it is not needed in 40 column modes 0 and
  1294.    1.  Qinit was programmed to accommodate this.  For other hardware, you can
  1295.    change Qsnow to suit your needs, but CardSnow should be left unchanged to
  1296.    save what Qinit detected.
  1297.  
  1298.    Zenith CGA - Zenith CGAs do not need wait-for-retrace.  If you would like
  1299.    to accommodate this, you can execute the following procedure early in your
  1300.    programs and to be run after each Qinit:
  1301.  
  1302.      procedure CheckZenith;
  1303.      var  ZdsRom: array[1..8] of char absolute $F000:$800C;
  1304.      begin
  1305.        if Qsnow and (ZdsRom='ZDS CORP') then
  1306.          begin
  1307.            Qsnow    := false;
  1308.            CardSnow := false;
  1309.          end;
  1310.      end;
  1311.  
  1312.    CheckSnow - If you plan on using the standard CRT unit, place the following
  1313.    line early in your programs and after each Qinit.
  1314.  
  1315.      CheckSnow := Qsnow;
  1316.  
  1317.    Qinit appears to be more extensive in it's testing for wait-for-retrace.
  1318.  
  1319.  
  1320.    Chapter 1, Hardware Detection                                       Page 22
  1321.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1322.  
  1323.  
  1324.    Then, Write and WriteLn will work faster if DirectVideo is true.
  1325.  
  1326.    Critical Timing - The timing on the IBM PC (Intel 8088 at 4.77MHz) with a
  1327.    CGA is critical for storing characters and attributes with 16-bit transfers
  1328.    because of the CPU architecture and slow speed.  Although previous versions
  1329.    kept the timing as tight as possible, there still remained a hint of snow
  1330.    in column 1.  This is due to the problem that RAM runs a little slower than
  1331.    BIOS ROM.  This problem has now been solved with a minor code change.  So
  1332.    the routines still run at the same speed, but there is absolutely no snow!
  1333.    I am not aware of any other routines that have done this as closely.
  1334.    (Computers with slower access RAM chips may still show up some variations
  1335.    from time to time.  Feedback is requested.)
  1336.  
  1337.  
  1338.    SYSTEM HARDWARE
  1339.  
  1340.    System ID - The basic computer system identification (or model) for IBM
  1341.    computers can be found by directly accessing the byte in memory at
  1342.    $F000:$FFFE.
  1343.  
  1344.    SubModel ID - After production of the AT, models were also given Submodel
  1345.    IDs.  To get both the model and submodel ID, you must use interrupt $15
  1346.    with AH=$C0 which only works on some computers.  A few PC and XT clones
  1347.    like the AT&T 6300 will actually crash when this interrupt is executed due
  1348.    to BIOS bugs.  So to prevent this from happening, the procedure only lets
  1349.    SystemIDs of $FC or less get the SubModelID.  In addition, it was made into
  1350.    a separate procedure called GetSubModelID and is no longer apart of Qinit.
  1351.    So you will have to execute it yourself to get a result.  The routine is
  1352.    entirely optional and is not required by QWIK.
  1353.  
  1354.    CPU Identification - A CPU detection routine has been included for Intel
  1355.    processors.  It is useful for clones that do not recognize IBM's system ID
  1356.    scheme.  The idea came from Juan Jimenez as it appeared in Jan/Feb '88
  1357.    Turbo Technix magazine.  The routine has been simplified for reduced code
  1358.    (only 42 bytes) and enables use of simple constant identifiers.  This
  1359.    routine is required for Qscroll*.
  1360.  
  1361.  
  1362.    TIPS
  1363.  
  1364.    EgaMono - You should be aware that another constant also named EGAMono is
  1365.    used by the DetectGraph procedure in the Graph unit, but fortunately, they
  1366.    have the same value!
  1367.  
  1368.    Longer names - If you wish to be more explicit with procedure, function,
  1369.    and variable names, you can always add the unit name as a prefix:
  1370.  
  1371.      Qwik.GotoRC (1,1);
  1372.      MyCols:=Qwik.CRTcols;
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.    Chapter 1, Hardware Detection                                       Page 23
  1382.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1383.  
  1384.  
  1385.    A P P E N D I X   A :  V I D E O   M O D E   T A B L E
  1386.  
  1387.  
  1388.    Video Modes - To help you figure out how the all IBM video systems are
  1389.    configured, it is helpful to have a table of all the possible Alphanumeric
  1390.    (A/N or text) modes.  QWIK was not designed for the All Points Addressable
  1391.    (APA or graphics) modes.
  1392.  
  1393.              TABLE 1: Hardware Specific Video Mode Characteristics
  1394. -------------------------------------------------------------------------------
  1395. Mode Format Segment Display Box  MDA CGA EGA MCGA VGA PCjr PCC 3270 HGC MaxPage
  1396. ---- ------ ------- ------- ---- --- --- --- ---- --- ---- --- ---- --- -------
  1397. 0,1  40x25  B800:0  320x200 8x8       x   x   x    x   x    x              7
  1398.                     320x350 8x14          x        x                       7
  1399.                     320x400 8x16              x                            7
  1400.                     360x400 9x16                   x                       7
  1401. 2,3  80x25  B800:0  640x200 8x8       x                x    x              3
  1402.                     640x200 8x8           x        x                       7 *
  1403.                     640x350 8x14          x        x                       7 *
  1404.                     640x400 8x16              x                            7
  1405.                     720x350 9x14                                x          0+
  1406.                     720x400 9x16                   x                       7
  1407. 7    80x25  B000:0  720x350 9x14  x                         x   x    x     0
  1408.                     720x350 9x14          x        x                       7 *
  1409.                     720x400 9x16                   x                       7
  1410.                     640x200 8x8                             x              3
  1411. -------------------------------------------------------------------------------
  1412.  
  1413.      Legend:
  1414.      Format  - Characters per row by the number of rows in the data area.
  1415.      Segment - Address of the first character on page 0 of the display
  1416.                buffer.
  1417.      Display - The pixel resolution for the data area excluding the
  1418.                border, horizontal by vertical.
  1419.      Box     - The pixel resolution for each character, horizontal by
  1420.                vertical.
  1421.      MDA     - Monochrome Display and Printer Adapter
  1422.      CGA     - Color Graphics Adapter
  1423.      EGA     - Enhanced Graphics Adapter
  1424.      PGC     - Professional Graphics Controller
  1425.      MCGA    - Multi-Color Graphics Array
  1426.      VGA     - Video Graphics Array
  1427.      PCjr    - PC Junior
  1428.      PCC     - PC Convertible
  1429.      HGC     - Hercules Graphics Cards - HGC, HGC Plus, and InColor Card
  1430.      3270    - All IBM 3270 PC adapters
  1431.      MaxPage - 0-based highest page number; e.g. 7 means there are 8
  1432.                pages.
  1433.      MD      - 5151 Monochrome Display
  1434.      CD      - 5153 Color Display
  1435.      ECD     - 5154 Enhanced Color Display
  1436.  
  1437.      Notes:
  1438.      1. The 0 and 2 modes suppress color burst only on composite displays
  1439.         (not RGB) only for CGA and EGA.
  1440.  
  1441.  
  1442.    Appendix A: Video Mode Table                                        Page 24
  1443.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1444.  
  1445.  
  1446.      2. The PS/2 model 25 and 30 have an integrated MCGA.  The model
  1447.         30/286, model 50 and above have an integrated VGA.
  1448.      3. The 8514 High Content Color Display along with the 8514/A adapter
  1449.         produces a superset of the VGA for APA, but there are no
  1450.         differences in the A/N modes to the VGA when the adapter is in
  1451.         "VGA" mode.  See IBM documentation for Advanced Function Mode.
  1452.      4. MaxPage is reduced to 3 if EGA only has 64K graphics memory
  1453.         installed for modes marked "*".  MaxPage of 7 is for 128K or more.
  1454.      5. The PCC can have either an alternate MDA or CGA.  The LCD (model
  1455.         5140) can emulate either the MDA or CGA modes, but the MDA mode is
  1456.         640x200.
  1457.      6. No information is provided on the PGC.
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.    Appendix A: Video Mode Table                                        Page 25
  1504.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1505.  
  1506.  
  1507.    A P P E N D I X   B :  C U R S O R   M O D E   D A T A
  1508.  
  1509.    Each video card differs in character cell size and cursor emulation in
  1510.    different video modes.  The following data will show you the specific
  1511.    differences between modes and cards, and how QWIK handles them.
  1512.  
  1513.  
  1514.    CURSOR MODE TABLES
  1515.  
  1516.    Cursor Mode Word - The cursor mode is saved in low memory at $40:$60 after
  1517.    each mode change.  Using hex is the easiest way to analyze the word.  The
  1518.    shape of the cursor is defined by horizontal scan lines in the character
  1519.    cell where the top row is of any cell is 0.
  1520.  
  1521.                           TABLE 2: Cursor Mode Word
  1522.               -------------------------------------------------
  1523.                       Hi byte                  Lo byte
  1524.               -----------------------   -----------------------
  1525.      Bit #:   15 14 13 12 11 10 09 08   07 06 05 04 03 02 01 00
  1526.      Bit #:   07 06 05 04 03 02 01 00   07 06 05 04 03 02 01 00
  1527.      Symbol:      $  $  *  *  *  *  *       @  @  +  +  +  +  +
  1528.  
  1529.      Key:     $ - controls cursor on/off and erratic blinking
  1530.               * - controls top scan line (0-based)
  1531.               @ - controls skew to the right
  1532.               + - controls bottom scan line (0-based)
  1533.  
  1534.  
  1535.    Skew - Bits 5 and 6 control the skew or shift to the right of the cursor on
  1536.    EGA/VGA cards.  Consistent results between video cards is not possible so
  1537.    it is best to leave these bits at zero.
  1538.  
  1539.    Cell Sizes - Because of different cells sized with different video cards,
  1540.    the top and bottom scan lines are also different for each card.  See TABLE
  1541.    1 in Appendix A for specific cell sizes.
  1542.  
  1543.                     TABLE 2: Cursor Mode Defaults
  1544.      ----------------------------------------------------------
  1545.      Adapter   Default  Comments
  1546.      --------  -------  ---------------------------------------
  1547.      MDA       $0B0C
  1548.      CGA,MCGA  $0607
  1549.      EGA       $0B0C    MD, ECD (640x350 25-line) Emulation off
  1550.      EGA       $0607    CD, ECD (640x200)
  1551.      VGA       $0D0E    Emulation off
  1552.      3270 PC   $0D0D    And converts MDA and CGA
  1553.  
  1554.  
  1555.    CURSOR EMULATION
  1556.  
  1557.    Cursor Emulation - Qinit sets the four standard cursor mode variables at
  1558.    startup to be either MDA or CGA defaults.  Almost all emulation modes can
  1559.    be handled by either of these two cell sizes.  Qinit handles certain
  1560.    exceptions.  If you want to handle your own exceptions, the following notes
  1561.    will help you.
  1562.  
  1563.  
  1564.    Appendix B: Cursor Mode Data                                        Page 26
  1565.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1566.  
  1567.  
  1568.  
  1569.    CursorBlink - This mode is hardware specific.  It works on MDA and CGA
  1570.    while it turns the cursor off on EGA and VGA.
  1571.  
  1572.    MCGA/VGA Cursor Mode - On these two cards, you can both read and write the
  1573.    cursor mode direct from the CRTC.  To be compatible with all video cards,
  1574.    QWIK does not attempt to do this, but instead depends on the Video Display
  1575.    Data Area at $40:$60.  Qinit turns on the cursor emulation mode if PS/2
  1576.    video equipment is detected.
  1577.  
  1578.    EGA Cursor Emulation - In 25-line mode on the EGA, cursor emulation works
  1579.    fairly well.  In other line modes, the emulation falters.  So just like CRT
  1580.    unit, Qinit forces emulation to be turned on in 25-line mode and off in
  1581.    other modes.  On the EGA, emulation is turned off by setting bit 0 of
  1582.    EgaInfo to 1.  The standard QWIK cursor modes are still set appropriately.
  1583.  
  1584.    MCGA Cursor Emulation - Use the CGA cursor cell size even though the
  1585.    character cell is 8x16.  The BIOS multiplies the start and end rows by 2
  1586.    and then adds one to the end row before writing to the hardware video port
  1587.    to emulate the CGA.
  1588.  
  1589.    VGA Cursor Emulation - Qinit turns the cursor emulation mode on so you
  1590.    don't have to worry about special fonts and cells sizes as it emulates the
  1591.    MDA and CGA.  The video BIOS will adjust your cursor shape to fit in the
  1592.    current cell size.  For the algorithms specific to the VGA, refer to the
  1593.    "IBM BIOS Interface Technical Reference Manual".
  1594.  
  1595.    3270 PC Peculiarities - The 3270 PC cursor types are limited to only three.
  1596.    In addition, the underline cursor is not visible on a white background on
  1597.    the 5272 color display and it is advisable to use a block cursor together
  1598.    with that attribute.  Notice that half-block cursors are converted to full
  1599.    block:
  1600.  
  1601.                      TABLE 3: 3270 PC Cursor Modes
  1602.      --------------------------------------------------------------
  1603.      Cursor Type   Comments
  1604.      ------------  ------------------------------------------------
  1605.      Underline     $0D0D only.  CGA and MDA are emulated.
  1606.      Hidden (off)  cursor start > cursor end.  $2000 is preferred.
  1607.      Block         anything other than the above
  1608.  
  1609.  
  1610.    Start Up Cursor Modes - Once QWIK determines the cell size and the cursor
  1611.    emulation mode, the four standard cursor modes, CursorInitial,
  1612.    CursorUnderline, CursorHalfBlock and CursorBlock are calculated:
  1613.  
  1614.        CursorInitial - This is the cursor mode detected at startup.  An
  1615.        improper default for MDA is automatically overridden to an
  1616.        underline.  Some early PCs have a BIOS bug that sets the MDA
  1617.        default incorrectly.
  1618.  
  1619.        CursorUnderline - The lower scan line is set to: (BottomOfCell-1).
  1620.        The upper scan line is set to: (LowerScan-1).
  1621.  
  1622.        CursorHalfBlock - The top scan line is set to: (BottomOfCell+1)/2.
  1623.  
  1624.  
  1625.    Appendix B: Cursor Mode Data                                        Page 27
  1626.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1627.  
  1628.  
  1629.        This may appear a little fat for EGAs in 25-line mode, but is just
  1630.        right for all other cards and modes.
  1631.  
  1632.        CursorBlock - Produces a block cursor by setting the top scan line
  1633.        to zero of CursorUnderline.
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.    Appendix B: Cursor Mode Data                                        Page 28
  1687.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1688.  
  1689.  
  1690.    A P P E N D I X   C :   P E R F O R M A N C E
  1691.  
  1692.  
  1693.    CODE SIZE
  1694.  
  1695.    If you use a QWIK procedure, only the corresponding object file containing
  1696.    that procedure will be linked and thereby optimizing the code.  Even if all
  1697.    procedures are used, QWIK is still quite small at a total of 2528 bytes
  1698.    while the STRS unit is 240 bytes.  Here's the linked code size:
  1699.  
  1700.      FILE NAME    BYTES  PROCEDURES
  1701.      ------------ -----  -------------------------------------------------
  1702.      Qinit   .obj  592   Qinit - always linked when QWIK is USEd
  1703.      Qwrites .obj  350   Qwrite, QwriteC, QwriteA, QwriteEos, QwriteEosA
  1704.      Qfills  .obj  439   Qfill, Qattr, QfillC, QattrC, QfillEos, QattrEos
  1705.      Qstores .obj  293   QstoreToScr, QstoreToMem, QScrToVscr, QVscrToScr
  1706.      Qreads  .obj  127   QreadStr, QreadChar, QreadAttr
  1707.      Qscrolls.obj  269   QscrollUp, QscrollDown
  1708.      Qpages  .obj   61   QwritePage, QviewPage
  1709.      Cursor  .obj   96   GotoRC, WhereR/C, SetCursor, GetCursor, ModCursor
  1710.      Eos     .obj  131   GotoEos, EosR/C, EosToRC/rel, EosToCursor, EosLn
  1711.      QEosLn  .obj   37   QEosLn
  1712.      CpuIdent.obj   42   GetCpuID
  1713.      GetSubID.obj   27   GetSubModelID
  1714.      SetMulti.obj   27   SetMultiTask
  1715.      Qwik    .tpu   32   Initialize and paragraph round up
  1716.  
  1717.  
  1718.    SPEED
  1719.  
  1720.    How fast is fast?  To have a basis for comparision, a unit of
  1721.    "screens/second" is used to get a feeling for speed.  To make one screen, a
  1722.    procedure is repeated with a FOR loop to fill several 80x25 pages and
  1723.    timed.  Qwrite- uses 80 character strings, and Qattr and Qfill use Rows:=25
  1724.    and Cols:=80.  Here are some samples from the systems that have been
  1725.    tested.  16-bit video cards such as the one in the Compaq 386/20 will be
  1726.    much faster than 8-bit cards.
  1727.  
  1728.      ------------------ S C R E E N S / S E C O N D -----------------
  1729.                 Chng  XT(4.77 MHz)  M30    M50    M70    ATT+  Compaq
  1730.      Procedure  Attr  EGA     CGA   MCGA   VGA    VGA    CGA   386/20
  1731.      ---------  ----  ------------  -----  -----  -----  ----  ------
  1732.      Qwrite-     Yes   32.8   9.5    75.4   88.4  113.3  16.8   418.4
  1733.                  No    42.4   9.5    90.0  138.1  191.9  16.8   450.4
  1734.      Qfill-      Yes   81.2  11.8   164.1  147.3  151.0  21.5   579.6
  1735.                  No    73.7   7.4   141.3  174.4  251.0  13.9   574.9
  1736.      Qattr-      Yes   72.6   7.4   141.3  174.4  254.9  14.0   570.3
  1737.      Qstore-     n/a   59.1   7.2   111.6  127.4  139.4  13.8   351.8
  1738.      Qscroll-    n/a   32.9   5.6    62.2   71.1   77.7  16.8   317.9
  1739.  
  1740.    Be sure to test QBENCH.PAS for virtual screens and find another significant
  1741.    increase in speed.  All routines will be at least 100 Scr/Sec, and 500
  1742.    Scr/Sec is typical.
  1743.  
  1744.    For those interested in comparisons, QWIK is much faster than the TP5
  1745.  
  1746.  
  1747.    Appendix C: Performance                                             Page 29
  1748.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1749.  
  1750.  
  1751.    direct video routines by the following percentage:
  1752.  
  1753.      Procedure  CGA cards  All Other cards
  1754.      ---------  ---------  ---------------
  1755.      Writeln     125%       650%
  1756.  
  1757.  
  1758.    TP COMPILERS
  1759.  
  1760.    The source code will compile under all TP compilers from 4.0 upward.  There
  1761.    are two evaluation packages: for TP 5.0 and TP 5.5.
  1762.  
  1763.    If you have the source code and want to recompile QWIK, be sure to use the
  1764.    correct directives at the top of the file by locating the "$" on the
  1765.    appropriate line.  This a simple but important task.  The important
  1766.    directive in TP5 is the alignment directive $A-.  It must be turned off or
  1767.    QScrRec will not be addressed correctly.
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.    Appendix C: Performance                                             Page 30
  1809.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1810.  
  1811.  
  1812.    A P P E N D I X   D :  A P P L I C A T I O N   P R O D U C T S
  1813.  
  1814.  
  1815.    Eagle Performance Software has developed identical products for both Turbo
  1816.    C and Turbo Pascal.  Our pledge is to provide you quality products with
  1817.    unparalleled performance and ease of use.  All registered users receive the
  1818.    complete source code when a signed license agreement is returned.
  1819.  
  1820.  
  1821.    QWIK
  1822.  
  1823.    QWIK - Here are the product versions and release dates for QWIK utilities:
  1824.  
  1825.       File name    CIS Name    Compiler  Release date
  1826.       -----------  ----------  --------  ------------
  1827.       QWIK55.ARC   QWIK55.ARC  TP4-5.5    08-24-89
  1828.       QWIKC21.ARC  QWKC21.ARC  TC2        07-06-89
  1829.  
  1830.  
  1831.    WNDW
  1832.  
  1833.    WNDW - For multi-level virtual windows, WNDW is the highest performance
  1834.    window utilities available today.  It offers very powerful utilities for
  1835.    full window control and management you probably never thought possible.
  1836.    They are simple and yet very powerful with high speed and tight code.  With
  1837.    WNDW, you can choose the absolute writing routines of QWIK, the window-
  1838.    relative writing routines of WNDW, and even customize your own.  Here are
  1839.    some of the features you will discover:
  1840.  
  1841.      - Uses the powerful direct screen writing routines of QWIK.
  1842.      - Up to 254 fixed or virtual windows can be on the screen at one
  1843.        time.
  1844.      - Extremely high-speed virtual screens in RAM (up to 40 times
  1845.        faster).
  1846.      - Virtual windows are fully updated on screen, even if covered.
  1847.        Screens can scroll underneath one another right on the screen at
  1848.        very high speeds!
  1849.      - Virtual windows have virtual titles.
  1850.      - Fully supported hidden windows saved in RAM.
  1851.      - Fully supports all video pages.
  1852.      - Adjustable-rate moving, resizing, and scrolling.
  1853.      - All windows can be randomly accessed, not just stacked or tiled.
  1854.      - 28 window-relative writing routines.
  1855.      - 15 different border styles with shadow and zoom effects.
  1856.      - Full line drawing procedures.
  1857.      - Full cursor mode control for each window.
  1858.      - Writes in all text modes and column modes.
  1859.      - Only 13k bytes of code if all 69 utilities are used.
  1860.      - Used in all other Eagle products.
  1861.      - Excellent documentation like this document.
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.    Appendix D: Application Products                                    Page 31
  1870.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1871.  
  1872.  
  1873.    Here are the product versions:
  1874.  
  1875.       File name    CIS Name    Compiler  Release date
  1876.       -----------  ----------  --------  ------------
  1877.       WNDW55.ARC   WNDW55.ARC  TP4-5.5    08-24-89
  1878.       WNDWC21.ARC  WNDC21.ARC  TC2        08-01-89
  1879.  
  1880.  
  1881.    PULL
  1882.  
  1883.    PULL - For multi-level pull-down menus, PULL is fully featured and fully
  1884.    configurable.  Includes execute, single, and multiple choice menus,
  1885.    unlimited nested submenus, data entry windows, help windows, directory
  1886.    windows, message system, and fully completed interfaces.  Some of the
  1887.    features are:
  1888.  
  1889.      - Uses QWIK and WNDW.
  1890.      - Work window(s) and complete interface for menus
  1891.      - Pull-down menus with 3 menu modes and 7 line modes
  1892.      - Pull-down file directory
  1893.      - Highlighted command letters
  1894.      - Unlimited levels of submenus
  1895.      - Unlimited data entry windows for 9 types of data
  1896.      - Data entry for the work window(s)
  1897.         Free field entry with either fixed column or flexible column
  1898.          length.
  1899.         Full editing capability including insert cursor mode
  1900.         Full field selection with cursor keys
  1901.         Automatic NumLock for numerical data entry
  1902.         Right or left justification for data entry output
  1903.         Error messages for invalid data entries
  1904.         Error messages for data entries out of range
  1905.      - Automatic sizes and locations for menus.
  1906.      - Operation by cursor
  1907.        keys or command keys
  1908.      - Pull/Pop between work window and nested submenu(s)
  1909.      - Programmable control of pull and pop sequences
  1910.      - Context-sensitive help
  1911.      - Message lines for prompts and processing
  1912.      - Full working shell for user development
  1913.      - Excellent documentation like this document.
  1914.  
  1915.    Here are the product versions:
  1916.  
  1917.       File name    CIS Name    Compiler  Release date
  1918.       -----------  ----------  --------  ------------
  1919.       PULL55.ARC   PULL55.ARC  TP4-5.5    08-24-89
  1920.       PULLC21.ARC  PULC21.ARC  TC2        08-01-89
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.    Appendix D: Application Products                                    Page 32
  1931.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1932.  
  1933.  
  1934.    ON-LINE SERVICES
  1935.  
  1936.    CompuServe - All updated files and later versions can be found on the
  1937.    CompuServe Borland Forums (GO BPROGA for TP and GO BPROGB for TC) or the
  1938.    IBM Programming Forum (GO IBMPRO).
  1939.  
  1940.    The Eagle BBS - You can also get the latest files on our 24-hour BBS at
  1941.    (214) 539-9878, 1200/2400 N81.
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.    Appendix D: Application Products                                    Page 33
  1992.    QWIK Screen Utilities                            User's Guide, Version 5.5
  1993.  
  1994.  
  1995.    A P P E N D I X   E :  R E V I S I O N   H I S T O R Y
  1996.  
  1997.  
  1998.    Pre-QWIK40 Versions - Here's a list of steps to help you upgrade to
  1999.    QWIK42 from versions prior to QWIK40 on your programs:
  2000.  
  2001.      1. Add "Uses Qwik;"
  2002.      2. Delete the first Qinit.
  2003.      3. Do a search and replace for the following names.
  2004.           Search     Replace with
  2005.           ---------  ---------------------
  2006.           CardWait   CardSnow
  2007.           Qwait      Qsnow
  2008.           QwriteLV   QwriteA
  2009.           QwriteCV   QwriteC
  2010.           QwriteV    Qwrite
  2011.           ActiveDD   ActiveDispDev
  2012.           AltDD      AltDispDev
  2013.           PCCAltDD   AltDispDevPCC
  2014.           Vmode      VideoMode
  2015.      4. Add "CheckSnow:=Qsnow" early in the program and after each Qinit
  2016.         if you use the CRT unit.
  2017.      5. See REVISIONS for changes of type.
  2018.  
  2019.    Version 4.0 (12-01-87):
  2020.      Converted QWIK30 to QWIK40 to work on Turbo Pascal 4.0.
  2021.      Deleted QwriteV and QwriteCV.
  2022.      Added WhereR and WhereC.
  2023.      Added Hercules and IBM 3270 PC detection.
  2024.      Renamed the following variables:
  2025.        From       To
  2026.        ---------- ------------
  2027.        CardWait   CardSnow
  2028.        Qwait      Qsnow
  2029.        QwriteLV   QwriteA
  2030.        QwriteCV   QwriteC
  2031.        QwriteV    Qwrite
  2032.        ActiveDD   ActiveDispDev
  2033.        AltDD      AltDispDev
  2034.        PCCAltDD   AltDispDevPCC
  2035.        Vmode      VideoMode
  2036.      Added the following variables:
  2037.        VideoPage, CRTcols, CRTrows, CardSeg, Have3270,
  2038.        ActiveDispDev3270
  2039.      Added the following constants:
  2040.        NoHerc, HgcMono, HgcPlus, HercInColor
  2041.      Types were changed on the following items:
  2042.      - Strings passed to Qwrite* are of type String rather than Str80.
  2043.        (Should not be of any consequence.)
  2044.      - The CursorChange parameters are now word.
  2045.      - EgaFontSize, CRTcolumns, CardSeg, Page0seg, Qseg, AltDispDevPCC and
  2046.        ArrayLength are now word.
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.    Appendix E: Revision History                                        Page 34
  2053.    QWIK Screen Utilities                            User's Guide, Version 5.5
  2054.  
  2055.  
  2056.    Version 4.1a (05-01-88):
  2057.      Added QwriteMore, QwriteMoreA, QfillMore, and QattrMore
  2058.        procedures.
  2059.      Added QnextOfs for the Q*More procedures.
  2060.      Improved video detection in Qinit for dual monitors, Hercules cards, and
  2061.        system hardware detection.
  2062.      Included background color constants to use instead of an attribute
  2063.        function.
  2064.      Reduced code size about 10%.
  2065.      Solved critical timing problem on IBM PC with CGA - at last!
  2066.      QWIK now uses the global variable CRTcols and not the absolute variable
  2067.        CRTcolumns for offset calculations.
  2068.  
  2069.    Version 4.1b (06-18-88):
  2070.      Separated GetSubModelID out of Qinit as an optional procedure due to BIOS
  2071.        bugs in PC/XT clones which would cause a lock up at initialization.
  2072.        New GetSubModelID now avoids those machines and QWIK should now work on
  2073.        them.
  2074.  
  2075.    Version 4.2 (10-1-88):
  2076.      For clarity, the Q*More procedures were renamed to Q*Eos.
  2077.      Added the type VScrRecType.
  2078.      Added the following constants:
  2079.        CursorOff, CursorOn, CursorBlink
  2080.      Added the following variables:
  2081.        QvideoPage, QvideoMode, QScrPtr, QScrRec,
  2082.        CursorInitial, CursorUnderline, CursorHalfBlock, CursorBlock
  2083.      Renamed the following variables for clarity:
  2084.        Qseg     -> QScrSeg
  2085.        Qofs     -> QScrOfs
  2086.        QnextOfs -> QEosOfs
  2087.      Added the following procedures and functions:
  2088.        QScrToVscr, QVscrToScr, QscrollUp, QscrollDown,
  2089.        QreadStr, QreadChar, QreadAttr,
  2090.        GotoEos, EosR, EosC, EosToRC, EosToRCrel, EosToCursor, EosLn,
  2091.        QEosLn
  2092.      Revamped the cursor procedures by deleting:
  2093.          CursorChange, CursorOn, CursorOff
  2094.        and replacing them with:
  2095.          SetCursor, GetCursor, ModCursor
  2096.      The screen base is now a FAR pointer using QScrOfs and QScrSeg pieced
  2097.        together to make QScrPtr to do virtual screens in RAM.
  2098.      GotoRC and WhereR/C now work on the "write" page instead of the viewed
  2099.        page.
  2100.      Made FirstQinit a variable instead of constant so that it would be
  2101.        initialized at each startup when executing in TP environment.  Hercules
  2102.        cards are then tested at each startup.
  2103.      Completely revised documentation.
  2104.      Added supplementary STRS unit for string functions:
  2105.        StrL, StrLF, StrR, StrRF, StrRFD
  2106.  
  2107.    Version 4.2a (10-5-88):
  2108.      QattrC fixed.  (Did not exit properly when SameAttr used.)
  2109.  
  2110.  
  2111.  
  2112.  
  2113.    Appendix E: Revision History                                        Page 35
  2114.    QWIK Screen Utilities                            User's Guide, Version 5.5
  2115.  
  2116.  
  2117.    Version 4.2b (10-15-88):
  2118.      Identifiers StrLF, StrRF, and StrRFD incorrectly labled in STRS unit as
  2119.        StrLW, StrRW, and StrRWD.  Document examples also corrected.
  2120.      Added instructions for TP5 usage (registered users only).
  2121.  
  2122.    Version 5.X (12-20-88):
  2123.      Compiled QWIK42B under TP5.  No other changes.
  2124.  
  2125.    Version 5.Xa (03-04-89):
  2126.      Add SetMultiTask procedure to set variables for Multi-tasking video
  2127.        buffers (MTVB).
  2128.      Forced null strings written to virtual buffers to leave QEosOfs
  2129.        unchanged.
  2130.  
  2131.    Version 5.5 (08-24-89):
  2132.      Compiled QWIK5XA under TP 5.5.  No other changes.
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.    Appendix E: Revision History                                        Page 36
  2175.    QWIK Screen Utilities                            User's Guide, Version 5.5
  2176.  
  2177.  
  2178.    A P P E N D I X   F :  R E F E R E N C E S  A N D   C R E D I T S
  2179.  
  2180.  
  2181.   REFERENCES
  2182.  
  2183.    PS/2 Systems - For more information on the new IBM PS/2 system, you can
  2184.    get the "Personal System/2 and Personal Computer BIOS Interface Technical
  2185.    Reference" manual.  Other references include:
  2186.  
  2187.      IBM Personal System/2 Seminar Proceedings:
  2188.        Volume 5, Number 2, Displays and Adapters, publication
  2189.          # G360-2678.
  2190.        Volume 5, Number 4, Models 50, 60, 80, VGA, BIOS and
  2191.          Programming Considerations, publication # G360-2747.
  2192.  
  2193.    3270 PC - For more information on the IBM 3270 PC, you can get the
  2194.    following publications:
  2195.  
  2196.      "3270 PC Application Development Considerations"
  2197.      "IBM 3270 Personal Computer Programming Guide", Pub # SA23-0221
  2198.      "IBM 3270 Personal Computer Control Program Reference", Pub
  2199.         # GA23-0232
  2200.  
  2201.    As always, the above information is subject to change without notice
  2202.    per IBM.
  2203.  
  2204.    Video Guide - An excellent guide for IBM and Hercules video card
  2205.    programming in text and graphics is:
  2206.  
  2207.      "Programmer's Guide to PC & PS/2 Video Systems" by Richard Wilton and
  2208.        published by Microsoft Press
  2209.  
  2210.    Trademarks - IBM is the trademark for International Business Machines
  2211.    Corp.  Turbo Pascal is a trademark of Borland International.
  2212.  
  2213.  
  2214.    CREDITS
  2215.  
  2216.    Without the assistance and original ideas from Brian Foley, these
  2217.    routines would not have been written.  And the helpful feedback from
  2218.    users has inspired more powerful routines.
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.    Appendix F: References and Credits                                  Page 37
  2236.