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