home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / zsus / z3help / y.lbr / VLIB3.HZP / VLIB3.HLP
Encoding:
Text File  |  1990-04-24  |  21.6 KB  |  612 lines

  1.  Introduction
  2.  Graphics Init       - GZ3INIT
  3.  Graphics Enable     - GRXON, GRXOFF, CURON, CUROFF
  4.  Block Graphics      - DRFULL, DRHASH
  5.  Corner Routines     - ULEFT, URIGHT, LLEFT, LRIGHT
  6.  Intersect Routines  - LTISEC, RTISEC, UISEC, LISEC, ISEC
  7.  Horizontal Bars     - DRHBAR, DRHORZ, ERAHORZ, GHBAR, ERAHBAR
  8.  Vertical Bars       - DRVBAR, DRVERT, ERAVERT, GVBAR, ERAVBAR
  9.  Box Draw Routines   - DRFBOX, DRBOX, ERABOX, GFBOX, GBOX, GERBOX, CHKBOX
  10.  Pull-Down Menus     - SETPDM, CLRPDM, SELPDM, MCLS
  11.  P-D Menu Support    - PDMINI, ISPDM, SPDMCHR
  12.  Screen Reading      - GETCUR, GETLIN
  13. :             INTRODUCTION 
  14.  
  15.             22 January 1990 (JWW)
  16.  
  17. These extensions to VLIB incorporate many of the interfaces of
  18. the original Echelon/Dennis Wright GRXLIB and GRWLIB, and provide
  19. additional functionality for easier interfacing.  They require
  20. the extended TCAP definitions in order to work.
  21.  
  22.                     Harold F. Bower
  23.                     P.O. Box 313
  24.                     Ft. Meade, MD  20755
  25.  
  26. :GZ3INIT - Initialize Z3LIB & VLIB, return TCAP flags
  27.  
  28.   ENTER: HL = Pointer to Z3 Environment Descriptor
  29.   EXIT :  A = Bitmap of capabilities, Zero set on results as:
  30.         B0 = 1 if Delete/Insert Line present, 0 if absent
  31.         B1 = 1 if Clear to EOS present, 0 if absent
  32.         B2 = 1 if Graphics On/Off present, 0 if absent
  33.         B3 = 1 if 13 Graphics chars exist, 0 if any absent
  34.   USES : AF
  35.  
  36.  Usage: This routine calls Z3VINIT and therefore may be
  37.   substituted for it to set the Z3LIB ENVPTR and initialize
  38.   VLIB routines.  Flag bits are returned to show whether the
  39.   TCAP extended functions are present.
  40.  
  41. :GRXON  - Place Terminal in Graphics Mode
  42.  GRXOFF - Return Terminal to Alphanumeric Mode
  43.  
  44.   ENTER: None
  45.   EXIT :  A <> 0, Zero Flag Clear (NZ) if Operation Successful
  46.           A = 0, Zero Flag Set (Z) if NOT implemented
  47.   USES : AF
  48.  
  49.  Usage: These two routines control the graphics capabilites of
  50.   your terminal as defined in the extended TCAP.  If these
  51.   routines are not implemented, any calls to Graphic routines
  52.   will print the defined strings in normal Alphanumeric mode.
  53.  
  54. Example:
  55.     EXT    GRXON,GRXOFF    ; Define the routines
  56.     ...            ; ..do VIDINIT/Z3VINIT up here
  57.     CALL    GRXON        ; Put Terminal in Graphics mode
  58.     JR    Z,NOGRAF    ; .jump if No Graphics Mode
  59.     ...            ; ..Else print in Graphics
  60.     CALL    GRXOFF        ; Return to Alphanumeric mode
  61.  CURON  - Display the Cursor
  62.  CUROFF - Cursor display Off
  63.  
  64.   ENTER: None
  65.   EXIT :  A <> 0, Zero Flag Clear (NZ) if Operation Successful
  66.           A = 0, Zero Flag Set (Z) if NOT implemented
  67.   USES : AF
  68.  
  69.  Usage:  These routines allow you to inhibit the cursor during
  70.   your graphic displays to avoid the distraction of the cursor
  71.   painting all over the place.  Turning the cursor off will speed
  72.   up some subsequent Terminal operations, I am told.
  73.  
  74. :DRFULL - Print a Full Graphics Block character
  75.  DRHASH - Print a Hashed or Shaded Graphics Block character
  76.  
  77.   ENTER: None
  78.   EXIT :  A <> 0, Zero Flag Clear (NZ) if character printed
  79.           A = 0, Zero Flag Set (Z) if NOT implemented
  80.   USES : AF
  81.  
  82.  Usage: This routine is used by several of the added routines
  83.   to print full-block graphics characters to the screen.
  84.   Examples are the line draw routines.
  85.  
  86. Example:
  87.     EXT    DRFULL,DRHASH    ; Declare the routines
  88.     ...            ; ..other code including Z3INIT
  89.     CALL    DRFULL        ; Print full block graphics
  90.     CALL    DRHASH        ; ..and Hashed (shaded) block
  91.     ...            ; Carry On!
  92.  
  93. :ULEFT  - Print Upper-Left Corner Graphics character  (+)
  94.  URIGHT - Print Upper-Right Corner Graphics character (+)
  95.  LLEFT  - Print Lower-Left Corner Graphics character  (+)
  96.  LRIGHT - Print Lower-Right Corner Graphics character (+)
  97.  
  98.   ENTER: None
  99.   EXIT :  A <> 0, Zero Flag Clear (NZ) if character printed
  100.           A = 0, Zero Flag Set (Z) if NOT implemented
  101.   USES : AF
  102.  
  103.  Usage: These routines print the respective corner graphics
  104.   characters and are used in the Box drawing routine described
  105.   elsewhere.  If you have no Graphics capability, use chars
  106.   in parens in TCAP strings.
  107.  
  108. :LTISEC - Print Left Intersection Graphics character  (+)
  109.  RTISEC - Print Right Intersection Graphics character (+)
  110.  UISEC  - Print Upper Intersection Graphics character (+)
  111.  LISEC  - Print Lower Intersection Graphics character (+)
  112.  ISEC   - Print Intersection character                (+)
  113.  
  114.   ENTER: None
  115.   EXIT :  A <> 0, Zero Flag Clear (NZ) if character printed
  116.           A = 0, Zero Flag Set (Z) if NOT implemented
  117.   USES : AF
  118.  
  119.  Usage: As with the corner routines, these print the respective
  120.   Graphics character for their function.  Define the TCAP
  121.   string for these functions to be the ASCII character in
  122.   parentheses if you have no Graphics capability.
  123.  
  124. Example:
  125.     EXT    LTISEC,RTISEC,UISEC,LISEC,ISEC    ; Declare routines
  126.     ...            ; ..preceding code
  127.     CALL    LTISEC        ; (or RTISEC, etc)
  128.  
  129. :                   Horizontal Bars 
  130.  
  131. DRHBAR - Print Heavy Horizontal Bar with the Graphics Full or
  132.     Hashed Block character from Inline code.
  133.  
  134.   ENTER: None.  The top of Stack points to parameters
  135.   EXIT : None.  Execution resumes after the parameters
  136.   USES : None.
  137.  
  138.  Usage: This routine is used where fixed parameters exist.  For
  139.   variable bar parameters, use GHBAR which executes the same from
  140.   parameters passed in registers.  Parameters are:
  141.  
  142.     call    drhbar
  143.  
  144.     defb    Type    ; - 1 = Full Block, 2 = Hashed Block
  145.     defb    Row    ; - 1 = Top Row on screen
  146.     defb    Column    ; - 1 = Left Most Column on screen
  147.     defb    Length    ; - Number of characters to print
  148.     defb    Direc    ; - 0 = Left-to-Right, 1 = R-to-L
  149.  
  150. Example:
  151.     EXT    DRHBAR        ; Declare the routine
  152.     ...            ; ..preceding code
  153.     CALL    DRHBAR        ; Draw heavy bar at:
  154.     DEFB    1,2,10,20,0    ; Full, Row 2, Col 10, Len 20
  155.                 ; ..Print Left-to-right
  156.     ...            ; Execution resumes here
  157.  
  158.  NOTE: When bars are specified as Right-to-Left, the left
  159.  margin is validated for exceeding the left margin, and only
  160.  the valid portion is printed.  Actual printing is always
  161.  Left-to-Right.
  162.  
  163. DRHORZ  - Print Graphics Horizontal Line from Inline parms
  164. ERAHORZ - Erase a Horizontal Line from Inline parameters by over-
  165.      writing with Spaces
  166.  
  167.   ENTER: None.  The top of Stack points to parameters
  168.   EXIT : None.  Execution resumes after the parameters
  169.   USES : None.
  170.  
  171.  Usage: These routines draw a thin graphics horizontal line,
  172.   and erase a line by overwriting wih spaces respectively.
  173.   They are used where fixed parameters exist.  For variable bar
  174.   parameters, use GHBAR and ERAHBAR which execute the same from
  175.   parameters passed in registers.  Parameters are:
  176.  
  177.     call    drhorz (or erahorz)
  178.  
  179.     defb    Row    ; - 1 = Top Row on screen
  180.     defb    Column    ; - 1 = Left Most Column on screen
  181.     defb    Length    ; - Number of characters to print.
  182.     defb    Direc    ; - 0 = Left-to-Right, 1 = Right-to-Left.
  183.  
  184. Example:
  185.     EXT    DRHORZ,ERAHORZ    ; Declare the routines
  186.     ...            ; ..preceding code
  187.     CALL    DRHORZ        ; Draw horizontal line at:
  188.     DEFB    2,10,20,0    ; Row 2, Col 10, Length 20
  189.                 ; ..Print Left-to-right
  190.     ...            ; Execution resumes here
  191.     CALL    ERAHORZ        ; Erase the horizontal line at:
  192.     DEFB    5,60,20,1    ; Row 5, Col 60, Length 20
  193.                 ; ..from Right-to-Left
  194.  
  195.  NOTE: When lines are specified as Right-to-Left, the left
  196.  margin is validated for exceeding the left margin, and only
  197.  the valid portion is printed.  Actual printing is always
  198.  Left-to-Right.
  199.  
  200. GHBAR - Print a Graphics Horiz Bar/Line from parms in Regs
  201.  
  202.   ENTER:  A = Bar Type (0=Line, 1=Full Block, 2=Hashed Block)
  203.       B = Length of Bar
  204.       C = Print Direction (0=Left-to-Right,1=Right-to-Left)
  205.       H = Starting Row (1=Top of screen)
  206.       L = Starting Column (1=Leftmost Column)
  207.   EXIT : None.  Registers are meaningless, the bar is printed
  208.   USES : AF,BC,HL
  209.  
  210.  Usage: This routine is used where horizontal bar parameters
  211.   are calculated by a program, or not known at assembly time.
  212.  
  213. Example:       (See Note in DRHORZ Example)
  214.     EXT    GHBAR        ; Declare the routine
  215.     ...            ; ..preceding code
  216.     LD    A,2        ; Print bar w/Hashed Block char
  217.     LD    HL,10*256+25    ; .Start at Row 10, Column 25
  218.     LD    BC,15*256+0    ; ..Length of 15, Left-to-Right
  219.     CALL    GHBAR        ; Print it Graphically
  220.  
  221. ERAHBAR - Erase Horizontal bar from Register parameters
  222.  
  223.   ENTER:  B = Length of Bar
  224.       C = Print Direction (0=Left-to-Right,1=Right-to-Left)
  225.       H = Starting Row (1=Top of screen)
  226.       L = Starting Column (1=Leftmost Column)
  227.   EXIT : None.  Registers are meaningless, the bar is erased
  228.   USES : AF,BC,HL
  229.  
  230.  Usage: This routine is used to erase a horizontal bar by over-
  231.   writing with spaces where parameters are calculated by a
  232.   program, or are not known at assembly time.
  233.  
  234. Example:       (See Note in ERAHORZ Example)
  235.     EXT    ERAHBAR        ; Declare the routine
  236.     ...            ; ..preceding code
  237.     LD    HL,8*256+50    ; .Start at Row 8, Column 50
  238.     LD    BC,40*256+1    ; ..Length of 40, Right-to-Left
  239.     CALL    ERAHBAR        ; Erase it
  240.  
  241. :                      Vertical Bars 
  242.  
  243. DRVBAR - Draw Heavy Vertical Bar from parms passed on stack
  244.  
  245.   ENTER: None.  Parameters are addressed by Top of Stack
  246.   EXIT : None.  Execution resumes after parms, bar is printed
  247.   USES : None
  248.  
  249.  Usage: This routine is used when a Heavy fixed-location bar is
  250.   needed, or bar location and size are known at assembly time.
  251.   Bar characters may be Full or Hashed Block, either single or
  252.   width.  See GVBAR for the same functions from parms passed in
  253.   registers. Parameters are:
  254.  
  255.     call    drvbar    ; Call routine passing params address
  256.     defb    Type    ; 1=Solid Single, 2=Solid Double wide
  257.             ; 3=Hashed Single, 4=Hashed Double wide
  258.     defb    Row    ; Starting Row (1=Top row)
  259.     defb    Column    ; Starting Column (1=Leftmost row)
  260.     defb    Length    ; Number of Columns in bar
  261.     defb    Dir    ; 0=Top-to-Bottom, 1=Bottom-to-Top
  262.  
  263. Example:
  264.     EXT    DRVBAR        ; Declare the routine
  265.     ...            ; ..preceding code
  266.     CALL    DRVBAR        ; Draw vertical bar as:
  267.     DEFB    2,20,10,5,0    ; Solid single-width, Row 20,
  268.                 ; ..Col 10, 5 long, Top-to-Bot
  269.     ...            ; Execution resumes here
  270.  
  271.  NOTE: When a bar is drawn from Bottom-to-Top, checks are
  272.  made for exceeding the top of screen (Row 1).  The length is
  273.  adjusted if so to print only the part on screen.  Bars are
  274.  always printed Top-To-Bottom.
  275.  
  276. DRVERT  - Print Graphics Vertical Line from Inline params
  277. ERAVERT - Erase a Vertical Line from Inline parameters
  278.  
  279.   ENTER: None.  The top of Stack points to parameters
  280.   EXIT : None.  Execution resumes after the parameters
  281.   USES : None.
  282.  
  283.  Usage: These routines are used where fixed parameters exist.
  284.   For variable bar parameters, use GVBAR and ERAVBAR which
  285.   execute the same from parameters passed in registers.
  286.   Parameters are:
  287.  
  288.     call    drvert (or eravert)
  289.  
  290.     defb    Row    ; 1 = Top Row on screen
  291.     defb    Column    ; 1 = Left Most Column on screen
  292.     defb    Length    ; Number of characters to print
  293.     defb    Direc    ; 0 = Top-to-Bottom, 1 = Bottom-to-Top
  294.  
  295. Example:
  296.     EXT    DRVERT,ERAVERT    ; Declare the routines
  297.     ...            ; ..preceding code
  298.     CALL    DRVERT        ; Draw vertical line at:
  299.     DEFB    2,10,15,0    ; Row 2, Col 10, Length 15
  300.                 ; ..Print Top-to-Bottom
  301.     ...            ; Execution resumes here
  302.     CALL    ERAVERT        ; Erase the vertical line at:
  303.     DEFB    22,60,20,1    ; Row 22, Col 60, Length 20
  304.                 ; ..from Bottom-to-Top
  305.  
  306.  NOTE: When a bar is drawn from Bottom-to-Top, checks are
  307.  made for exceeding the top of screen (Row 1).  The length is
  308.  adjusted if so to print only the part on screen.  Bars are
  309.  always printed Top-To-Bottom.
  310.  
  311. GVBAR - Print Graphics Vertical Bar/Line from Register parms
  312.  
  313.   ENTER:  A = Bar Type (0=Line, 1=Single Full Block, 2=Double
  314.           Full Block, 3=Single Hash Block, 4=Double Hash)
  315.       B = Length of Bar (# of characters)
  316.       C = Print Direction (0=Top-to-Bottom,1=Bottom-to-Top)
  317.       H = Starting Row (1=Top of screen)
  318.       L = Starting Column (1=Leftmost Column)
  319.   EXIT : None.  Registers are meaningless, the bar is printed
  320.   USES : AF,BC,HL
  321.  
  322.  Usage: This routine used to print calculated Vert bars from
  323.   programs where parameters are not known at assembly time.
  324.  
  325. Example:       (See Note in DRVERT Example)
  326.     EXT    GVBAR        ; Declare the routine
  327.     ...            ; ..preceding code
  328.     LD    A,2        ; Double bar w/Full Block char
  329.     LD    HL,22*256+60    ; .Start at Row 22, Column 60
  330.     LD    BC,15*256+1    ; ..Length of 15, Bottom-to-Top
  331.     CALL    GVBAR        ; Print it Graphically
  332.  
  333. ERAVBAR - Erase Vertical bar from Register Parameters
  334.  
  335.   ENTER:  B = Length of Bar (# of chars)
  336.       C = Print Direction (0=Top-to-Bottom,1=Bottom-to-Top)
  337.       H = Starting Row (1=Top of screen)
  338.       L = Starting Column (1=Leftmost Column)
  339.   EXIT : None.  Registers are meaningless, the bar is erased
  340.   USES : AF,BC,HL
  341.  
  342.  Usage: This routine is used to erase a Vertical bar by
  343.   overwriting with spaces where parameters are calculated by a
  344.   program, or are not known at assembly time.  Do twice for
  345.   double-width bar.
  346.  
  347. Example:       (See Note in ERAVERT Example)
  348.     EXT    ERAVBAR        ; Declare the routine
  349.     ...            ; ..preceding code
  350.     LD    HL,8*256+10    ; .Start at Row 8, Column 10
  351.     LD    BC,15*256+0    ; ..Length of 15, Top-to-Bottom
  352.     CALL    ERAVBAR        ; Erase it
  353.  
  354. :                   Box Draw Routines 
  355.  
  356. DRFBOX - Draw Box with the Graphics Full Block char
  357. DRBOX  - Draw Box with Graphics line and corner characters
  358. ERABOX - Erase a Box by overwriting with spaces
  359.  
  360.   ENTER: None.  The Top of Stack addresses Box parameters
  361.   EXIT : None.  Execution resumes at byte following the parms
  362.   USES : None
  363.  
  364.  Usage: These routines are used to draw Graphics boxes framed
  365.   with Full Block characters (DRFBOX), normal Graphics line and
  366.   corner characters (DRBOX), or erase a box (ERABOX).  Boxes
  367.   are drawn from top-left to bottom right, and erased by
  368.   overwriting with spaces.  Parameters are:
  369.  
  370.     call    drfbox    ; (or drbox or erabox)
  371.  
  372.     defb    Row    ; Starting Row (1 = Top row)
  373.     defb    Column    ; Starting Column
  374.     defb    Height    ; Height of box in Character Rows
  375.     defb    Width    ; Width of box in Character positions
  376. Example:
  377.     EXT    DRFBOX,DRBOX,ERABOX    ; Declare routines
  378.     ...            ; ..preceding code
  379.     CALL    DRBOX        ; Draw a Normal Box
  380.     DEFB    5,5,10,20    ; Row 5, Col 5, 10 Spaces High
  381.                 ; ..and 20 spaces wide
  382.     CALL    DRFBOX        ; Draw box framed w/solid blks
  383.     DEFB    10,30,6,25    ; Row 10, Col 30, 6 Spaces High
  384.                 ; ..and 25 wide
  385.     CALL    ERABOX        ; Erase the first box
  386.     DEFB    5,5,10,20
  387.     ...            ; ..and continue on
  388.  
  389. GFBOX  - Draw Graphics Box framed with Solid Block Character
  390. GBOX   - Draw Box framed with line and corner Graphics chars
  391. GERBOX - Erase Box by overwriting with spaces
  392.  
  393.   ENTER:  B = Width of Box in Character spaces
  394.       C = Height of Box in Lines
  395.       H = Starting Row (Top Left Corner, 1=Top row)
  396.       L = Starting Column (Top Left Corner, 1=Leftmost Col)
  397.   EXIT : None.  Registers indeterminate, Box drawn
  398.   USES : AF,BC,HL
  399.  
  400.  Usage: These routines implement the same functions as previous
  401.   Box routines, but derive their parameters from CPU registers.
  402.   Use these routines for calculated values or for parameters
  403.   not known at assembly.
  404.  
  405. Example:
  406.     EXT    GFBOX,GBOX,GERBOX    ; Declare the routines
  407.     ...                ; ..preceding code
  408.     LD    BC,30*256+10        ; 30 spaces wide, 10 Hi
  409.     LD    HL,10*256+20        ; ..at Row 10, Col 20
  410.     CALL    GBOX            ; Draw it!
  411. CHKBOX - Check & Adjust Box Parameters
  412.  
  413.   ENTER:  B = Width of Box in Character spaces
  414.       C = Height of Box in Lines
  415.       H = Starting Row (Top Left Corner, 1=Top row)
  416.       L = Starting Column (Top Left Corner, 1=Leftmost Col)
  417.   EXIT :  A <> 0, Zero Clear (NZ) if box drawable, parms set
  418.               A = 0, Zero Flag Clear (Z) if Box NOT drawable
  419.   USES : AF  (maybe B,C,H,L if parameters adjusted)
  420.  
  421.  Usage: This routine is used internally to adjust box dimen-
  422.   sions to screen size reflected in the CRT data in the Z3
  423.   Environment.  Starting Row/Column exceeding the maximum
  424.   Height/Width will cause the error status.  It may be used
  425.   after setting registers for a GRBOX/GRFBOX call to save the
  426.   actual box parameters which will be drawn.
  427.  
  428. Example:
  429.     EXT    CHKBOX,GBOX    ; Declare the routines
  430.     ...            ; ..set up for box draw
  431.     CALL    CHKBOX        ; Validate the dimentions/loc'n
  432.     JR    Z,NOGOOD    ; ..jump if can't draw this one
  433.     LD    (HITWID),BC    ; Else save width/height
  434.     LD    (ROWCOL),HL    ; ..and Row/Col Start loc'n
  435.     CALL    GBOX        ; Draw this box
  436.     ...
  437. :                     Pull-Down Menus 
  438.  
  439. SETPDM - Set Select Menu and Item Menu Bar for PDM from Stack
  440. SETPDR - Set Select Menu and Item Menu Bar for PDM from Regs
  441.  
  442.   ENTER: (SETPDM) None.  Top of Stack points to Menu Data Area
  443.          (SETPDR) HL = Pointer to Menu Data Area
  444.   EXIT :  A <> 0, Zero Flag Clear (NZ) if Pull-Down Menu Ok
  445.           A = 0, Zero Set (Z) if Error or Not Supported
  446.          (SETPDR) HL = Address of byte after terminating Null
  447.   USES : AF (SETPDR also uses HL)
  448.  
  449.  Usage: These routines are used to establish a single Menu
  450.   selection, and set information for the Pull-Down Item
  451.   Selection bar.  The number of Menu selections is determined
  452.   by screen width, and up to ten selections may be supported.
  453.   Menu Data descriptions are ASCII text strings with binary
  454.   values of one to ten (only 1-5 currently used) to denote
  455.   special features and fields.
  456.  
  457. Menus are structured as:
  458.     The first byte is the Menu Number in the range of 1..10
  459.     The Menu Name string is next terminated by a binary 1
  460.     Item Selection strings are terminated by a binary 3
  461.     Optional fields may be interspersed with Select strings as:
  462.     Sub-Header strings terminated by a binary 2
  463.     Separator lines which are shown with a binary 4
  464.     Blank lines which are shown with a binary 5
  465.  
  466. Example:
  467.     EXT    SETPDM        ; Declare the routine
  468.     ...            ; ..call PDMINI up here
  469.     CALL    SETPDM
  470.     DEFB    1        ; Menu number (1..10)
  471.     DEFB    'MenuName',1    ; Name on Menu Bar
  472.     DEFB    'Subheader',2    ; Optional subheader(s)
  473.     DEFB    4        ; Optional Separator Line
  474.     DEFB    'Item 1',3    ; First Item Name
  475.     DEFB    5        ; Optional Blank Line
  476.     DEFB    'Item 2',3    ; Second Item Name
  477.     DEFB    0        ; End of Menu Item List
  478.     ...            ; ..execution resumes here
  479. CLRPDM - Clear a Pull-Down Menu from the Menu Selection Bar
  480.  
  481.   ENTER:  A = Menu Number to Clear (0 = Clear All)
  482.   EXIT :  A <> 0, Zero Flag Clear (NZ) if Operation Successful
  483.               A = 0, Zero Flag Set (Z) if Entry Not Found
  484.   USES : AF
  485.  
  486.  Usage: This routine deletes an entry from the Menu Bar and
  487.   moves all subsequent entries to the left.  Logical entry
  488.   numbers stay the same as when loaded, but this function
  489.   refers to the physical positioning on the Menu Bar.
  490.  
  491. Example:
  492.     EXT    CLRPDM        ; Declare the variable
  493.     ...            ; ..establish Pull-Down Menus
  494.     LD    A,4        ; Remove the 4th entry
  495.     CALL    CLRPDM        ; ..in the bar
  496.     JR    NZ,REMOK    ; Jump if removal Ok
  497.     ...
  498.  
  499. SELPDM - Enter Pull-Down Menu.  Return Menu/Item Selections
  500.  
  501.   ENTER: None
  502.   EXIT :  A = 0, Zero Flag Set (Z) if PDM Escape key pressed
  503.       A <> 0, Zero Clear (NZ) if Menu Item selected,
  504.       H = Menu Number
  505.       L = Item Selection Number
  506.   USES : AF,HL
  507.  
  508.  Usage: This routine forms the heart of the Pull-Down Menu
  509.   system.  When entered, control will not return to the program
  510.   until either the PDM Escape character is pressed, or a valid
  511.   menu and item are selected.  By evaluating the returned
  512.   values, specific actions may be taken such as selecting
  513.   programs to run, items to list, etc.
  514.  
  515. MCLS - Clear Terminal Screen except for Pull-Down Menu Bar
  516.  
  517.   ENTER: None
  518.   EXIT :  A <> 0, Zero Flag Reset (NZ) if Screen Cleared Ok
  519.           A = 0 Zero Flag Set (Z) if CLREOS Not implemented
  520.   USES : AF
  521.  
  522.  Usage: This routine is used to clear the screen from Line 2 to
  523.   End-of-Screen, to preserve Pull-Down Menu Selection bar on
  524.   line 1.
  525.  
  526. :                 Pull-Down Menu Support 
  527.  
  528. PDMINI - Initialize Pull-Down Menu Functions
  529.  
  530.   ENTER: None
  531.   EXIT : None.  Internal Menu variables are initialized
  532.   USES : None
  533.  
  534.  Usage: This routine MUST be called before the Pull-Down Menu
  535.   system is used.  It clears needed variables and sets the
  536.   default PDM Escape character to ESC (1BH).
  537.  
  538. Example:
  539.     EXT    PDMINI        ; Declare the routine
  540.     ...            ; ..preliminary code sections
  541.     CALL    PDMINI        ; Initialize Pull-Down Menus
  542.     ...            ; ..now set menus, etc
  543.  
  544. ISPDM - Check character for Pull-Down Menu Escape Character
  545.  
  546.   ENTER:  A = Character to check
  547.   EXIT :  A = Char, Zero Clear (NZ) if it IS the Escape char
  548.         Zero Flag Set (Z) if NOT the Escape char
  549.   USES : Flags
  550.  
  551.  Usage: This routine is used in the Pull-Down Menu Selection
  552.   code to sense for the Escape character, and may be used in a
  553.   similar mode in other programs.  Set the desired character
  554.   with SPDMCHR.
  555.  
  556. Example:
  557.     EXT    ISPDM,CIN    ; Declare some routines
  558.     ...            ; ..preceding code
  559.     CALL    CIN        ; Get a character from console
  560.     CALL    ISPDM        ; Is it the Escape char?
  561.     JR    NZ,HAVIT    ; ..jump if so
  562.     ...            ; Else loop or whatever..
  563.  
  564. SPDMCHR - Change the value of the Pull-Down Menu Escape Char
  565.  
  566.   ENTER: A = New character to use as PD Menu Escape char
  567.   EXIT : None.  The char is set (Normally ESC-1BH, or ^\ - 1CH)
  568.   USES : None
  569.  
  570.  Usage: This routine is used to change the Pull-Down Menu
  571.   Escape character from the initial value of ESC (1BH).  Normal
  572.   values are either ESC (1BH) or Control-\ (1CH).
  573.  
  574. :          Reading the Terminal Screen 
  575.  
  576.  GETCUR     Get the current cursor position from the terminal.
  577.  
  578.   ENTER:    None
  579.   EXIT :    If A = 255 and NZ, HL is the current cursor position.
  580.         If A = 0 and Z, the function is not available.
  581.   USES :    A register and HL register pair.
  582.  
  583.  Usage:
  584.         EXT    GETCUR, GOTOXY
  585.         ....
  586.         CALL    GETCUR
  587.         JR    Z,NOTAVAIL
  588.         LD    (CURPOS),HL
  589.         ....
  590.         LD    HL,(CURPOS)
  591.         CALL    GOTOXY
  592.  
  593.  
  594.  GETLIN     Read a Line from the terminal.
  595.  
  596.   ENTER:    Cursor positioned at the end of a line.
  597.   EXIT :    If A = 255 and NZ, HL points to a null-terminated
  598.         string read from the terminal.
  599.         If A = 0 and Z, the function is not available.
  600.   USES :    A register and HL register pair.
  601.  
  602.  Usage: GETLIN will read the line from Column 1 until and including
  603.     the cursor position.  First, position the cursor.
  604.  
  605.         EXT    GOTOXY, GETLIN
  606.         ....
  607.         LD    H,1        ; Row 1
  608.         LD    L,80        ; Column 80
  609.         CALL    GOTOXY        ; Position the cursor
  610.         CALL    GETLIN        ; Get the Line
  611.         JR    Z,NOTAVAIL
  612.