home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / zsus / progpack / v42-docs.lbr / VLIB42.DZC / VLIB42.DOC
Encoding:
Text File  |  1990-06-09  |  67.1 KB  |  1,345 lines

  1. .hm1
  2. .fm1
  3. .sr0
  4. .he                                  ZCPR3: THE LIBRARIES 4.2 -- VLIB
  5. .fo                                                            Page #
  6. .pn 135
  7.  
  8.              III«  VLIB -- Video Terminal Interface
  9.  
  10.      Introductioε « « « « « « « « « « « « « « « « « « « « « « 136
  11.           Usinτ VLI┬  « « « « « « « « « « « « « « « « « « « « 136
  12.           Termina∞ Ca≡abilities (TCAP⌐ ExtendeΣ Definitioε  « 137
  13.      Basiπ VLI┬ Routine≤  « « « « « « « « « « « « « « « « « « 143
  14.           Screeε, Curso≥, anΣ Miscellaneou≤ Routine≤  « « « « 143
  15.                CLS¼ CLREOS¼ EREOL¼ AT¼ GOTOXY¼ DELLIN¼
  16.                INSLIN¼ ISCUR¼ VVERS
  17.           Initializatioε  . « « « « « « « « « « « « « « « « « 146
  18.                VIDINIT¼ Z3VINIT¼ VIDPT╥ (global)
  19.           Prin⌠ Routine≤  « « « « « « « « « « « « « « « « « « 146
  20.                GXYMSG¼ VPRINT¼ VPSTR
  21.           Standou⌠ Modσ « « « « « « « « « « « « « « « « « « « 147
  22.                STNDOUT¼ STNDEND
  23.           Terφinal Ini⌠ializatioε anΣ De-Initializatioε « « « 148
  24.                TINIT¼ DINIT
  25.      Graphic≤ . « « « « « « « « « « « « « « « « « « « « « « « 149
  26.           Ini⌠ializatioε  « « « « « « « « « « « « « « « « « « 149
  27.                GZ3INIT¼ GRXON¼ GRXOFF
  28.           Blocδ Graphic≤  « « « « « « « « « « « « « « « « « « 150
  29.                DRFULL¼ DRHASH
  30.           Corne≥s anΣ Intersection≤ « « « « « « « « « « « « « 150
  31.                ULEFT¼ URIGHT¼ LLEFT¼ LRIGHT¼ LTISEC¼
  32.                RTISEC¼ UISEC¼ LISEC¼ ISEC
  33.           Horizonta∞ anΣ Vertica∞ Bar≤  « « « « « « « « « « « 151
  34.                DRHBAR¼ DRHORZ¼ ERAHORZ¼ GHBAR¼ ERAHBAR,
  35.                DRVBAR¼ DRVERT¼ ERAVERT¼ GVBAR¼ ERAVBAR
  36.           Bo° Dra≈ing Routine≤  « « « « « « « « « « « « « « « 155
  37.                DRFBOX¼ DRBOX¼ ERABOX¼ GFBOX¼ GBOX¼
  38.                GERBOX¼ CHKBOX
  39.           Pull-Dowε Menu≤ « « « « « « « « « « « « « « « « « « 156
  40.                SETPDM¼ CLRPDM¼ SELPDM¼ MCLS¼ PDMINI¼
  41.                ISPDM¼ SPDMCHR
  42.           Readinτ thσ Termina∞ Screeε « « « « « « « « « « « « 159
  43.                GETCUR¼ GETLIN
  44. .pa
  45. è
  46.                 VLIB -- Video Terminal Interface
  47.  
  48.  
  49. INTRODUCTION:é  VLI┬ i≤ ß librar∙ oµ routine≤ originall∙ ádesigneΣ ì
  50. b∙ RicharΣ Conε t∩ suppor⌠ ZCPR3«  Man∙ change≤ havσ beeε áincorì
  51. porateΣ áiε áthi≤ version¼ includinτ optimizeΣ codσ fo≥ áthσ áZ8░ ì
  52. processo≥ family¼ conversioε t∩ ß tablσ-driveε modσ fo≥ increaseΣ ì
  53. speed¼ áanΣ thσ additioε oµ severa∞ ne≈ routine≤ compa⌠iblσ áwitΦ ì
  54. somσ áoµ thσ GRWLI┬ anΣ GRXLI┬ routine≤ whicΦ werσ áneve≥ áwidel∙ ì
  55. adopted.
  56.  
  57. Program≤ áusinτ ároutine≤ froφ thi≤ librar∙ arσ ablσ át∩ áenhancσ ì
  58. vide∩ ádisplay≤ witΦ direc⌠ curso≥ addressing¼ vide∩ áattributes¼ ì
  59. anΣ ne≈ mode≤ oµ operatioε sucΦ a≤ pul∞-dowε menu≤ iε ß áportablσ ì
  60. manne≥ amonτ othe≥ ┌-System≤ withou⌠ rσ-installation.
  61.  
  62. Portabilit∙ ái≤ achieveΣ b∙ accessinτ termina∞ description≤ áconì
  63. taineΣ iε thσ ZCPR│ TCAP¼ o≥ compatiblσ record«  Iε mos⌠ systems¼ ì
  64. thσ áTCA╨ i≤ storeΣ iε thσ seconΣ halµ oµ thσ áZCPR│ áEnvironmen⌠ ì
  65. Descriptor.
  66.  
  67. USIN╟ áVLIB:é á Wheε writinτ program≤ t∩ usσ áVLIB¼ áfollo≈ áthesσ ì
  68. steps:
  69.      Z3EAD╥    EQ╒       109H
  70.                L─        HL,(Z3EADR⌐    ╗ ge⌠ Environmen⌠ address
  71.                CAL╠      Z3VINI╘        ╗ initializσ ENVPT╥ anΣ VIDPTR
  72.                CAL╠      GZ3INI╘        ╗ iµ yo⌡ wou∞Σ usσ graphics
  73.                CAL╠      TINI╘          ╗ initializσ thσ terminal
  74.                ...«                     ╗ you≥ program
  75.                CAL╠      DINI╘          ╗ dσ-initializσ thσ terminal
  76.                ...«                     ╗ housekeeping
  77.                RE╘                      ╗ quit
  78.  
  79.      1.Initializσ ápointer≤ áanΣ routines« á Thσ átw∩ ápointer≤ ì
  80. áááááneedeΣ are:
  81.         - ENVPTR is the ZCPR3 Environment Descriptor address.
  82.         - VIDPTR sets the Z3TCAP entry address.
  83.         - Iµ áusinτ graphic≤ o≥ pul∞-dowε menus¼ initializσ átha⌠ ì
  84. áááááááááásybsysteφ áa≤ áwell«  Thi≤ routinσ return≤ áflag≤ átha⌠ ì
  85. áááááááááátel∞ wha⌠ ne≈ capabilitie≤ exist.
  86.  
  87.      2.Cal∞ átermina∞ initializatioε routine¼ TINIT« á Iµ áyou≥ ì
  88. ááááátermina∞ áuse≤ DI═ o≥ reduceΣ-intensit∙ insteaΣ áoµ áreversσ ì
  89. ááááávideo¼ áTINI╘ áshoulΣ se⌠ thσ defaul⌠ t∩ thσ ádiφ áleve∞ áa≤ ì
  90. ááááádefault¼ anΣ usσ norma∞ intensit∙ fo≥ STNDOUT¼ witΦ áSTNDEN─ ì
  91. áááááreturninτ t∩ Dim.
  92.  
  93.      3.Call VLIB routines within the program as desired.
  94.  
  95.      4.Cal∞ termina∞ dσ-initializatioε routine¼ DINIT«  Iµ you≥ ì
  96. ááááátermina∞ use≤ DI═ o≥ reduceΣ-intensit∙ attibute≤ insteaΣ áoµ ì
  97. áááááreversσ o≥ intensifieΣ vide∩ fo≥ Highlighting¼ DINI╘ áshoulΣ ì
  98. ááááárestorσ thσ termina∞ t∩ norma∞ intensit∙ a⌠ exit.
  99.  
  100. èTERMINA╠ CAPABILITIE╙ (TCAP⌐ EXTENDE─ DEFINITIONô (a≤ oµ áFebruar∙ ì
  101. 3¼ á1990):é  Thσ ZCPR│ TCA╨ i≤ ß 12╕-bytσ areß positioneΣ áimmσdiì
  102. atel∙ áafte≥ thσ Environmen⌠ Descriptor«  Thσ áconfiguratioε áha≤ ì
  103. beeε changeΣ froφ thσ origina∞ description≤ containeΣ iε áRicharΣ ì
  104. Conn'≤ book¼ ZCPR3║ Thσ Manual«  Thσ layou⌠ herσ i≤ designeΣ áfo≥ ì
  105. backwarΣ ácompatibilit∙ áwitΦ thσ origina∞ áschemσ áwhilσ áaddinτ ì
  106. extension≤ t∩ accomodatσ rudamentar∙ busines≤ graphic≤ anΣ ápul∞-ì
  107. dowε ámenu≤ describeΣ iε Denni≤ Wright'≤ GRXLI┬ anΣ áportion≤ áoµ ì
  108. GRWLIB«  Offset≤ mentioneΣ iε thi≤ descriptioε arσ froφ thσ ábasσ ì
  109. oµ thσ TCAP.
  110.  
  111.   offset  item           description
  112.      0    Terminal Name
  113.                          1│ characters¼ alphanumeric«  Thσ áfirs⌠ ì
  114. ááááááááááááááááááááááááácharacte≥ mus⌠ no⌠ bσ ß space«  ┴ áleaΣì
  115. áááááááááááááááááááááááááinτ áspacσ mean≤ uninstalleΣ áTCAP« á B∙ ì
  116. áááááááááááááááááááááááááconvention¼ ß termina∞ namσ i≤ uniquσ iε ì
  117. áááááááááááááááááááááááááit≤ firs⌠ eigh⌠ character≤ anΣ thσ ánamσ ì
  118. ááááááááááááááááááááááááái≤ terminateΣ witΦ ß space.
  119.  
  120.     1│    Offse⌠ t∩ GOEL─ entry
  121.  
  122.     1┤    HigΦ Termina∞ Characteristics
  123.                          Bi⌠ ╖ i≤ se⌠ (80h⌐ t∩ indentif∙ extendeΣ ì
  124. áááááááááááááááááááááááááTCAP.
  125.  
  126.     15    Lo≈ Termina∞ Characteristic≤
  127.                          Onσ bytσ indicatinτ termina∞ dσtails:
  128.                          b0 - typσ oµ standou⌠ modσ (░ ╜ dim╗ ▒ ╜ ì
  129. ááááááááááááááááááááááááááááááreverse).
  130.                          b1 - termina∞ ádela∙ a⌠ poweru≡ (░ ╜ án∩ ì
  131. áááááááááááááááááááááááááááááádelay╗ ▒ ╜ 1░ seconds).
  132.                          b2 - screeε wrap≤ oε writσ iε las⌠ áco∞ì
  133. ááááááááááááááááááááááááááááááumε (░ ╜ no╗ ▒ ╜ yes).
  134.                          b3 - screeε áscroll≤ áiµ álas⌠ áro≈ áanΣ ì
  135. áááááááááááááááááááááááááááááácolumε áarσ writteε (░ ╜ yes╗ á▒ á╜ ì
  136. ááááááááááááááááááááááááááááááno).
  137.                          b4 - ANS╔ átermina∞ (░ ╜ no¼ ASCII╗ ▒ á╜ ì
  138. ááááááááááááááááááááááááááááááyes¼ ANSI).
  139.  
  140. Thσ áfollowinτ áfou≥ byte≤ arσ fo≥ ásinglσ-bytσ ácurso≥ ámovemen⌠ ì
  141. code≤ áfroφ áthσ terminal«  Iµ you≥ termina∞ ha≤ án∩ áindependan⌠ ì
  142. curso≥ ámovemen⌠ keys¼ o≥ implement≤ curso≥ movemen⌠ witΦ ámultΘ-ì
  143. bytσ ásequences¼ usσ an∙ convenien⌠ singlσ-ke∙ sequencσ áyo⌡ ádeì
  144. sire« á Thσ familia≥ WordSta≥ "diamondó compriseΣ oµ ^┼ (up)¼ á^╪ ì
  145. (down)¼ ^─ (right⌐ anΣ ^╙ (left⌐ i≤ commonl∙ used.
  146.  
  147.     16    Cursor Up
  148.                          Curso≥ u≡ codσ froφ termina∞ (^E).
  149.  
  150.     17    Cursor Down
  151.                          Curso≥ dowε codσ froφ termina∞ (^X).
  152.  
  153.     18    Cursor Right
  154.                          Curso≥ righ⌠ codσ froφ termina∞ (^D).
  155. è
  156.     19    Cursor Left
  157.                          Curso≥ lef⌠ codσ froφ termina∞ (^S).
  158.  
  159. Somσ áterminal≤ neeΣ delay≤ t∩ perforφ certaiε áfunctions« á Thi≤ ì
  160. ma∙ ábσ morσ importan⌠ a≤ interfacσ speed≤ increase«  Delay≤ áarσ ì
  161. iε ámilliseconds«  Consul⌠ you≥ termina∞ manua∞ fo≥ áthσ ácorrec⌠ ì
  162. value≤ t∩ insert.
  163.  
  164.     20    Clear Screen
  165.                          Delay in milliseconds (0 to 255).
  166.  
  167.     21    Move Cursor
  168.                          Delay in milliseconds (0 to 255).
  169.  
  170.     22    Clear to End-of-Line
  171.                          Delay in milliseconds (0 to 255).
  172.  
  173. Beginninτ a⌠ offse⌠ 2│ froφ thσ beginninτ oµ thσ TCAP¼ ß sequencσ ì
  174. oµ áNU╠-terminateΣ string≤ definσ thσ commanΣ string≤ áneedeΣ át∩ ì
  175. makσ thσ termina∞ responΣ a≤ desired«  Iµ particula≥ feature≤ arσ ì
  176. no⌠ áimplementeΣ áo≥ no⌠ needeΣ b∙ you≥ terminal¼ áß ásinglσ áNU╠ ì
  177. (binar∙ 0⌐ disable≤ tha⌠ feature.
  178.  
  179.     23    Clear Screen (CL⌐
  180.                          Clear screen and home cursor.
  181.  
  182.           Cursor Movement (CM)
  183.                          ParseΣ ástrinτ fo≥ ácurso≥ ápositioning«  ì
  184. áááááááááááááááááááááááááSeσ ZCPR3║ Thσ ManualÖ fo≥ details«  "%Nó ì
  185. ááááááááááááááááááááááááástrinτ addeΣ t∩ senΣ binar∙ ░ t∩ átermiì
  186. ááááááááááááááááááááááááánal.
  187.  
  188.           Clear to End-of-Line (CE⌐
  189.                          Clea≥ froφ curso≥ positioε t∩ thσ enΣ oµ ì
  190. áááááááááááááááááááááááááthσ curren⌠ line«  Curso≥ stay≤ iε ácurì
  191. áááááááááááááááááááááááááren⌠ placσ.
  192.  
  193.           Standout Begin (SO)
  194.                          Ente≥ ástandou⌠ mode«  Iµ termina∞ áuse≤ ì
  195. ááááááááááááááááááááááááádiφ o≥ reduceΣ intensity¼ thσ áinitialiì
  196. ááááááááááááááááááááááááázatioε ástrinτ (T╔ below⌐ shoulΣ se⌠ át∩ ì
  197. áááááááááááááááááááááááááreduceΣ áintensity¼ áanΣ áthi≤ áfunctioε ì
  198. áááááááááááááááááááááááááset≤ norma∞ intensity.
  199.  
  200.           Standout End (SE)
  201.                          EnΣ áStandou⌠ mode«  Iµ yo⌡ usσ ádiφ áo≥ ì
  202. áááááááááááááááááááááááááreduceΣ ááintensit∙ áwitΦ áánorma∞ ááfo≥ ì
  203. ááááááááááááááááááááááááá"Standout"¼ thi≤ restore≤ thσ diφ mode.
  204.  
  205.           Initialize Terminal (TI⌐
  206.                          Initializσ thσ terminal«  Seσ note≤ áfo≥ ì
  207. ááááááááááááááááááááááááásuggestion≤ oε diφ anΣ reduceΣ intensit∙ ì
  208. áááááááááááááááááááááááááabove.
  209.  
  210. è          De-initialize Termina∞ (TE⌐
  211.                          Restorσ átermina∞ t∩ norma∞ ámode« á Seσ ì
  212. áááááááááááááááááááááááááabovσ notes.
  213.  
  214.           Delete Line (LD)
  215.                          Deletσ linσ oε whicΦ thσ curso≥ áreside≤ ì
  216. áááááááááááááááááááááááááanΣ ámovσ áline≤ ábelo≈ i⌠ áu≡ áb∙ áone«  ì
  217. áááááááááááááááááááááááááBottoφ linσ i≤ blank.
  218.  
  219.           Insert Line (LI)
  220.                          Inser⌠ áblanδ álinσ beforσ áthσ áonσ áoε ì
  221. áááááááááááááááááááááááááwhicΦ thσ curso≥ i≤ positioned¼ anΣ movσ ì
  222. áááááááááááááááááááááááááline≤ ábelo≈ dowε one«  Curso≥ move≤ át∩ ì
  223. ááááááááááááááááááááááááábeginninτ oµ thσ ne≈ blanδ line.
  224.  
  225.           Clear to End-of-Screen (CD)
  226.                          Clea≥ áscreeε froφ curren⌠ curso≥ áposiì
  227. ááááááááááááááááááááááááátioε t∩ thσ enΣ-oµ-screen.
  228.  
  229.           Se⌠ Attribute≤ (SA)
  230.                          Se⌠ ácharacte≥ attribute≤ baseΣ áoε áAT¼ ì
  231. ááááááááááááááááááááááááábelow.
  232.  
  233.           Attribute≤ (AT)
  234.                          Attributσ character≤ fo≥ thi≤ áterminal╗ ì
  235. áááááááááááááááááááááááááusuall∙ ánormal¼ áblink¼ áreverse¼ ááanΣ ì
  236. áááááááááááááááááááááááááunderscore.
  237.  
  238.           ReaΣ Curso≥ Positioε (RC)
  239.                          Returε curren⌠ curso≥ position.
  240.  
  241.           ReaΣ Termina∞ Linσ (RL)
  242.                          ReaΣ curren⌠ linσ u≡ t∩ curso≥.
  243.  
  244. Thσ áfollowinτ definition≤ implemen⌠ portion≤ oµ thσ áGRXLI┬ áanΣ ì
  245. GRWLI┬ functionality¼ bu⌠ iε differen⌠ TCA╨ locations.
  246.  
  247.           Graphics Dela∙ (GOELD)
  248.                          Dela∙ fo≥ graphic≤ on/off«  Usσ ágreate≥ ì
  249. áááááááááááááááááááááááááoµ thσ tw∩ dela∙ time≤ iε ámilliseconds«  ì
  250. áááááááááááááááááááááááááValue≤ oµ ░ t∩ 25╡ arσ acceptable.
  251.  
  252.           Graphics Mode On (GO)
  253.                          Set terminal to graphics mode.
  254.  
  255.           End Graphics Mode (GE⌐
  256.                          Restorσ termina∞ t∩ norma∞ áalphanumeriπ ì
  257. ááááááááááááááááááááááááámode.
  258.  
  259.           Curso≥ Ofµ (CDO⌐
  260.                          Disablσ ácurso≥ ádisplay« á NeedeΣ ááfo≥ ì
  261. ááááááááááááááááááááááááápul∞-dowε menus.
  262.  
  263.           Cursor On (CDE⌐
  264.                          Enablσ curso≥ display«  NeedeΣ fo≥ pul∞-ìèááááááááááááááááááááááááádowε menus.
  265.  
  266. Severa∞ ágraphic≤ ástring≤ arσ needeΣ t∩ áimplemen⌠ áthσ ádesireΣ ì
  267. leve∞ oµ functionality«  EacΦ oµ thesσ i≤ needeΣ iε thσ specifieΣ ì
  268. order«  Thσ termina∞ shoulΣ firs⌠ bσ placeΣ iε thσ graphic≤ mode¼ ì
  269. theε áthσ desireΣ strinτ sent«  Iµ string≤ fo≥ al∞ terminal≤ áarσ ì
  270. onl∙ ß singlσ character¼ thi≤ ma∙ bσ reduceΣ t∩ ß characte≥ arra∙ ì
  271. iε thσ future.
  272.  
  273.           Upper-Left Corner (GULC)
  274.           Upper-Right Corner (GURC⌐
  275.           Lower-Left Corner (GLLC⌐
  276.           Lower-Right Corner (GLRC⌐
  277.           Horizontal Line (GHL⌐
  278.           Vertical Line (GVL⌐
  279.           Solid (Full) Block (GFB⌐
  280.           Hashed Block (GHB⌐
  281.           Upper Intersect (GUI⌐
  282.           Lower Intersect (GLI⌐
  283.           Intersection (GIS⌐
  284.           Right Intersect (GRTI⌐
  285.           Left Intersect (GLTI⌐
  286.  
  287. Thσ áremainde≥ oµ thσ TCA╨ shoulΣ bσ filleΣ witΦ binar∙ zero≤ át∩ ì
  288. properl∙ handlσ futurσ additions.
  289.  
  290. Example:
  291. 
  292.      ; Z3TCAP:  NZWYS60.Z80
  293.      ; Author:  Joσ Wright
  294.      ╗ Date║    1▓ Octobe≥ 87
  295.      ╗ Version║ 1.0
  296.  
  297.      ╗ VERSION║ 2.▓   │ Februar∙ 90
  298.      ;
  299.      ╗ MoveΣ thσ C─ (clea≥ t∩ enΣ oµ screen⌐ strinτ bacδ afte≥ LI string.
  300.      ╗ Definσ B1│ a≤ offse⌠ froφ NZTCA╨ t∩ GOELD.
  301.  
  302.      ╗ VERSION║ 2.▒  1╣ Januar∙ 90
  303.  
  304.      ╗ AddeΣ ReaΣ Curso≥ anΣ ReaΣ Linσ functions.
  305.      ╗ Graphic≤ character≤ no≈ iε ß tablσ insteaΣ oµ individua∞ strings.
  306.  
  307.      ╗ VERSION║ 2.░  1▓ Decembe≥ 89
  308.  
  309.      ╗ ModifieΣ fo≥ ne≈ VLIB┤ graphic≤ anΣ fo≥ ne≈ SETAT╘ anΣ SETATR routines.
  310.      ╗ Thσ SA║ macr∩ strinτ i≤ modifieΣ fo≥ thσ routine≤ anΣ ß new string,
  311.      ╗ AT║ i≤ addeΣ t∩ contaiε thσ fou≥ maiε attribute≤ fo≥ thi≤ terminal:
  312.      ╗       Normal¼ Blink¼ Reverse¼ Underscore
  313.  
  314.      ; ExtendeΣ Termcap Datß fo≥ NZ
  315.  
  316.      ╗ Thi≤ i≤ thσ proposeΣ Termca≡ Datß fo≥ thσ Ne≈ Z-System.
  317.      ╗ I⌠ morσ full∙ describe≤ thσ termina∞ anΣ it≤ capabilities.
  318.  
  319. è     ES├       EQ╒       27                  ; ASCI╔ escape character
  320.  
  321.      ; ╔ havσ adopteΣ thσ conventioε tha⌠ ß termina∞ namσ i≤ terminated
  322.      ╗ witΦ ß spacσ character¼ thereforσ n∩ space≤ withiε thσ name.
  323.      ╗ Als∩ tha⌠ thσ termina∞ namσ i≤ uniquσ iε thσ firs⌠ eigh⌠ characters.
  324.      ;
  325.      NZTCAP:   DB        'WYSE-60D'          ; name of terminal (13 chars)
  326.  
  327.      ;
  328.      ╗ Thσ Graphic≤ sectioε i≤ n∩ longe≥ fixeΣ s∩ wσ mus⌠ provide an
  329.      ╗ offse⌠ t∩ it«  Onσ bytσ i≤ sufficien⌠ fo≥ ß two-recorΣ TCAP.
  330.      ;
  331.      B13║      D┬        GOELD-NZTCA╨        ╗ offse⌠ t∩ GOELD
  332.      ;
  333.      ╗ Bi⌠ ╖ oµ B1┤ indicate≤ thσ ne≈ ExtendeΣ TCAP«  Bit≤ 6-░ arσ undefined.
  334.      ;
  335.      B14║      D┬        10000000┬           ╗ extendeΣ TCAP
  336.      ;
  337.      ╗ I⌠ i≤ ofteε desirablσ t∩ differentiatσ terminal≤ witΦ othe≥ than
  338.      ╗ thei≥ commands«  Fo≥ examplσ TeleVide∩ 95╡ ha≤ thσ samσ command
  339.      ╗ se⌠ a≤ Wysσ 6░ bu⌠ take≤ les≤ timσ t∩ initializσ (reset).
  340.  
  341.      ;
  342.      ╗ 1╢ bit≤ arσ no≈ reserveΣ fo≥ indicatinτ termina∞ characteristics
  343.      ╗ whicΦ canno⌠ bσ knowε froφ thσ strings«  ╔ havσ defineΣ five
  344.      ╗ oµ thesσ bit≤ fo≥ m∙ owε purposes.
  345.      ;
  346.      ╗ B1╡ b░       Standou⌠         ░ ╜ half-intensity¼ ▒ ╜ reversσ video
  347.      ╗ B1╡ b▒       Powe≥ U≡ Dela∙   ░ ╜ none¼ ▒ ╜ 1░ seconΣ delay
  348.      ╗ B1╡ b▓       N∩ Wra≡          ░ ╜ linσ wrap¼ ▒ ╜ n∩ wrap
  349.      ╗ B1╡ b│       N∩ Scrol∞        ░ ╜ scroll¼ ▒ ╜ n∩ scroll
  350.      ╗ B1╡ b┤       ANS╔             ░ ╜ ASCII¼ ▒ ╜ ANSI
  351.      ;
  352.      B15:      DB        00000111B           ; powe≥ u≡ delay
  353.      ;
  354.  
  355.                DB        'K'-'@'             ; cursor up
  356.                DB        'J'-'@'             ; cursor down
  357.                DB        'L'-'@'             ; cursor right
  358.                DB        'H'-'@'             ; cursor left
  359.                DB        00                  ; clea≥ screen (CL⌐ delay
  360.                DB        00                  ; curso≥ position (CM⌐ delay
  361.                DB        00                  ; clea≥ t∩ EO╙ (CE) delay
  362.  
  363.      ; Strings start here.
  364.  
  365.      CL║       DB        ESC,'+',0           ; strinτ t∩ clear, home cursor    0
  366.      CM:       DB        ESC,'=%+ %+ ',0     ; strinτ t∩ position cursor       1
  367.      CE:       DB        ESC,'T',0           ; string t∩ clear to end-of-line  2
  368.      SO:       DB        ESC,')',0           ; string t∩ go to highligh⌠ video 3
  369.      SE:       DB        ESC,'(',0           ; string t∩ return normal video   4
  370.      TI:       DB        0                   ; string t∩ initialize terminal   5
  371.      TE:       DB        ESC,'(',0           ; string t∩ de-initialize terφ    6
  372.  
  373.      ;
  374. è     ; Extensions to Standard Z3TCAP
  375.      ;
  376.      LD║       DB        ESC,'M',0           ; strinτ t∩ delete linσ           7
  377.      LI║       DB        ESC,'L',0           ; strinτ t∩ insert linσ           8
  378.      CD║       DB        ESC,'J',0           ; strinτ t∩ clear to EO╙          9
  379.      ;
  380.      ╗ Se⌠ attributσ string≤ fo≥ normal¼ blink¼ reverse¼ underline.
  381.      ;
  382.      SA║       D┬        ESC,'G%+0',░        ╗ se⌠ attribute≤ prefi°          10
  383.      AT║       D┬        '0248',░            ╗ attribute≤                     11
  384.      ╗
  385.      ╗ Thesσ tw∩ allo≈ readinτ thσ terminal'≤ screen.
  386.      ;
  387.      RC║       D┬        ESC,'?',░           ╗ reaΣ curren⌠ curso≥ positioε   12
  388.      RL║       D┬        ESC,'6',░           ╗ reaΣ linσ unti∞ curso≥         13
  389.  
  390.      ;
  391.      ╗ Graphic≤ star⌠ here«  Wyse-6░ goe≤ graphiπ witΦ bi⌠ ╖ set.
  392.      ;
  393.      GOELD║    D┬        ░                   ╗ graphic≤ on/ofµ dela∙           0
  394.      ;
  395.      ╗ Graphic≤ string≤ offse⌠ froφ dela∙ value.
  396.      ;
  397.      GO║       DB        0                   ; strinτ t∩ turε oε graphic≤      1
  398.      GE║       ─B        0                   ; strinτ t∩ turε ofµ graphic≤     2
  399.      CDO:      DB        ESC,'`0',0          ; strinτ t∩ turε ofµ curso≥       3
  400.      CDE:      DB        ESC,'`1',0          ; strinτ t∩ enablσ curso≥         4
  401.  
  402.      GULC║     DB        'Z'+80h             ; upper left corner    [*▌        5
  403.      GURC:     DB        '?'+80h             ; upper right corner   [*▌        6
  404.      GLLC:     DB        '@'+80h             ; lower left corner    [*▌        7
  405.      GLRC:     DB        'Y'+80h             ; lower right corner   [*▌        8
  406.  
  407.      GHL:      DB        'D'+80h             ; horizontal line      [-▌        9
  408.      GVL:      DB        '3'+80h             ; vertical line        [|▌       10
  409.      GFB:      DB        '['+80h             ; full block string    [*▌       11
  410.      GHB:      DB        '2'+80h             ; hashed block string  [#▌       12
  411.      GUI:      DB        'B'+80h             ; upper intersection   [+▌       13
  412.      GLI:      DB        'A'+80h             ; lower intersection   [+▌       14
  413.      GIS:      DB        'E'+80h             ; intersection         [+▌       15
  414.      GRTI:     DB        '4'+80h             ; right intersection   [+▌       16
  415.      GLTI:     DB        'C'+80h             ; left intersection    [+▌       17
  416.      ;
  417.      ; Fill unused space with nulls.
  418.      ;
  419.                  REPT  128-[$-Z3TCAP]
  420.                DB    0
  421.                  ENDM
  422.      ;
  423.                END
  424.  
  425. ;------------- End of Sample N┌ TermCap -------------
  426. 
  427. .pa
  428. èBASI├ VLI┬ ROUTINES:
  429.  
  430. SCREEN¼ CURSOR¼ AN─ MISCELLANEOU╙ ROUTINES:
  431.  
  432.      Routine║   CLS
  433.      Function║ Clear entire screen and home cursor
  434.      Entry:    None
  435.      Exit:     A <> 0 zero flag reset (NZ) if screen cleared
  436.                A = 0, zero flag set (Z) if function not available
  437.      Affected: AF
  438.      Usage:    Mos⌠ áofteε useΣ t∩ providσ initia∞ áentr∙ ácondiì
  439. ááááááááááááááátions¼ áo≥ át∩ dividσ function≤ oµ ß áprograφ áfo≥ ì
  440. áááááááááááááááergonomiπ reasons.
  441.  
  442.      Routine║   CLREOS
  443.      Function: Clea≥ áfroφ ácurren⌠ curso≥ ápositioε át∩ áenΣ-oµ-ì
  444. áááááááááááááááscreeε leavinτ curso≥ iε presen⌠ position
  445.      Entry:    None
  446.      Exit:     A <> 0 zero flag reset (NZ) if screen cleared
  447.                A = 0, zero set (Z) if function not available
  448.      Affected: AF
  449.      Usage:    Remove≤ transien⌠ informatioε froφ thσ lowe≥ ápar⌠ ì
  450. áááááááááááááááoµ áß áscreeε whilσ retaininτ informatioε áoε áthσ ì
  451. áááááááááááááááuppe≥ part.
  452.  
  453.      Routine║   EREOL
  454.      Function║ Erase line from cursor position to end-of-line
  455.      Entry:    None
  456.      Exit:     A <> 0 zero flag reset (NZ) if line erased
  457.                A = 0, zero flag set (Z) if function not available
  458.      Affected: AF
  459.      Usage:    Insure≤ átha⌠ remaininτ informatioε oε ß álinσ ái≤ ì
  460. ááááááááááááááácleared
  461.  
  462.      Routine║   AT
  463.      Function: Positioε curso≥ froφ iε-linσ codσ coordinatσ posiì
  464. ááááááááááááááátions
  465.      Entry:    None; address of XY coordinates are on stack top
  466.      Exit:     None╗ áexecutioε resume≤ a⌠ instructioε áafte≥ áX┘ ì
  467. ááááááááááááááácoordinates
  468.      Affected: None
  469.      Usage:    Position≤ áthσ ácurso≥ a⌠ ro≈ anΣ ácolumε áaddres≤ ì
  470. ááááááááááááááápointeΣ t∩ b∙ thσ returε address«  UseΣ wherσ áthσ ì
  471. ááááááááááááááádesireΣ áro≈ anΣ columε positioε i≤ knowε áb∙ áthσ ì
  472. áááááááááááááááprogram¼ áanΣ doe≤ no⌠ changσ witΦ áprograφ áflow«  ì
  473. áááááááááááááááSeσ áGOTOX┘ áfo≥ positioninτ routinσ tha⌠ áma∙ ábσ ì
  474. ááááááááááááááávarieΣ withiε ß program«  Therσ i≤ n∩ checkinτ áoµ ì
  475. ááááááááááááááátermina∞ limit≤ iε thσ environment.
  476.      Example:
  477.                          EX╘       AT             ; declare the routine
  478.                          ...                      ; ..other parts of program
  479.                          CALL      AT             ; call the positioning routine
  480.                          DEFB      ROW,COL        ; ..row and column (1,1 is home)
  481.                          ...                      ; program flow resumes here
  482.  
  483. è     Routine║   GOTOXY
  484.      Function: Positioε curso≥ froφ ro≈ anΣ columε datß iε regisì
  485. áááááááááááááááters
  486.      Entry:    HL = desired cursor position (H=row, L=column)
  487.      Exit:     A <> 0 zero flag reset (NZ) if cursor positioned
  488.                A = 0, zero set (Z) if function not available
  489.      Affected: AF
  490.      Usage:    Positioε áthσ ácurso≥ a⌠ ro≈ (iε registe≥ áH⌐ áanΣ ì
  491. ááááááááááááááácolumε á(iε L)«  Thσ homσ positioε (to≡ lef⌠ ácorì
  492. áááááááááááááááner⌐ ái≤ áH=▒ anΣ L=1«  Wheε áthσ ádesireΣ ácurso≥ ì
  493. ááááááááááááááápositioε i≤ fixed¼ yo⌡ ma∙ wan⌠ t∩ usσ A╘ (above)«  ì
  494. áááááááááááááááBit≤ á▒ áanΣ ▓ oµ thσ ne≈ modσ bytσ áiε áthσ áTCA╨ ì
  495. áááááááááááááááshoulΣ bσ senseΣ beforσ positioninτ t∩ las⌠ Columε ì
  496. áááááááááááááááiε ß ro≈ t∩ avoiΣ screeε wrap/scrol∞ problems.
  497.      Example:
  498.                          EXT       GOTOXY         ; declare the routine
  499.                          ...                      ; ..intervening code
  500.                          L─        HL,10*256+│    ╗ loaΣ coord≤ (row 10, col 3)
  501.                          CALL      GOTOXY         ; try to position the cursor
  502.                          JR        NZ,MOVOK       ; ..jump if successful
  503.                          ...                      ; else try something else
  504.  
  505.      Routine║   SETATR
  506.      Function║ Se⌠ codeΣ attributes
  507.      Entry║    ┴ ╜ attributσ codσ (0..7)
  508.      Exit║     ┴ ╜ 0FFh¼ zer∩ flaτ clea≥ (NZ⌐ iµ attributσ i≤ available
  509.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ attributσ i≤ no⌠ available
  510.      Affected║ AF
  511.      Usage║    Attributσ code≤ are:
  512.                     ░ ╜ norma∞ (al∞ attribute≤ off)
  513.                     ▒ ╜ blink
  514.                     ▓ ╜ reversσ video
  515.                     │ ╜ blinδ anΣ reversσ video
  516.                     ┤ ╜ underscore
  517.                     ╡ ╜ blinδ anΣ underscore
  518.                     ╢ ╜ underscorσ anΣ reversσ video
  519.                     ╖ ╜ blink¼ underscore¼ anΣ reversσ video
  520.  
  521.      Routine║   SETATT
  522.      Function║ Se⌠ attributes
  523.      Entry║    ╚ ╜ firs⌠ value
  524.                ╠ ╜ seconΣ value
  525.      Exit║     ┴ <╛ 0¼ zer∩ flaτ clea≥ (NZ⌐ iµ functioε i≤ available
  526.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ functioε i≤ no⌠ available
  527.      Affected║ AF
  528.      Usage:    Use≤ áthσ samσ parse≥ a≤ GOTOXY¼ s∩ value≤ ma∙ ábσ ì
  529. ááááááááááááááápasseΣ át∩ i⌠ a≤ the∙ arσ t∩ thσ ácurso≥ ámovemen⌠ ì
  530. ááááááááááááááástring«  Refe≥ t∩ ZCPR3║ Thσ Manua∞ fo≥ C═ ástrinτ ì
  531. áááááááááááááááprogramminτ anΣ t∩ you≥ particula≥ termina∞ manua∞ ì
  532. áááááááááááááááfo≥ áattributσ values«  Also¼ seσ SETAT╥ ádescripì
  533. ááááááááááááááátioε above«  Yo⌡ ma∙ no⌠ neeΣ SETAT╘ a⌠ all.
  534. .pa
  535. è     Routine║   DELLIN
  536.      Function║ Delete the currently addressed line
  537.      Entry:    None
  538.      Exit:     A <> 0, zero flag clear (NZ) if action completed
  539.                A = 0, zero set (Z) if function not defined
  540.      Affected: AF
  541.      Usage:    Enhance≤ screeε edito≥ function≤ unde≥ ZCPR│ áwitΦ ì
  542. áááááááááááááááappropriatσ TERMCA╨ definitions.
  543.      Example║  Seσ INSLI╬ below.
  544.  
  545.      Routine║   INSLIN
  546.      Function║ Insert a new line at the current cursor position
  547.      Entry:    None
  548.      Exit:     A <> 0, zero flag clear (NZ) if action completed
  549.                A = 0, zero set (Z) if function not defined
  550.      Affected: AF
  551.      Usage:    Enhance≤ screeε edito≥ function≤ unde≥ ZCPR│ áwitΦ ì
  552. áááááááááááááááappropriatσ TERMCA╨ definitions.
  553.      Example:
  554.                          EXT       DELLIN,INSLI╬  ; declare the routines
  555.                          ...                      ; ..pos'n cursor to 
  556.                          ..«                      ╗ ..desired line
  557.                          CALL      DELLIN         ; kill it!
  558.                          JR        Z,NOTDONE      ; ..jump if not defined
  559.                          ...                      ; ..position to new line pos'n
  560.                          CALL      INSLIN         ; new line here,
  561.                                                   ╗ ..push others down
  562.                          JR        Z,NOINSL       ; ..jump if not defined
  563.                          ...                      ; else continue on
  564.  
  565.      Routine║   ISCUR
  566.      Function║ Test character for cursor movement key
  567.      Entry:    A = character to test
  568.      Exit:     ┴ á╜ á1..┤ (1=up¼ 2=down¼ 3=right¼ á4=left)¼ ázer∩ ì
  569. áááááááááááááááclea≥ (NZ⌐ iµ characte≥ i≤ curso≥ ke∙ froφ TCA╨ o≥ ì
  570. áááááááááááááááWordSta≥ curso≥ key
  571.                A = character, zero set (Z) if not cursor key
  572.      Affected: AF
  573.      Usage:    Determine≤ iµ ß characte≥ i≤ ß commanΣ t∩ movσ thσ ì
  574. ááááááááááááááácurso≥ áup¼ ádown¼ right¼ o≥ áleft« á BotΦ ásinglσ ì
  575. ááááááááááááááácharacte≥ command≤ froφ thσ extendeΣ TCAP¼ a≤ wel∞ ì
  576. áááááááááááááááa≤ WordSta≥ ^E¼ ^X¼ ^D¼ anΣ ^╙ arσ checked.
  577.      Example:
  578.                          EXT       ISCUR,CIN      ; declare some routines
  579.                          ...                      ; ..preceding code
  580.                          CALL      CIN            ; get char from keyboard
  581.                          CALL      ISCUR          ; is it a cursor key?
  582.                          JR        Z,NOCUR        ; ..jump if not a cursor key
  583.  
  584.      Routine║   VVERS
  585.      Function║ Return the VLIB version number
  586.      Entry:    None
  587.      Exit:     HL = VLIB version number (H=major, L=minor)
  588.      Affected: HL
  589.      Usage:    Mos⌠ áofteε calleΣ fo≥ debugginτ o≥ ádocumentatioε ìèááááááááááááááápurpose≤ t∩ includσ thσ VLI┬ librar∙ versioε ánumì
  590. ááááááááááááááábe≥ linkeΣ iε programs.
  591.  
  592. INITIALIZATION:
  593.  
  594.      Routine║   VIDINIT
  595.      Function║ Initialize the VLIB routines to a specified TCAP
  596.      Entry:    HL = address of a Z3 formatted TCAP
  597. .ix VIDPTR (g)
  598.      Exit:     None╗ ábu⌠ VIDPT╥ globa∞ initializeΣ t∩ áTCA╨ áanΣ ì
  599. áááááááááááááááVLI┬ set
  600.      Affected: None
  601.      Usage:    Provide≤ thσ abilit∙ t∩ usσ ß TCA╨ othe≥ thaε tha⌠ ì
  602. áááááááááááááááprovideΣ áiε áthσ ZCPR│ áenvironment« á Fo≥ áaddeΣ ì
  603. ááááááááááááááásafet∙ áiε áprogramming¼ yo⌡ shoulΣ als∩ áse⌠ áthσ ì
  604. áááááááááááááááZ3LI┬ variablσ ENVPT╥ t∩ aε addres≤ poin⌠inτ t∩ aε ì
  605. áááááááááááááááEN╓ áconstruc⌠ whicΦ provide≤ termina∞ áparameter≤ ì
  606. ááááááááááááááát∩ somσ routines.
  607.      Example:
  608.                          EXT       VIDINIT        ; declare the routine
  609.                          ...                      ; ..program initialization
  610.                          LD        HL,(Z3EADR⌐    ; load ENV address
  611.                          LD        DE,80H         ; offset to TCAP portion
  612.                          ADD       HL,DE
  613.                          CALL      VIDINIT        ; ..and initialize VLIB
  614.                          ...                      ; carry on with program
  615.  
  616.      Routine║   Z3VINIT
  617.      Function║ Initialize Z3LIB and VLIB routines for use
  618.      Entry:    HL = address of a ZCPR3 environment descriptor
  619.      Exit:     None
  620.      Affected: None
  621.      Usage:    Combine≤ thσ function≤ oµ thσ Z3LI┬ routinσ Z3INI╘ ì
  622. áááááááááááááááanΣ áVIDINI╘ covereΣ above«  I⌠ assume≤ átha⌠ áthσ ì
  623. áááááááááááááááTCA╨ ábegin≤ 80Φ (128⌐ byte≤ afte≥ áthσ áspecifieΣ ì
  624. áááááááááááááááenvironmen⌠ pointe≥ passeΣ iε HL.
  625.      Example:
  626.                          EXT       Z3VINIT        ; declare the routine
  627.                          ...                      ; ..initial program code
  628.                          LD        HL,(Z3EADR)    ; get the environment address
  629.                          CALL      Z3VINIT        ; ..set ENVPTR and init VLIB
  630.                          ...                      ; carry on!
  631.  
  632. PRINT ROUTINES:
  633.  
  634.      Routine║   GXYMSG
  635.      Function║ Position cursor and print text with highlighting
  636.      Entry:    None╗ áaddres≤ oµ X┘ coordinate≤ followeΣ b∙ átex⌠ ì
  637. áááááááááááááááoε stacδ top
  638.      Exit:     None; execution resumes after text terminating NUL
  639.      Affected: None
  640.      Usage:    Print≤ ß tex⌠ messagσ a⌠ ß prσ-defineΣ locatioε oε ì
  641. áááááááááááááááthσ termina∞ screen«  I⌠ i≤ analagou≤ t∩ positionì
  642. áááááááááááááááinτ thσ curso≥ witΦ A╘ followeΣ b∙ ß strinτ áprin⌠ ì
  643. áááááááááááááááwitΦ VPRINT«  Standou⌠ anΣ standenΣ attribute≤ arσ ì
  644. ááááááááááááááárecognizeΣ áwitΦ ábinar∙ á▒ áanΣ á▓ árespectively«  ìèáááááááááááááááTherσ ái≤ án∩ checkinτ oµ termina∞ limit≤ áiε áthσ ì
  645. áááááááááááááááenvironment.
  646.      Example:
  647.                          EX╘       GXYMSG         ; declare the routine
  648.                          ...                      ; ..intervening code
  649.                          CALL      GXYMSG         ; print as...
  650.                          DEF┬      2,1╡           ╗ positioε t∩ ro≈ 2¼ column 15
  651.                          DEFB      1,'Hi',2       ; ..and print this message
  652.                          DEFB      ' There!',0    ; ...highlighting "Hi"
  653.                          ...                      ; execution resumes here
  654.  
  655.      Routine║   VPRINT
  656.      Function║ Print NUL-terminated inline text with highlighting
  657.      Entry:    None; the string starting address in on stack top
  658.      Exit:     None╗ execution resumes after string terminator
  659.      Affected: None
  660.      Usage:    Print≤ áß tex⌠ strinτ froφ inlinσ codσ witΦ áhighì
  661. ááááááááááááááálightinτ áabilit∙ b∙ enablinτ STNDOU╘ modσ witΦ áß ì
  662. ááááááááááááááábinar∙ á1¼ anΣ resuminτ norma∞ prin⌠ áviß áSTNDEN─ ì
  663. áááááááááááááááwitΦ áß binar∙ 2«  Thi≤ i≤ VLIB'≤ versioε áoµ áthσ ì
  664. áááááááááááááááSYSLI┬ routinσ PRINT.
  665.      Example:
  666.                          EXT       VPRINT         ; declare the routine
  667.                          ...                      ; ..intervening code
  668.                          CALL      VPRINT         ; print the following line
  669.                          DEFB      2,'Hi',1       ; ..hilighting "Hi" and
  670.                          DEFB      ' There',0     ; ...the remainder in normal
  671.                          ...                      ; execution resumes here
  672.  
  673.      Routine║   VPSTR
  674.      Function║ Print a NUL-terminated message with highlighting
  675.      Entry:    HL = address of NUL-terminated string to print
  676.      Exit:     HL = points to byte after terminating NUL
  677.                A = 0, zero flag set (Z)
  678.      Affected: AF¼ HL
  679.      Usage:    Print≤ átex⌠ message≤ witΦ highlightinτ ácapabiliì
  680. ááááááááááááááátie≤ áprovideΣ b∙ STNDOUT/STNDEN─ áfroφ álocation≤ ì
  681. áááááááááááááááothe≥ áthaε áthσ executinτ code«  I⌠ i≤ áthσ áVLI┬ ì
  682. ááááááááááááááácorollar∙ oµ PST╥ iε SYSLIB.
  683.  
  684. STANDOUT MODE:
  685.  
  686.      Routine║   STNDOUT
  687.      Function║ Begin standout mode.
  688.      Entry:    None
  689.      Exit:     A <> 0 zero flag reset (NZ) if standout mode entered
  690.                A = 0, zero flag set (Z) if not available
  691.      Affected: AF
  692.      Usage:    Fo≥ áterminal≤ áwitΦ reversσ video¼ áthi≤ ároutinσ ì
  693. áááááááááááááááwil∞ ástar⌠ tha⌠ mode«  Fo≥ thosσ witΦ diφ o≥ áreì
  694. áááááááááááááááduceΣ video¼ usσ TINI╘ t∩ se⌠ thσ termina∞ t∩ tha⌠ ì
  695. ááááááááááááááámodσ áfo≥ ánorma∞ print¼ anΣ STNDOU╘ t∩ áplacσ áiε ì
  696. ááááááááááááááánorma∞ ámode«  DINI╘ shoulΣ theε reversσ oε áexit«  ì
  697. áááááááááááááááThi≤ modσ i≤ useΣ t∩ providσ visua∞ attribute≤ fo≥ ì
  698. ááááááááááááááábette≥ ámaε-machinσ áinterface«  Caution║ áD∩ áno⌠ ìèááááááááááááááárepositioε thσ curso≥ o≥ issuσ carriagσ return≤ o≥ ì
  699. ááááááááááááááálinσ áfeed≤ whilσ thσ standou⌠ modσ i≤ áiε áeffec⌠ ì
  700. ááááááááááááááásincσ áunknowε effect≤ caε occu≥ oε somσ type≤ áoµ ì
  701. áááááááááááááááterminals«  Usσ STNDEN─ t∩ disablσ thi≤ mode.
  702.  
  703.      Routine║   STNDEND
  704.      Function║ End standout mode, return to normal screen display
  705.      Entry:    None
  706.      Exit:     A <> 0 zero flag reset (NZ) if standout mode ended
  707.                A = 0, zero set (Z) if function not available
  708.      Affected: AF
  709.      Usage:    Reverse≤ thσ modσ se⌠ b∙ STNDOU╘ above«  Seσ note≤ ì
  710. áááááááááááááááfo≥ STNDOUT.
  711.  
  712. TERMINAL INITIALIZATION AND DE-INITIALIZATION:
  713.  
  714.      Routine║   TINIT
  715.      Function║ Initialize terminal for use with VLIB routines
  716.      Entry:    None
  717.      Exit:     None
  718.      Affected: None
  719.      Usage:    Wheε áwritinτ áprogram≤ baseΣ áoε áVLI┬ ároutines¼ ì
  720. áááááááááááááááTINI╘ shoulΣ bσ calleΣ earl∙ iε thσ prograφ áflow«  ì
  721. áááááááááááááááIµ yo⌡ arσ usinτ vide∩ attribute≤ t∩ providσ highì
  722. ááááááááááááááálightinτ áwitΦ STNDOUT/STNDEN─ anΣ áyou≥ átermina∞ ì
  723. áááááááááááááááonl∙ áprovide≤ ß diφ o≥ áreduceΣ-intensit∙ áattriì
  724. ááááááááááááááábute¼ TINI╘ shoulΣ se⌠ thσ norma∞ modσ t∩ thσ ádiφ ì
  725. áááááááááááááááo≥ áreduceΣ mode¼ anΣ STNDOU╘ useΣ fo≥ norma∞ áinì
  726. ááááááááááááááátensit∙ print«  Thσ correspondinτ DINI╘ shoulΣ ábσ ì
  727. áááááááááááááááuseΣ t∩ restorσ norma∞ modσ jus⌠ prio⌠ t∩ áprograφ ì
  728. áááááááááááááááexit.
  729.  
  730.      Routine║   DINIT
  731.      Function║ De-initialize the terminal; return to normal
  732.      Entry:    None
  733.      Exit:     None
  734.      Affected: None
  735.      Usage:    Normall∙ áuseΣ t∩ restorσ termina∞ defaul⌠ ácondiì
  736. ááááááááááááááátion≤ áupoε prograφ termination«  Seσ usagσ ánote≤ ì
  737. áááááááááááááááfo≥ TINI╘ above.
  738.      Example:
  739.                          EXT       TINIT,DINIT    ; declare the routines
  740.                          ...                      ; ..initial program code
  741.                          CALL      TINIT          ; initialize the terminal
  742.                          ...                      ; ..main program code
  743.                          CALL      DINIT          ; do just before exiting pgm
  744.                          JP        EXIT           ; ..and return to normal
  745. .pa
  746. èGRAPHICSô á(Januar∙ 22¼ 1990):é  Thesσ extension≤ t∩ VLI┬ áincorpoì
  747. ratσ man∙ oµ thσ interface≤ oµ thσ origina∞ Echelon/Denni≤ Wrigh⌠ ì
  748. GRXLI┬ anΣ GRWLIB¼ anΣ providσ additiona∞ functionalit∙ fo≥ easΘì
  749. e≥ áinterfacing«  The∙ requirσ thσ extendeΣ TCA╨ ádefinition≤ áiε ì
  750. orde≥ t∩ work.
  751.  
  752. INITIALIZATION:
  753.  
  754.      Routine║   GZ3INIT
  755.      Function║ Initialize Z3LIB and VLIB, return TCAP flags
  756.      Entry:    HL = pointer to Z3 environment descriptor
  757.      Exit:     A = bitmap of capabilities, zero set on results:
  758.                     b0 = ▒ áiµ delete/inser⌠ linσ present¼ á░ áiµ ì
  759. áááááááááááááááááááááááááabsent
  760.                     b1 = 1 if clear to EOS present, 0 if absent
  761.                     b2 = 1 if graphics on/off present, 0 if absent
  762.                     b3 = ▒ iµ 1│ graphic≤ character≤ exist¼ ░ áiµ ì
  763. áááááááááááááááááááááááááan∙ absent
  764.      Affected: AF
  765.      Usage:    Call≤ Z3VINI╘ anΣ thereforσ ma∙ bσ substituteΣ fo≥ ì
  766. ááááááááááááááái⌠ át∩ áse⌠ thσ Z3LI┬ ENVPT╥ anΣ áinitializσ áVLI┬ ì
  767. ááááááááááááááároutines«  Flaτ bit≤ arσ returneΣ t∩ sho≈ áwhethe≥ ì
  768. áááááááááááááááthσ TCA╨ extendeΣ function≤ arσ present.
  769.  
  770.      Routine║   GRXON
  771.      Function║ Place terminal in graphics mode
  772.      Entry:    None
  773.      Exit:     A <> 0, zero flag clear (NZ) if operation successful
  774.                A = 0, zero flag set (Z) if not implemented
  775.      Affected: AF
  776.      Usage:    Control≤ thσ graphic≤ capabilitie≤ oµ thσ termina∞ ì
  777. áááááááááááááááa≤ defineΣ iε thσ extendeΣ TCAP«  Iµ thi≤ áro⌡tinσ ì
  778. ááááááááááááááái≤ no⌠ implemented¼ an∙ call≤ t∩ graphiπ ároutine≤ ì
  779. áááááááááááááááwil∞ prin⌠ thσ defineΣ string≤ iε norma∞ áalphanuì
  780. ááááááááááááááámeriπ mode.
  781.      Example║  Seσ GRXOF╞ below.
  782.  
  783.      Routine:   GRXOFF
  784.      Function║ Return terminal to alphanumeric mode
  785.      Entry:    None
  786.      Exit:     A <> 0, zero flag clear (NZ) if operation successful
  787.                A = 0, zero flag set (Z) if not implemented
  788.      Affected: AF
  789.      Usage:    Turn≤ ofµ thσ graphic≤ capabilite≤ oµ you≥ átermiì
  790. ááááááááááááááána∞ a≤ defineΣ iε thσ extendeΣ TCAP.
  791.      Example:
  792.                          EXT       GRXON,GRXOF╞   ; define the routines
  793.                          ...                      ; ..do VIDINIT/Z3VINIT up here
  794.                          CALL      GRXON          ; put terminal in graphics mode
  795.                          JR        Z,NOGRAF       ; .jump if no graphics mode
  796.                          ...                      ; ..else print in graphics
  797.                          CALL      GRXOFF         ; return to alphanumeric mode
  798. .pa
  799. è     Routine║   CURON ¼  CUROFF
  800.      Function║ Turε displa∙ oµ curso≥ oε o≥ off
  801.      Entry║    None
  802.      Exit║     ┴ <╛ 0¼ zer∩ flaτ clea≥ (NZ⌐ iµ operatioε successful
  803.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ no⌠ implemented
  804.      Affected║ AF
  805.      Usage:    Thesσ routine≤ allo≈ inhibitinτ thσ curso≥ ádurinτ ì
  806. ááááááááááááááágraphiπ ádisplay≤ t∩ avoiΣ thσ distractioε oµ áthσ ì
  807. ááááááááááááááácurso≥ ájumpinτ áarounΣ thσ screen« á Turninτ áthσ ì
  808. ááááááááááááááácurso≥ áofµ áwil∞ supposedl∙ als∩ áspeeΣ áu≡ ásomσ ì
  809. ááááááááááááááátermina∞ operations«  CUROF╞ turn≤ ofµ thσ cursor¼ ì
  810. áááááááááááááááwhilσ CURO╬ turn≤ i⌠ bacδ on.
  811.  
  812. BLOC╦ GRAPHICS:
  813.  
  814.      Routines║  DRFULL ¼  DRHASH
  815.      Function║ Prin⌠ ß graphic≤ blocδ character
  816.      Entry:    None
  817.      Exit:     A <> 0, zero flag clear (NZ) if character printed
  818.                A = 0, zero flag set (Z) if not implemented
  819.      Affected: AF
  820.      Usage:    Thesσ ároutine≤ arσ useΣ b∙ severa∞ oµ áthσ áaddeΣ ì
  821. ááááááááááááááároutine≤ (fo≥ example¼ thσ linσ dra≈ routines⌐ át∩ ì
  822. áááááááááááááááprin⌠ ááful∞-blocδ ágraphic≤ ácharacter≤ át∩ ááthσ ì
  823. áááááááááááááááscreen«  DRFUL╠ print≤ ß ful∞ graphic≤ blocδ charì
  824. áááááááááááááááacter╗ áDRHAS╚ print≤ ß hasheΣ o≥ shadeΣ ágraphic≤ ì
  825. áááááááááááááááblocδ character.
  826.      Example:
  827.                          EX╘       DRFULL,DRHASH  ; declare the routines
  828.                          ...                      ; ..other code including Z3INIT
  829.                          CALL      DRFULL         ; print full block graphics
  830.                          CALL      DRHASH         ; ..and hashed (shaded) block
  831.                          ...                      ; carry on!
  832.  
  833. CORNER╙ AN─ INTERSECTIONS:
  834.  
  835.      Routines║  ULEFT ¼  URIGHT ¼  LLEFT ¼  LRIGHT
  836.      Function: Prin⌠ ácorne≥ graphic≤ characte≥ ¡¡ áULEF╘ áuppe≥-ì
  837. áááááááááááááááleft¼ URIGH╘ uppe≥-right¼ LLEF╘ lowe≥-left¼ LRIGH╘ ì
  838. ááááááááááááááálowe≥-right
  839.      Entry║    None
  840.      Exit:     A <> 0, zero flag clear (NZ) if character printed
  841.                A = 0, zero flag set (Z) if not implemented
  842.      Affected: AF
  843.      Usage:    Print≤ thσ respectivσ corne≥ graphic≤ ácharacters«  ì
  844. áááááááááááááááUseΣ áiε thσ bo° drawinτ routinσ describeΣ ábelow«  ì
  845. áááááááááááááááIµ yo⌡ havσ n∩ graphic≤ capability¼ usσ character≤ ì
  846. áááááááááááááááiε parenthese≤ iε TCA╨ strings.
  847. .pa
  848. è     Routines║  LTISEC ¼  RTISEC ¼  UISEC ¼  LISEC ¼  ISEC
  849.      Function: Prin⌠ áintersectioε graphic≤ characte≥ á¡¡ áLTISE├ ì
  850. áááááááááááááááleft¼ RTISE├ right¼ UISE├ upper¼ LISE├ lower¼ ISE├ ì
  851. áááááááááááááááintersection
  852.      Entry:    None
  853.      Exit:     A <> 0, zero flag clear (NZ) if character printed
  854.                A = 0, zero flag set (Z) if not implemented
  855.      Affected: AF
  856.      Usage:    A≤ áwitΦ thσ corne≥ routines¼ thesσ prin⌠ thσ áreì
  857. áááááááááááááááspectivσ ágraphic≤ characte≥ fo≥ áthei≥ áfunction«  ì
  858. áááááááááááááááDefinσ áthσ TCA╨ strinτ fo≥ thesσ function≤ t∩ ábσ ì
  859. áááááááááááááááthσ ASCI╔ characte≥ iε parenthese≤ iµ yo⌡ havσ án∩ ì
  860. ááááááááááááááágraphic≤ capability.
  861.      Example:
  862.                        EXT     LTISEC,RTISEC,UISEC,LISEC,ISEC  ; declare routines
  863.                        ...                    ; ..preceding code
  864.                        CALL    LTISEC         ; (or RTISEC, etc)
  865.  
  866. HORIZONTA╠ AN─ VERTICA╠ BARS:
  867.  
  868.      Routine║   DRHBAR
  869.      Function: Prin⌠ heav∙ horizonta∞ ba≥ witΦ thσ graphic≤ áful∞ ì
  870. áááááááááááááááo≥ hasheΣ blocδ characte≥ froφ inlinσ code
  871.      Entry:    None; the top of stack points to parameters
  872.      Exit:     None; execution resumes after the parameters
  873.      Affected: None
  874.      Usage:    UseΣ áwherσ fixeΣ parameter≤ exist«  Fo≥ ávariablσ ì
  875. ááááááááááááááába≥ parameters¼ usσ GHBA╥ whicΦ execute≤ thσ ásamσ ì
  876. áááááááááááááááfroφ áparameter≤ passeΣ iε registers« á Parameter≤ ì
  877. áááááááááááááááfo≥ DRHBA╥ are:
  878.                          cal∞ drhbar
  879.                          defb  Type    ; 1 = Full Block, 2 = Hashed Block
  880.                          defb  Row     ; 1 = Top Row on screen
  881.                          defb  Column  ; 1 = Left Most Column on screen
  882.                          defb  Length  ; Number of characters to print
  883.                          defΓ  Direc   ; 0 = Left-to-Right, 1 = R-to-L
  884.                Wheε bar≤ arσ specifieΣ a≤ righ⌠-t∩-left¼ thσ lef⌠ ì
  885. ááááááááááááááámargiε i≤ validateΣ fo≥ exceedinτ thσ lef⌠ margin¼ ì
  886. áááááááááááááááanΣ áonl∙ áthσ valiΣ portioε i≤ áprinted« á Actua∞ ì
  887. áááááááááááááááprintinτ i≤ alway≤ lef⌠-t∩-right.
  888.      Example:
  889.                          EX╘       DRHBA╥         ; declare the routine
  890.                          ...                      ; ..preceding code
  891.                          CALL      DRHBAR         ; draw heavy bar at:
  892.                          DEF┬      1,2,10,20,░    ╗ full¼ ro≈ 2¼ col 10, len 20
  893.                                                   ; ..print left-to-right
  894.                          ...                      ; execution resumes here
  895.  
  896.      Routines║  DRHORZ ¼  ERAHORZ
  897.      Function: Prin⌠ o≥ erasσ horizonta∞ linσ froφ inlinσ parameì
  898. áááááááááááááááters
  899.      Entry:    None╗ the top of stack points to parameters
  900.      Exit:     None; execution resumes after the parameters
  901.      Affected: None
  902.      Usage:    DRHOR┌ draw≤ ß thiε graphic≤ horizonta∞ line¼ áanΣ ìèáááááááááááááááERAHOR┌ áerase≤ áß álinσ b∙ áoverwritinτ ái⌠ áwitΦ ì
  903. áááááááááááááááspaces« á The∙ áarσ useΣ áwherσ áfixeΣ áparameter≤ ì
  904. áááááááááááááááexist«  Fo≥ variablσ ba≥ parameters¼ usσ GHBA╥ anΣ ì
  905. áááááááááááááááERAHBA╥ áwhicΦ áexecutσ thσ samσ áfroφ áparameter≤ ì
  906. ááááááááááááááápasseΣ iε registers«  Parameter≤ are:
  907.                          cal∞  drhorz [or erahorz]
  908.                          defb  Row     ; 1 = top row on screen
  909.                          defΓ  Column  ; 1 = left most column on screen
  910.                          defb  Length  ; number of characters to print
  911.                          defb  Direc   ; 0 = left-to-right, 1 = right-to-left
  912.                Wheε áline≤ áarσ specifieΣ a≤ árigh⌠-t∩-left¼ áthσ ì
  913. ááááááááááááááálef⌠ ámargiε i≤ validateΣ fo≥ exceedinτ áthσ álef⌠ ì
  914. ááááááááááááááámargin¼ áanΣ áonl∙ thσ valiΣ portioε ái≤ áprinted«  ì
  915. áááááááááááááááActua∞ printinτ i≤ alway≤ lef⌠-t∩-right.
  916.      Example:
  917.                          EX╘       DRHORZ,ERAHOR┌ ; declare the routines
  918.                          ...                      ; ..preceding code
  919.                          CALL      DRHORZ         ; draw horizontal line at:
  920.                          DEF┬      2,10,20,░      ╗ ro≈ 2¼ co∞ 10¼ length 20
  921.                                                   ; ..print left-to-right
  922.                          ...                      ; execution resumes here
  923.                          CALL      ERAHORZ        ; erase the horizontal line at:
  924.                          DEF┬      5,60,20,▒      ╗ ro≈ 5¼ co∞ 60¼ length 20
  925.                                                   ╗ ..froφ righ⌠-t∩-left
  926.  
  927.      Routine║   GHBAR
  928.      Function: Prin⌠ ß graphic≤ horizonta∞ bar/linσ froφ áparameì
  929. áááááááááááááááter≤ iε registers
  930.      Entry:    A = bar type (0=line, 1=full block, 2=hashed block)
  931.                B = length of bar
  932.                C = print direction (0=left-to-right,1=right-to-left)
  933.                H = starting row (1=top of screen)
  934.                L = starting column (1=leftmost column)
  935.      Exit:     None; registers are meaningless, the bar is printed
  936.      Affected: AF¼ BC¼ HL
  937.      Usage:    UseΣ wherσ horizonta∞ ba≥ parameter≤ arσ calculatì
  938. áááááááááááááááeΣ b∙ ß program¼ o≥ no⌠ knowε a⌠ assembl∙ time.
  939.      Examplσ (see als∩ note in DRHORZ example):
  940.                          EXT       GHBA╥          ; declare the routine
  941.                          ...                      ; ..preceding code
  942.                          LD        A,2            ; print bar w/hashed block char
  943.                          LD        HL,10*256+25   ; .start at row 10, column 25
  944.                          LD        BC,15*256+0    ; ..length of 15, left-to-right
  945.                          CALL      GHBAR          ; print it graphically
  946.  
  947.      Routine║   ERAHBAR
  948.      Function║ Erase horizontal bar from register parameters
  949.      Entry:    B = length of bar
  950.                C = print direction (0=left-to-right,1=right-to-left)
  951.                H = starting row (1=top of screen)
  952.                L = starting column (1=leftmost column)
  953.      Exit:     None; registers are meaningless, the bar is erased
  954.      Affected: AF¼ BC¼ HL
  955.      Usage:    Erase≤ ß horizonta∞ ba≥ b∙ overwritinτ witΦ space≤ ì
  956. áááááááááááááááwherσ áparameter≤ arσ calculateΣ b∙ ß program¼ áo≥ ìèáááááááááááááááarσ no⌠ knowε a⌠ assembl∙ time.
  957.      Examplσ (see als∩ note in ERAHORZ example):
  958.                          EX╘       ERAHBAR        ; declare the routine
  959.                          ...                      ; ..preceding code
  960.                          LD        HL,8*256+50    ; .start at row 8, column 50
  961.                          LD        BC,40*256+1    ; ..length of 40, right-to-left
  962.                          CALL      ERAHBAR        ; erase it
  963.  
  964.      Routine║   DRVBAR
  965.      Function: Dra≈ heav∙ vertica∞ ba≥ froφ parameter≤ passeΣ áoε ì
  966. ááááááááááááááástack
  967.      Entry:    None; parameters are addressed by top of stack
  968.      Exit:     None╗ áexecutioε resume≤ afte≥ parameters¼ ba≥ ái≤ ì
  969. áááááááááááááááprinted
  970.      Affected: None
  971.      Usage:    UseΣ wheε ß heav∙ fixeΣ-locatioε ba≥ i≤ needed¼ o≥ ì
  972. ááááááááááááááába≥ locatioε anΣ sizσ arσ knowε a⌠ assembl∙ átime«  ì
  973. áááááááááááááááBa≥ character≤ ma∙ bσ ful∞ o≥ hasheΣ block¼ eithe≥ ì
  974. ááááááááááááááásinglσ áo≥ doublσ width«  Seσ GVBA╥ fo≥ áthσ ásamσ ì
  975. áááááááááááááááfunction≤ áfroφ áparameter≤ passeΣ áiε áregisters«  ì
  976. áááááááááááááááParameter≤ are:
  977.                          cal∞  drvbar  ; call routine passing param≤ addr
  978.                          defb  Type    ; 1=solid single-wide, 2=solid
  979.                                        ╗ double-wide¼ 3=hashed single-
  980.                                        ╗ wide, 4=hashed double-wide
  981.                          defΓ  Row     ; starting row (1=top row)
  982.                          defΓ  Column  ; starting column (1=leftmost col)
  983.                          defb  Length  ; number of columns in bar
  984.                          defb  Dir     ; 0=top-to-bottom, 1=bottom-to-top
  985.                Wheε ß ba≥ i≤ drawε froφ bottoφ-t∩-top¼ check≤ arσ ì
  986. ááááááááááááááámadσ fo≥ exceedinτ thσ to≡ oµ screeε (ro≈ 1)«  Thσ ì
  987. ááááááááááááááálengtΦ i≤ adjusteΣ iµ s∩ t∩ prin⌠ onl∙ thσ par⌠ oε ì
  988. áááááááááááááááscreen«  Bar≤ arσ alway≤ printeΣ to≡-t∩-bottom.
  989.      Example:
  990.                          EXT       DRVBAR         ; declare the routine
  991.                          ...                      ; ..preceding code
  992.                          CALL      DRVBAR         ; draw vertical bar as:
  993.                          DEFB      2,20,10,5,0    ; solid single-width, row 20,
  994.                                                   ; ..col 10, 5 long,
  995.                                                   ╗ ..to≡-t∩-bottom
  996.                          ...                      ; execution resumes here
  997.  
  998.      Routines║  DRVERT ¼  ERAVERT
  999.      Function: Prin⌠ o≥ erasσ graphic≤ vertica∞ linσ froφ áinlinσ ì
  1000. áááááááááááááááparameters
  1001.      Entry:    None; the top of stack points to parameters
  1002.      Exit:     None; execution resumes after the parameters
  1003.      Affected: None
  1004.      Usage:    DRVER╘ print≤ ß vertica∞ linσ anΣ ERAVER╘ erase≤ ß ì
  1005. ááááááááááááááávertica∞ linσ froφ inlinσ parameters«  Thesσ árouì
  1006. ááááááááááááááátine≤ arσ useΣ wherσ fixeΣ parameter≤ exist« á Fo≥ ì
  1007. ááááááááááááááávariablσ ába≥ áparameter≤ usσ GVBA╥ áanΣ áERAVBAR¼ ì
  1008. áááááááááááááááwhicΦ áexecutσ thσ samσ froφ parameter≤ passeΣ áiε ì
  1009. áááááááááááááááregisters«  Parameter≤ are:
  1010. .pa
  1011. è                         cal∞  drvert [or eravert]
  1012.                          defb  Row     ; 1=top row on screen
  1013.                          defb  Column  ; 1=leftmost column on screen
  1014.                          defb  Length  ; number of characters to print
  1015.                          defb  Direc   ; 0=top-to-bottom, 1=bottom-to-top
  1016.                Wheε ß ba≥ i≤ drawε froφ bottoφ-t∩-top¼ check≤ arσ ì
  1017. ááááááááááááááámadσ fo≥ exceedinτ thσ to≡ oµ screeε (ro≈ 1)«  Thσ ì
  1018. ááááááááááááááálengtΦ i≤ adjusteΣ iµ s∩ t∩ prin⌠ onl∙ thσ par⌠ oε ì
  1019. áááááááááááááááscreen«  Bar≤ arσ alway≤ printeΣ to≡-t∩-bottom.
  1020.      Example:
  1021.                          EX╘       DRVERT,ERAVER╘ ╗ declarσ thσ routines
  1022.                          ..«                      ╗ ..precedinτ code
  1023.                          CALL      DRVERT         ; draw vertical line at:
  1024.                          DEFB      2,10,15,0      ; row 2, col 10, length 15
  1025.                                                   ; ..print top-to-bottom
  1026.                          ..«                      ; execution resumes here
  1027.                          CALL      ERAVERT        ; erase the vertical line at:
  1028.                          DEFB      22,60,20,1     ; row 22, col 60, length 20
  1029.                                                   ; ..from bottom-to-top
  1030.  
  1031.      Routine║   GVBAR
  1032.      Function: Prin⌠ ágraphic≤ ávertica∞ bar/linσ áfroφ áregiste≥ ì
  1033. áááááááááááááááparameters
  1034.      Entry:    ┴ ╜ ba≥ typσ (0=line¼ 1=singlσ ful∞ block¼ á2=douì
  1035. áááááááááááááááblσ ful∞ block¼ 3=singlσ hasΦ block¼ 4=doublσ hasΦ ì
  1036. áááááááááááááááblock)
  1037.                B = length of bar (number of characters)
  1038.                C = print direction (0=top-to-bottom,1=bottom-to-top)
  1039.                H = starting row (1=top of screen)
  1040.                L = starting column (1=leftmost column)
  1041.      Exit:     None; registers are meaningless, the bar is printed
  1042.      Affected: AF¼ BC¼ HL
  1043.      Usage:    Print≤ ácalculateΣ ávertica∞ ábar≤ áfroφ áprogram≤ ì
  1044. áááááááááááááááwherσ parameter≤ arσ no⌠ knowε a⌠ assembl∙ time.
  1045.      Examplσ (see note in DRVERT example):
  1046.                          EX╘       GVBAR          ; declare the routine
  1047.                          ...                      ; ..preceding code
  1048.                          LD        A,2            ; double bar w/full block char
  1049.                          LD        HL,22*256+60   ; .start at row 22, column 60
  1050.                          LD        BC,15*256+1    ; ..length of 15, bottom-to-top
  1051.                          CALL      GVBAR          ; print it graphically
  1052.  
  1053.      Routine║   ERAVBAR
  1054.      Function║ Erase vertical bar from register parameters
  1055.      Entry:    B = length of bar (number of characters)
  1056.                ├ ╜ prin⌠ directioε (0=to≡-t∩-bottom¼ 1=bottoφ-t∩-ì
  1057. ááááááááááááááátop)
  1058.                H = starting row (1=top of screen)
  1059.                L = starting column (1=leftmost column)
  1060.      Exit:     None; registers are meaningless, the bar is erased
  1061.      Affected: AF¼ BC¼ HL
  1062.      Usage:    Erase≤ áß vertica∞ ba≥ b∙ overwritinτ witΦ áspace≤ ì
  1063. áááááááááááááááwherσ áparameter≤ arσ calculateΣ b∙ ß program¼ áo≥ ì
  1064. áááááááááááááááarσ áno⌠ áknowε a⌠ assembl∙ time« á D∩ átwicσ áfo≥ ì
  1065. ááááááááááááááádoublσ-widtΦ bar.
  1066. è     Examplσ (see note in ERAVERT example):
  1067.                          EX╘       ERAVBAR        ; declare the routine
  1068.                          ...                      ; ..preceding code
  1069.                          LD        HL,8*256+10    ; .start at row 8, column 10
  1070.                          LD        BC,15*256+0    ; ..length of 15, top-to-bottom
  1071.                          CALL      ERAVBAR        ; erase it
  1072.  
  1073. BO╪ DRAWIN╟ ROUTINES:
  1074.  
  1075.      Routines║  DRFBOX ¼  DRBOX ¼  ERABOX
  1076.      Function: Dra≈ anΣ erasσ graphic≤ characte≥ bo° froφ áinlinσ ì
  1077. áááááááááááááááparameters
  1078.      Entry:    None; the top of stack addresses box parameters
  1079.      Exit:     None╗ áexecutioε áresume≤ a⌠ ábytσ áfollowinτ áthσ ì
  1080. áááááááááááááááparameters
  1081.      Affected: None
  1082.      Usage:    DRFBO╪ draw≤ graphic≤ boxe≤ frameΣ witΦ ful∞ blocδ ì
  1083. ááááááááááááááácharacters¼ DRBO╪ draw≤ graphic≤ boxe≤ frameΣ witΦ ì
  1084. ááááááááááááááánorma∞ ágraphic≤ linσ anΣ corne≥ ácharacters¼ áanΣ ì
  1085. áááááááááááááááERABO╪ áerase≤ ß box«  Boxe≤ arσ drawε áfroφ áto≡-ì
  1086. ááááááááááááááálef⌠ át∩ bottoφ right¼ anΣ eraseΣ áb∙ áoverwritinτ ì
  1087. áááááááááááááááwitΦ spaces«  Parameter≤ are:
  1088.                          cal∞  drfbox  ; (or drbox or erabox)
  1089.                          defb  Row     ; starting row (1 = top row)
  1090.                          defb  Column  ; starting column
  1091.                          defb  Height  ; height of box in character rows
  1092.                          defb  Width   ; width of box in character positions
  1093.      Example:
  1094.                          EX╘       DRFBOX,DRBOX,ERABOX ; declare routines
  1095.                          ...                      ; ..preceding code
  1096.                          CALL      DRBOX          ; draw a normal box
  1097.                          DEFB      5,5,10,20      ; row 5, col 5, 10 spaces high
  1098.                                                   ; ..and 20 spaces wide
  1099.                          CALL      DRFBOX         ; draw box framed w/solid blks
  1100.                          DEFB      10,30,6,25     ; row 10, col 30, 6 spaces high
  1101.                                                   ; ..and 25 wide
  1102.                          CALL      ERABOX         ; erase the first box
  1103.                          DEFB      5,5,10,20
  1104.                          ...                      ; ..and continue
  1105.  
  1106.      Routines║  GFBOX ¼  GBOX ¼  GERBOX
  1107.      Function: Dra≈ o≥ erasσ graphic≤ characte≥ bo° froφ registe≥ ì
  1108. áááááááááááááááparameters
  1109.      Entry:    B = width of box in character spaces
  1110.                C = height of box in lines
  1111.                H = starting row (top left corner, 1=top row)
  1112.                ╠ á╜ startinτ columε (to≡ lef⌠ corner¼ á1=leftmos⌠ ì
  1113. ááááááááááááááácolumn)
  1114.      Exit:     None; registers indeterminate, box drawn
  1115.      Affected: AF¼ BC¼ HL
  1116.      Usage:    GFBO╪ ádraw≤ graphic≤ bo° frameΣ witΦ soliΣ áblocδ ì
  1117. ááááááááááááááácharacters¼ áGBO╪ ádraw≤ graphiπ bo° áframeΣ áwitΦ ì
  1118. ááááááááááááááálinσ anΣ corne≥ graphic≤ characters¼ GERBO╪ erase≤ ì
  1119. ááááááááááááááábo° áb∙ overwritinτ witΦ spaces« á Thesσ ároutine≤ ì
  1120. áááááááááááááááimplemen⌠ áthσ samσ function≤ a≤ thσ previou≤ ábo° ìèááááááááááááááároutines¼ ábu⌠ áderivσ thei≥ parameter≤ áfroφ áCP╒ ì
  1121. áááááááááááááááregisters« á Usσ áthesσ ároutine≤ áfo≥ ácalculateΣ ì
  1122. ááááááááááááááávalue≤ o≥ fo≥ parameter≤ no⌠ knowε a⌠ assembly.
  1123.      Example:
  1124.                          EX╘       GFBOX,GBOX,GERBOX ; declare the routines
  1125.                          ...                      ; ..preceding code
  1126.                          LD        BC,30*256+10   ; 30 spaces wide, 10 high
  1127.                          LD        HL,10*256+20   ; ..at row 10, col 20
  1128.                          CALL      GBOX           ; draw it!
  1129.  
  1130.      Routine║   CHKBOX
  1131.      Function║ Check and adjust box parameters
  1132.      Entry:    B = width of box in character spaces
  1133.                C = height of box in lines
  1134.                H = starting row (top left corner, 1=top row)
  1135.                ╠ á╜ startinτ columε (to≡ lef⌠ corner¼ á1=leftmos⌠ ì
  1136. ááááááááááááááácolumn)
  1137.      Exit:     ┴ á<╛ 0¼ zer∩ clea≥ (NZ⌐ iµ bo° drawable¼ áparameì
  1138. áááááááááááááááter≤ set
  1139.                A = 0, zero flag clear (Z) if box not drawable
  1140.      Affected: AF, anΣ maybe B├ anΣ HL if parameters arσ adjusted
  1141.      Usage:    Thi≤ ároutinσ ái≤ useΣ internall∙ át∩ áadjus⌠ ábo° ì
  1142. ááááááááááááááádimension≤ át∩ áscreeε sizσ reflecteΣ iε áthσ áCR╘ ì
  1143. ááááááááááááááádatß iε thσ Z│ environment«  Startinτ ro≈ o≥ ácolì
  1144. áááááááááááááááumε áexceedinτ áthσ maximuφ heigh⌠ o≥ áwidtΦ áwil∞ ì
  1145. ááááááááááááááácausσ áthσ áerro≥ status«  I⌠ ma∙ ábσ áuseΣ áafte≥ ì
  1146. ááááááááááááááásettinτ áregister≤ fo≥ ß GRBO╪ o≥ GRFBO╪ ácal∞ át∩ ì
  1147. ááááááááááááááásavσ áthσ áactua∞ ábo° parameter≤ áwhicΦ áwil∞ ábσ ì
  1148. ááááááááááááááádrawn.
  1149.      Example:
  1150.                          EXT       CHKBOX,GBOX    ; declare the routines
  1151.                          ...                      ; ..set up for box draw
  1152.                          CALL      CHKBOX         ; validate the dimen/location
  1153.                          JR        Z,NOGOOD       ; ..jump if can't draw this one
  1154.                          LD        (HITWID),BC    ; else save width/height
  1155.                          LD        (ROWCOL),HL    ; ..and row/col start loc'n
  1156.                          CALL      GBOX           ; draw this box
  1157.                          ...
  1158.  
  1159. PULL-DOW╬ MENUS:
  1160.  
  1161.      Routine║   SETPDM
  1162.      Function: Se⌠ áselec⌠ men⌡ anΣ iteφ men⌡ ba≥ áfo≥ ápul∞-dowε ì
  1163. ááááááááááááááámen⌡ froφ inlinσ data
  1164.      Entry:    None; top of stack points to menu data area
  1165.      Exit:     A <> 0, zero flag clear (NZ) if pull-down menu OK
  1166.                A = 0, zero set (Z) if error or not supported
  1167.      Affected: AF
  1168.      Usage: á  SETPD═ áuse≤ inlinσ parameter≤ anΣ áestablishe≤ áß ì
  1169. ááááááááááááááásinglσ men⌡ selection¼ anΣ se⌠ informatioε fo≥ thσ ì
  1170. ááááááááááááááápul∞-dowε iteφ selectioε bar«  Thσ numbe≥ oµ ámen⌡ ì
  1171. áááááááááááááááselection≤ ái≤ determineΣ b∙ screeε width¼ anΣ áu≡ ì
  1172. ááááááááááááááát∩ áteε áselection≤ ma∙ bσ supported« á Men⌡ ádatß ì
  1173. ááááááááááááááádescription≤ áarσ ASCI╔ tex⌠ string≤ áwitΦ ábinar∙ ì
  1174. ááááááááááááááávalue≤ oµ onσ t∩ teε (onl∙ ▒-╡ currentl∙ used⌐ át∩ ìèááááááááááááááádenotσ specia∞ feature≤ anΣ fields.
  1175.  
  1176.                Thσ men⌡ datß areß i≤ structured a≤ follows:
  1177.                     Menu number (byte⌐ in the range of 1..10
  1178.                     Menu name (string) terminated by binary 1
  1179.                     Item selection strings terminated by binary 3's
  1180.                Optiona∞ field≤ ma∙ bσ intersperseΣ witΦ selectioε ì
  1181. ááááááááááááááástrings:
  1182.                     Sub-header strings terminated by binary 2's
  1183.                     Separator lines indicateΣ b∙ binary ┤ (byte)
  1184.                     Blank lines indicateΣ b∙ binary ╡ (byte)
  1185.      Example:
  1186.                               EXT       SETPDM    ; declare the routine
  1187.                               ...                 ; ..call PDMINI up here
  1188.                               CALL      SETPDM
  1189.                               DEFB      1         ; menu number (1..10)
  1190.                               DEFB      'MenuName',1 ; name on menu bar
  1191.                               DEFB      'Subheader',2 ; optional subheader(s)
  1192.                               DEFB      4         ; optional separator line
  1193.                               DEFB      'Item 1',3 ; first item name
  1194.                               DEFB      5         ; optional blank line
  1195.                               DEFB      'Item 2',3 ; second item name
  1196.                               DEFB      0         ; end of menu item list
  1197.                               ...                 ; ..execution resumes here
  1198.  
  1199.      Routine║   SETPDR
  1200.      Function║ Se⌠ áselec⌠ men⌡ anΣ iteφ men⌡ ba≥ áfo≥ ápul∞-dowε ì
  1201. ááááááááááááááámen⌡ froφ registe≥ data
  1202.      Entry:    HL = pointer to menu data area
  1203.      Exit:     A <> 0, zero flag clear (NZ) if pull-down menu OK
  1204.                A = 0, zero set (Z) if error or not supported
  1205.                HL = address of byte after terminating NUL
  1206.      Affected: AF¼ HL
  1207.  
  1208.      Usage: á  SETPD╥ use≤ ß separatσ datß areß pointeΣ t∩ b∙ áH╠ ì
  1209. áááááááááááááááanΣ áestablishe≤ ß singlσ men⌡ selection¼ anΣ áse⌠ ì
  1210. áááááááááááááááinformatioε fo≥ thσ pul∞-dowε iteφ selectioε ábar«  ì
  1211. áááááááááááááááThσ ánumbe≥ áoµ men⌡ selection≤ i≤ ádetermineΣ áb∙ ì
  1212. áááááááááááááááscreeε áwidth¼ áanΣ u≡ t∩ teε áselection≤ áma∙ ábσ ì
  1213. ááááááááááááááásupported«  Men⌡ datß description≤ arσ ASCI╔ átex⌠ ì
  1214. ááááááááááááááástring≤ witΦ binar∙ value≤ oµ onσ t∩ teε (onl∙ ▒-╡ ì
  1215. ááááááááááááááácurrentl∙ áused⌐ át∩ denotσ specia∞ áfeature≤ áanΣ ì
  1216. áááááááááááááááfields.
  1217.  
  1218.                Thσ men⌡ datß areß i≤ structured a≤ follows:
  1219.                     Menu number (byte⌐ in the range of 1..10
  1220.                     Menu name (string) terminated by binary 1
  1221.                     Item selection strings terminated by binary 3's
  1222.                Optiona∞ field≤ ma∙ bσ intersperseΣ witΦ selectioε ì
  1223. ááááááááááááááástrings:
  1224.                     Sub-header strings terminated by binary 2's
  1225.                     Separator lines indicateΣ b∙ binary ┤ (byte)
  1226.                     Blank lines indicateΣ b∙ binary ╡ (byte)
  1227.      Example║  Seσ SETPD═ above.
  1228.  
  1229. è     Routine║   CLRPDM
  1230.      Function║ Clear a pull-down menu from the menu selection bar
  1231.      Entry:    A = menu number to clear (0 = clear all)
  1232.      Exit:     A <> 0, zero flag clear (NZ) if operation successful
  1233.                A = 0, zero flag set (Z) if entry not found
  1234.      Affected: AF
  1235.      Usage:    Delete≤ áaε entr∙ froφ thσ men⌡ ba≥ anΣ move≤ áal∞ ì
  1236. ááááááááááááááásubsequen⌠ áentrie≤ át∩ thσ left« á Logica∞ áentr∙ ì
  1237. ááááááááááááááánumber≤ ásta∙ áthσ samσ a≤ wheε loaded¼ ábu⌠ áthi≤ ì
  1238. áááááááááááááááfunctioε refer≤ t∩ thσ physica∞ positioninτ oε thσ ì
  1239. ááááááááááááááámen⌡ bar.
  1240.      Example:
  1241.                          EXT       CLRPDM         ; declare the variable
  1242.                          ...                      ; ..establish pull-down menus
  1243.                          LD        A,4            ; remove the 4th entry
  1244.                          CALL      CLRPDM         ; ..in the bar
  1245.                          JR        NZ,REMOK       ; jump if removal OK
  1246.                          ...
  1247.  
  1248.      Routine║   SELPDM
  1249.      Function: Ente≥ ápul∞-dowε men⌡ anΣ returε menu/iteφ áselecì
  1250. ááááááááááááááátions
  1251.      Entry:    None
  1252.      Exit:     ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ pul∞-dowε men⌡ áescapσ ì
  1253. áááááááááááááááke∙ pressed
  1254.                A <> 0, zero clear (NZ) if menu item selected
  1255.                H = menu numbe≥ selected
  1256.                L = item selection numbe≥ selected
  1257.      Affected: AF¼ HL
  1258.      Usage:    Thi≤ routinσ form≤ thσ hear⌠ oµ thσ pul∞-dowε men⌡ ì
  1259. ááááááááááááááásystem«  Wheε entered¼ contro∞ wil∞ no⌠ returε át∩ ì
  1260. áááááááááááááááthσ prograφ unti∞ eithe≥ thσ pul∞-dowε men⌡ escapσ ì
  1261. ááááááááááááááácharacte≥ i≤ pressed¼ o≥ ß valiΣ men⌡ anΣ iteφ arσ ì
  1262. áááááááááááááááselected« á B∙ áevaluatinτ áthσ áreturneΣ ávalues¼ ì
  1263. áááááááááááááááspecifiπ áaction≤ ma∙ bσ takeε sucΦ áa≤ áselectinτ ì
  1264. áááááááááááááááprogram≤ t∩ run¼ item≤ t∩ list¼ etc.
  1265.  
  1266.      Routine║   MCLS
  1267.      Function║ Clear terminal screen except for pull-down menu bar
  1268.      Entry:    None
  1269.      Exit:     A <> 0, zero flag reset (NZ) if screen cleared OK
  1270.                A = 0 zero flag set (Z) if CLREOS not implemented
  1271.      Affected: AF
  1272.      Usage:    Clear≤ áthσ áscreeε áfroφ linσ ▓ át∩ áthσ áenΣ-oµ-ì
  1273. áááááááááááááááscreen¼ át∩ preservσ pul∞-dowε men⌡ selectioε ába≥ ì
  1274. áááááááááááááááoε linσ 1.
  1275.  
  1276.      Routine║   PDMINI
  1277.      Function║ Initialize pull-down menu functions
  1278.      Entry:    None
  1279.      Exit:     None; internal menu variables are initialized
  1280.      Affected: None
  1281.      Usage:    Thi≤ ároutinσ mus⌠ bσ calleΣ beforσ thσ ápul∞-dowε ì
  1282. ááááááááááááááámen⌡ ásysteφ i≤ used«  I⌠ clear≤ needeΣ ávariable≤ ì
  1283. áááááááááááááááanΣ set≤ thσ defaul⌠ pul∞-dowε men⌡ escapσ characìèáááááááááááááááte≥ t∩ ES├ (1Bh).
  1284.      Example:
  1285.                          EXT       PDMINI         ; declare the routine
  1286.                          ...                      ; ..preliminary code sections
  1287.                          CALL      PDMINI         ; initialize pull-down menus
  1288.                          ...                      ; ..now set menus, etc
  1289.  
  1290.      Routine║   ISPDM
  1291.      Function║ Check character for pull-down menu escape character
  1292.      Entry:    A = character to check
  1293.      Exit:     A = character
  1294.                Zero clear (NZ) if it is the escape character
  1295.                Zer∩ flaτ se⌠ (Z⌐ iµ no⌠ thσ escapσ charaπter
  1296.      Affected: Flags
  1297.      Usage:    Thi≤ routinσ i≤ useΣ iε thσ pul∞-dowε men⌡ áselecì
  1298. ááááááááááááááátioε ácodσ t∩ sensσ fo≥ thσ escapσ character¼ áanΣ ì
  1299. áááááááááááááááma∙ ábσ useΣ iε ß simila≥ modσ iε othe≥ áprograms«  ì
  1300. áááááááááááááááSe⌠ thσ desireΣ characte≥ witΦ SPDMCHR.
  1301.      Example:
  1302.                          EXT       ISPDM,CIN      ; declare some routines
  1303.                          ...                      ; ..preceding code
  1304.                          CALL      CIN            ; get a character from console
  1305.                          CALL      ISPDM          ; is it the escape char?
  1306.                          JR        NZ,HAVIT       ; ..jump if so
  1307.                          ...                      ; else loop or whatever..
  1308.  
  1309.      Routine║   SPDMCHR
  1310.      Function: Changσ áthσ ávaluσ oµ thσ ápul∞-dowε ámen⌡ áescapσ ì
  1311. ááááááááááááááácharacter
  1312.      Entry:    ┴ ╜ ne≈ characte≥ t∩ usσ a≤ pul∞-dowε men⌡ áescapσ ì
  1313. ááááááááááááááácharacter
  1314.      Exit:     None╗ áthσ characte≥ i≤ se⌠ (normall∙ ES├-1Bh¼ áo≥ ì
  1315. ááááááááááááááá^▄-1Ch)
  1316.      Affected: None
  1317.      Usage:    Change≤ áthσ pul∞-dowε men⌡ escapσ characte≥ áfroφ ì
  1318. áááááááááááááááthσ initia∞ valuσ oµ ES├ (1Bh)«  Norma∞ value≤ arσ ì
  1319. áááááááááááááááeithe≥ ES├ (1Bh⌐ o≥ ^▄ (1Ch).
  1320.  
  1321. READIN╟ TH┼ TERMINA╠ SCREEN:
  1322.  
  1323.      Routine║   GETCUR
  1324.      Function║ Ge⌠ thσ curren⌠ curso≥ positioε froφ thσ terminal
  1325.      Entry║    None
  1326.      Exit║     ┴ ╜ 0FFh¼ zer∩ flaτ clea≥ (NZ⌐ iµ successful
  1327.                H╠ ╜ curren⌠ curso≥ positioε (iµ NZ)
  1328.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ functioε i≤ no⌠ available
  1329.      Affected║ AF¼ HL
  1330.      Usage║    Return≤ curso≥ positioε a≤ useΣ b∙ GOTOX┘ ároutinσ ì
  1331. ááááááááááááááá(╚ ╜ row¼ ╠ ╜ column).
  1332.      Example:
  1333.                          EX╘       GETCUR,GOTOX┘       ╗ declarσ routines
  1334.                          «.«                           ╗ ..intervening code
  1335.                          CAL╠      GETCU╥              ╗ ge⌠ cursor position
  1336.                          J╥        Z,NOTAVAI╠          ╗ ..jum≡ if not available
  1337.                          L─        (CURPOS),H╠         ╗ storσ position for later
  1338. è                         «.«                           ╗ .«you≥ screen routines
  1339.                          L─        HL,(CURPOS⌐         ╗ ge⌠ back stored position
  1340.                          CAL╠      GOTOX┘              ╗ anΣ restore cursor
  1341.                                                        ╗  t∩ where it was
  1342.  
  1343.      Routine║   GETLIN
  1344.      Function║ ReaΣ ß linσ froφ thσ termina∞ screen
  1345.      Entry║    Curso≥ positioneΣ a⌠ enΣ oµ line
  1346.      Exit║     ┴ ╜ 0FFh¼ zer∩ flaτ clea≥ (NZ⌐ iµ successful
  1347.                H╠ ╜ addres≤ oµ nul∞-terminateΣ strinτ froφ terminal (if NZ)
  1348.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ functioε i≤ no⌠ available
  1349.      Affected║ AF¼ HL
  1350.      Usage:    Read≤ linσ containinτ curso≥ froφ thσ firs⌠ columε ì
  1351. ááááááááááááááát∩ á(anΣ including⌐ thσ curren⌠ curso≥ column¼ ás∩ ì
  1352. ááááááááááááááápositioε thσ curso≥ first.
  1353.      Example:
  1354.                          EX╘       GOTOXY,GETLI╬       ╗ declarσ routines
  1355.                          ..«                           ╗ ..intervening code
  1356.                          L─        H,▒                 ╗ ro≈ 1
  1357.                          L─        L,8░                ╗ columε 80
  1358.                          CAL╠      GOTOX┘              ╗ position the cursor
  1359.                          CAL╠      GETLI╬              ╗ ge⌠ thσ line
  1360.                          J╥        Z,NOTAVAI╠          ╗ ..jum≡ if not available
  1361. .pa
  1362. è