home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
JSAGE
/
ZSUS
/
PROGPACK
/
V42-DOCS.LBR
/
VLIB42.DZC
/
VLIB42.DOC
Wrap
Text File
|
1990-06-08
|
69KB
|
1,345 lines
.hm1
.fm1
.sr0
.he ZCPR3: THE LIBRARIES 4.2 -- VLIB
.fo Page #
.pn 135
III« VLIB -- Video Terminal Interface
Introductioε « « « « « « « « « « « « « « « « « « « « « « 136
Usinτ VLI┬ « « « « « « « « « « « « « « « « « « « « 136
Termina∞ Ca≡abilities (TCAP⌐ ExtendeΣ Definitioε « 137
Basiπ VLI┬ Routine≤ « « « « « « « « « « « « « « « « « « 143
Screeε, Curso≥, anΣ Miscellaneou≤ Routine≤ « « « « 143
CLS¼ CLREOS¼ EREOL¼ AT¼ GOTOXY¼ DELLIN¼
INSLIN¼ ISCUR¼ VVERS
Initializatioε . « « « « « « « « « « « « « « « « « 146
VIDINIT¼ Z3VINIT¼ VIDPT╥ (global)
Prin⌠ Routine≤ « « « « « « « « « « « « « « « « « « 146
GXYMSG¼ VPRINT¼ VPSTR
Standou⌠ Modσ « « « « « « « « « « « « « « « « « « « 147
STNDOUT¼ STNDEND
Terφinal Ini⌠ializatioε anΣ De-Initializatioε « « « 148
TINIT¼ DINIT
Graphic≤ . « « « « « « « « « « « « « « « « « « « « « « « 149
Ini⌠ializatioε « « « « « « « « « « « « « « « « « « 149
GZ3INIT¼ GRXON¼ GRXOFF
Blocδ Graphic≤ « « « « « « « « « « « « « « « « « « 150
DRFULL¼ DRHASH
Corne≥s anΣ Intersection≤ « « « « « « « « « « « « « 150
ULEFT¼ URIGHT¼ LLEFT¼ LRIGHT¼ LTISEC¼
RTISEC¼ UISEC¼ LISEC¼ ISEC
Horizonta∞ anΣ Vertica∞ Bar≤ « « « « « « « « « « « 151
DRHBAR¼ DRHORZ¼ ERAHORZ¼ GHBAR¼ ERAHBAR,
DRVBAR¼ DRVERT¼ ERAVERT¼ GVBAR¼ ERAVBAR
Bo° Dra≈ing Routine≤ « « « « « « « « « « « « « « « 155
DRFBOX¼ DRBOX¼ ERABOX¼ GFBOX¼ GBOX¼
GERBOX¼ CHKBOX
Pull-Dowε Menu≤ « « « « « « « « « « « « « « « « « « 156
SETPDM¼ CLRPDM¼ SELPDM¼ MCLS¼ PDMINI¼
ISPDM¼ SPDMCHR
Readinτ thσ Termina∞ Screeε « « « « « « « « « « « « 159
GETCUR¼ GETLIN
.paè
VLIB -- Video Terminal Interface
INTRODUCTION:é VLI┬ i≤ ß librar∙ oµ routine≤ originall∙ ádesigneΣ ì
b∙ RicharΣ Conε t∩ suppor⌠ ZCPR3« Man∙ change≤ havσ beeε áincorì
porateΣ áiε áthi≤ version¼ includinτ optimizeΣ codσ fo≥ áthσ áZ8░ ì
processo≥ family¼ conversioε t∩ ß tablσ-driveε modσ fo≥ increaseΣ ì
speed¼ áanΣ thσ additioε oµ severa∞ ne≈ routine≤ compa⌠iblσ áwitΦ ì
somσ áoµ thσ GRWLI┬ anΣ GRXLI┬ routine≤ whicΦ werσ áneve≥ áwidel∙ ì
adopted.
Program≤ áusinτ ároutine≤ froφ thi≤ librar∙ arσ ablσ át∩ áenhancσ ì
vide∩ ádisplay≤ witΦ direc⌠ curso≥ addressing¼ vide∩ áattributes¼ ì
anΣ ne≈ mode≤ oµ operatioε sucΦ a≤ pul∞-dowε menu≤ iε ß áportablσ ì
manne≥ amonτ othe≥ ┌-System≤ withou⌠ rσ-installation.
Portabilit∙ ái≤ achieveΣ b∙ accessinτ termina∞ description≤ áconì
taineΣ iε thσ ZCPR│ TCAP¼ o≥ compatiblσ record« Iε mos⌠ systems¼ ì
thσ áTCA╨ i≤ storeΣ iε thσ seconΣ halµ oµ thσ áZCPR│ áEnvironmen⌠ ì
Descriptor.
USIN╟ áVLIB:é á Wheε writinτ program≤ t∩ usσ áVLIB¼ áfollo≈ áthesσ ì
steps:
Z3EAD╥ EQ╒ 109H
L─ HL,(Z3EADR⌐ ╗ ge⌠ Environmen⌠ address
CAL╠ Z3VINI╘ ╗ initializσ ENVPT╥ anΣ VIDPTR
CAL╠ GZ3INI╘ ╗ iµ yo⌡ wou∞Σ usσ graphics
CAL╠ TINI╘ ╗ initializσ thσ terminal
...« ╗ you≥ program
CAL╠ DINI╘ ╗ dσ-initializσ thσ terminal
...« ╗ housekeeping
RE╘ ╗ quit
1.Initializσ ápointer≤ áanΣ routines« á Thσ átw∩ ápointer≤ ì
áááááneedeΣ are:
- ENVPTR is the ZCPR3 Environment Descriptor address.
- VIDPTR sets the Z3TCAP entry address.
- Iµ áusinτ graphic≤ o≥ pul∞-dowε menus¼ initializσ átha⌠ ì
áááááááááásybsysteφ áa≤ áwell« Thi≤ routinσ return≤ áflag≤ átha⌠ ì
áááááááááátel∞ wha⌠ ne≈ capabilitie≤ exist.
2.Cal∞ átermina∞ initializatioε routine¼ TINIT« á Iµ áyou≥ ì
ááááátermina∞ áuse≤ DI═ o≥ reduceΣ-intensit∙ insteaΣ áoµ áreversσ ì
ááááávideo¼ áTINI╘ áshoulΣ se⌠ thσ defaul⌠ t∩ thσ ádiφ áleve∞ áa≤ ì
ááááádefault¼ anΣ usσ norma∞ intensit∙ fo≥ STNDOUT¼ witΦ áSTNDEN─ ì
áááááreturninτ t∩ Dim.
3.Call VLIB routines within the program as desired.
4.Cal∞ termina∞ dσ-initializatioε routine¼ DINIT« Iµ you≥ ì
ááááátermina∞ use≤ DI═ o≥ reduceΣ-intensit∙ attibute≤ insteaΣ áoµ ì
áááááreversσ o≥ intensifieΣ vide∩ fo≥ Highlighting¼ DINI╘ áshoulΣ ì
ááááárestorσ thσ termina∞ t∩ norma∞ intensit∙ a⌠ exit.
èTERMINA╠ CAPABILITIE╙ (TCAP⌐ EXTENDE─ DEFINITIONô (a≤ oµ áFebruar∙ ì
3¼ á1990):é Thσ ZCPR│ TCA╨ i≤ ß 12╕-bytσ areß positioneΣ áimmσdiì
atel∙ áafte≥ thσ Environmen⌠ Descriptor« Thσ áconfiguratioε áha≤ ì
beeε changeΣ froφ thσ origina∞ description≤ containeΣ iε áRicharΣ ì
Conn'≤ book¼ ZCPR3║ Thσ Manual« Thσ layou⌠ herσ i≤ designeΣ áfo≥ ì
backwarΣ ácompatibilit∙ áwitΦ thσ origina∞ áschemσ áwhilσ áaddinτ ì
extension≤ t∩ accomodatσ rudamentar∙ busines≤ graphic≤ anΣ ápul∞-ì
dowε ámenu≤ describeΣ iε Denni≤ Wright'≤ GRXLI┬ anΣ áportion≤ áoµ ì
GRWLIB« Offset≤ mentioneΣ iε thi≤ descriptioε arσ froφ thσ ábasσ ì
oµ thσ TCAP.
offset item description
0 Terminal Name
1│ characters¼ alphanumeric« Thσ áfirs⌠ ì
ááááááááááááááááááááááááácharacte≥ mus⌠ no⌠ bσ ß space« ┴ áleaΣì
áááááááááááááááááááááááááinτ áspacσ mean≤ uninstalleΣ áTCAP« á B∙ ì
áááááááááááááááááááááááááconvention¼ ß termina∞ namσ i≤ uniquσ iε ì
áááááááááááááááááááááááááit≤ firs⌠ eigh⌠ character≤ anΣ thσ ánamσ ì
ááááááááááááááááááááááááái≤ terminateΣ witΦ ß space.
1│ Offse⌠ t∩ GOEL─ entry
1┤ HigΦ Termina∞ Characteristics
Bi⌠ ╖ i≤ se⌠ (80h⌐ t∩ indentif∙ extendeΣ ì
áááááááááááááááááááááááááTCAP.
15 Lo≈ Termina∞ Characteristic≤
Onσ bytσ indicatinτ termina∞ dσtails:
b0 - typσ oµ standou⌠ modσ (░ ╜ dim╗ ▒ ╜ ì
ááááááááááááááááááááááááááááááreverse).
b1 - termina∞ ádela∙ a⌠ poweru≡ (░ ╜ án∩ ì
áááááááááááááááááááááááááááááádelay╗ ▒ ╜ 1░ seconds).
b2 - screeε wrap≤ oε writσ iε las⌠ áco∞ì
ááááááááááááááááááááááááááááááumε (░ ╜ no╗ ▒ ╜ yes).
b3 - screeε áscroll≤ áiµ álas⌠ áro≈ áanΣ ì
áááááááááááááááááááááááááááááácolumε áarσ writteε (░ ╜ yes╗ á▒ á╜ ì
ááááááááááááááááááááááááááááááno).
b4 - ANS╔ átermina∞ (░ ╜ no¼ ASCII╗ ▒ á╜ ì
ááááááááááááááááááááááááááááááyes¼ ANSI).
Thσ áfollowinτ áfou≥ byte≤ arσ fo≥ ásinglσ-bytσ ácurso≥ ámovemen⌠ ì
code≤ áfroφ áthσ terminal« Iµ you≥ termina∞ ha≤ án∩ áindependan⌠ ì
curso≥ ámovemen⌠ keys¼ o≥ implement≤ curso≥ movemen⌠ witΦ ámultΘ-ì
bytσ ásequences¼ usσ an∙ convenien⌠ singlσ-ke∙ sequencσ áyo⌡ ádeì
sire« á Thσ familia≥ WordSta≥ "diamondó compriseΣ oµ ^┼ (up)¼ á^╪ ì
(down)¼ ^─ (right⌐ anΣ ^╙ (left⌐ i≤ commonl∙ used.
16 Cursor Up
Curso≥ u≡ codσ froφ termina∞ (^E).
17 Cursor Down
Curso≥ dowε codσ froφ termina∞ (^X).
18 Cursor Right
Curso≥ righ⌠ codσ froφ termina∞ (^D).è
19 Cursor Left
Curso≥ lef⌠ codσ froφ termina∞ (^S).
Somσ áterminal≤ neeΣ delay≤ t∩ perforφ certaiε áfunctions« á Thi≤ ì
ma∙ ábσ morσ importan⌠ a≤ interfacσ speed≤ increase« Delay≤ áarσ ì
iε ámilliseconds« Consul⌠ you≥ termina∞ manua∞ fo≥ áthσ ácorrec⌠ ì
value≤ t∩ insert.
20 Clear Screen
Delay in milliseconds (0 to 255).
21 Move Cursor
Delay in milliseconds (0 to 255).
22 Clear to End-of-Line
Delay in milliseconds (0 to 255).
Beginninτ a⌠ offse⌠ 2│ froφ thσ beginninτ oµ thσ TCAP¼ ß sequencσ ì
oµ áNU╠-terminateΣ string≤ definσ thσ commanΣ string≤ áneedeΣ át∩ ì
makσ thσ termina∞ responΣ a≤ desired« Iµ particula≥ feature≤ arσ ì
no⌠ áimplementeΣ áo≥ no⌠ needeΣ b∙ you≥ terminal¼ áß ásinglσ áNU╠ ì
(binar∙ 0⌐ disable≤ tha⌠ feature.
23 Clear Screen (CL⌐
Clear screen and home cursor.
Cursor Movement (CM)
ParseΣ ástrinτ fo≥ ácurso≥ ápositioning« ì
áááááááááááááááááááááááááSeσ ZCPR3║ Thσ ManualÖ fo≥ details« "%Nó ì
ááááááááááááááááááááááááástrinτ addeΣ t∩ senΣ binar∙ ░ t∩ átermiì
ááááááááááááááááááááááááánal.
Clear to End-of-Line (CE⌐
Clea≥ froφ curso≥ positioε t∩ thσ enΣ oµ ì
áááááááááááááááááááááááááthσ curren⌠ line« Curso≥ stay≤ iε ácurì
áááááááááááááááááááááááááren⌠ placσ.
Standout Begin (SO)
Ente≥ ástandou⌠ mode« Iµ termina∞ áuse≤ ì
ááááááááááááááááááááááááádiφ o≥ reduceΣ intensity¼ thσ áinitialiì
ááááááááááááááááááááááááázatioε ástrinτ (T╔ below⌐ shoulΣ se⌠ át∩ ì
áááááááááááááááááááááááááreduceΣ áintensity¼ áanΣ áthi≤ áfunctioε ì
áááááááááááááááááááááááááset≤ norma∞ intensity.
Standout End (SE)
EnΣ áStandou⌠ mode« Iµ yo⌡ usσ ádiφ áo≥ ì
áááááááááááááááááááááááááreduceΣ ááintensit∙ áwitΦ áánorma∞ ááfo≥ ì
ááááááááááááááááááááááááá"Standout"¼ thi≤ restore≤ thσ diφ mode.
Initialize Terminal (TI⌐
Initializσ thσ terminal« Seσ note≤ áfo≥ ì
ááááááááááááááááááááááááásuggestion≤ oε diφ anΣ reduceΣ intensit∙ ì
áááááááááááááááááááááááááabove.
è De-initialize Termina∞ (TE⌐
Restorσ átermina∞ t∩ norma∞ ámode« á Seσ ì
áááááááááááááááááááááááááabovσ notes.
Delete Line (LD)
Deletσ linσ oε whicΦ thσ curso≥ áreside≤ ì
áááááááááááááááááááááááááanΣ ámovσ áline≤ ábelo≈ i⌠ áu≡ áb∙ áone« ì
áááááááááááááááááááááááááBottoφ linσ i≤ blank.
Insert Line (LI)
Inser⌠ áblanδ álinσ beforσ áthσ áonσ áoε ì
áááááááááááááááááááááááááwhicΦ thσ curso≥ i≤ positioned¼ anΣ movσ ì
áááááááááááááááááááááááááline≤ ábelo≈ dowε one« Curso≥ move≤ át∩ ì
ááááááááááááááááááááááááábeginninτ oµ thσ ne≈ blanδ line.
Clear to End-of-Screen (CD)
Clea≥ áscreeε froφ curren⌠ curso≥ áposiì
ááááááááááááááááááááááááátioε t∩ thσ enΣ-oµ-screen.
Se⌠ Attribute≤ (SA)
Se⌠ ácharacte≥ attribute≤ baseΣ áoε áAT¼ ì
ááááááááááááááááááááááááábelow.
Attribute≤ (AT)
Attributσ character≤ fo≥ thi≤ áterminal╗ ì
áááááááááááááááááááááááááusuall∙ ánormal¼ áblink¼ áreverse¼ ááanΣ ì
áááááááááááááááááááááááááunderscore.
ReaΣ Curso≥ Positioε (RC)
Returε curren⌠ curso≥ position.
ReaΣ Termina∞ Linσ (RL)
ReaΣ curren⌠ linσ u≡ t∩ curso≥.
Thσ áfollowinτ definition≤ implemen⌠ portion≤ oµ thσ áGRXLI┬ áanΣ ì
GRWLI┬ functionality¼ bu⌠ iε differen⌠ TCA╨ locations.
Graphics Dela∙ (GOELD)
Dela∙ fo≥ graphic≤ on/off« Usσ ágreate≥ ì
áááááááááááááááááááááááááoµ thσ tw∩ dela∙ time≤ iε ámilliseconds« ì
áááááááááááááááááááááááááValue≤ oµ ░ t∩ 25╡ arσ acceptable.
Graphics Mode On (GO)
Set terminal to graphics mode.
End Graphics Mode (GE⌐
Restorσ termina∞ t∩ norma∞ áalphanumeriπ ì
ááááááááááááááááááááááááámode.
Curso≥ Ofµ (CDO⌐
Disablσ ácurso≥ ádisplay« á NeedeΣ ááfo≥ ì
ááááááááááááááááááááááááápul∞-dowε menus.
Cursor On (CDE⌐
Enablσ curso≥ display« NeedeΣ fo≥ pul∞-ìèááááááááááááááááááááááááádowε menus.
Severa∞ ágraphic≤ ástring≤ arσ needeΣ t∩ áimplemen⌠ áthσ ádesireΣ ì
leve∞ oµ functionality« EacΦ oµ thesσ i≤ needeΣ iε thσ specifieΣ ì
order« Thσ termina∞ shoulΣ firs⌠ bσ placeΣ iε thσ graphic≤ mode¼ ì
theε áthσ desireΣ strinτ sent« Iµ string≤ fo≥ al∞ terminal≤ áarσ ì
onl∙ ß singlσ character¼ thi≤ ma∙ bσ reduceΣ t∩ ß characte≥ arra∙ ì
iε thσ future.
Upper-Left Corner (GULC)
Upper-Right Corner (GURC⌐
Lower-Left Corner (GLLC⌐
Lower-Right Corner (GLRC⌐
Horizontal Line (GHL⌐
Vertical Line (GVL⌐
Solid (Full) Block (GFB⌐
Hashed Block (GHB⌐
Upper Intersect (GUI⌐
Lower Intersect (GLI⌐
Intersection (GIS⌐
Right Intersect (GRTI⌐
Left Intersect (GLTI⌐
Thσ áremainde≥ oµ thσ TCA╨ shoulΣ bσ filleΣ witΦ binar∙ zero≤ át∩ ì
properl∙ handlσ futurσ additions.
Example:
; Z3TCAP: NZWYS60.Z80
; Author: Joσ Wright
╗ Date║ 1▓ Octobe≥ 87
╗ Version║ 1.0
╗ VERSION║ 2.▓ │ Februar∙ 90
;
╗ MoveΣ thσ C─ (clea≥ t∩ enΣ oµ screen⌐ strinτ bacδ afte≥ LI string.
╗ Definσ B1│ a≤ offse⌠ froφ NZTCA╨ t∩ GOELD.
╗ VERSION║ 2.▒ 1╣ Januar∙ 90
╗ AddeΣ ReaΣ Curso≥ anΣ ReaΣ Linσ functions.
╗ Graphic≤ character≤ no≈ iε ß tablσ insteaΣ oµ individua∞ strings.
╗ VERSION║ 2.░ 1▓ Decembe≥ 89
╗ ModifieΣ fo≥ ne≈ VLIB┤ graphic≤ anΣ fo≥ ne≈ SETAT╘ anΣ SETATR routines.
╗ Thσ SA║ macr∩ strinτ i≤ modifieΣ fo≥ thσ routine≤ anΣ ß new string,
╗ AT║ i≤ addeΣ t∩ contaiε thσ fou≥ maiε attribute≤ fo≥ thi≤ terminal:
╗ Normal¼ Blink¼ Reverse¼ Underscore
; ExtendeΣ Termcap Datß fo≥ NZ
╗ Thi≤ i≤ thσ proposeΣ Termca≡ Datß fo≥ thσ Ne≈ Z-System.
╗ I⌠ morσ full∙ describe≤ thσ termina∞ anΣ it≤ capabilities.
è ES├ EQ╒ 27 ; ASCI╔ escape character
; ╔ havσ adopteΣ thσ conventioε tha⌠ ß termina∞ namσ i≤ terminated
╗ witΦ ß spacσ character¼ thereforσ n∩ space≤ withiε thσ name.
╗ Als∩ tha⌠ thσ termina∞ namσ i≤ uniquσ iε thσ firs⌠ eigh⌠ characters.
;
NZTCAP: DB 'WYSE-60D' ; name of terminal (13 chars)
;
╗ Thσ Graphic≤ sectioε i≤ n∩ longe≥ fixeΣ s∩ wσ mus⌠ provide an
╗ offse⌠ t∩ it« Onσ bytσ i≤ sufficien⌠ fo≥ ß two-recorΣ TCAP.
;
B13║ D┬ GOELD-NZTCA╨ ╗ offse⌠ t∩ GOELD
;
╗ Bi⌠ ╖ oµ B1┤ indicate≤ thσ ne≈ ExtendeΣ TCAP« Bit≤ 6-░ arσ undefined.
;
B14║ D┬ 10000000┬ ╗ extendeΣ TCAP
;
╗ I⌠ i≤ ofteε desirablσ t∩ differentiatσ terminal≤ witΦ othe≥ than
╗ thei≥ commands« Fo≥ examplσ TeleVide∩ 95╡ ha≤ thσ samσ command
╗ se⌠ a≤ Wysσ 6░ bu⌠ take≤ les≤ timσ t∩ initializσ (reset).
;
╗ 1╢ bit≤ arσ no≈ reserveΣ fo≥ indicatinτ termina∞ characteristics
╗ whicΦ canno⌠ bσ knowε froφ thσ strings« ╔ havσ defineΣ five
╗ oµ thesσ bit≤ fo≥ m∙ owε purposes.
;
╗ B1╡ b░ Standou⌠ ░ ╜ half-intensity¼ ▒ ╜ reversσ video
╗ B1╡ b▒ Powe≥ U≡ Dela∙ ░ ╜ none¼ ▒ ╜ 1░ seconΣ delay
╗ B1╡ b▓ N∩ Wra≡ ░ ╜ linσ wrap¼ ▒ ╜ n∩ wrap
╗ B1╡ b│ N∩ Scrol∞ ░ ╜ scroll¼ ▒ ╜ n∩ scroll
╗ B1╡ b┤ ANS╔ ░ ╜ ASCII¼ ▒ ╜ ANSI
;
B15: DB 00000111B ; powe≥ u≡ delay
;
DB 'K'-'@' ; cursor up
DB 'J'-'@' ; cursor down
DB 'L'-'@' ; cursor right
DB 'H'-'@' ; cursor left
DB 00 ; clea≥ screen (CL⌐ delay
DB 00 ; curso≥ position (CM⌐ delay
DB 00 ; clea≥ t∩ EO╙ (CE) delay
; Strings start here.
CL║ DB ESC,'+',0 ; strinτ t∩ clear, home cursor 0
CM: DB ESC,'=%+ %+ ',0 ; strinτ t∩ position cursor 1
CE: DB ESC,'T',0 ; string t∩ clear to end-of-line 2
SO: DB ESC,')',0 ; string t∩ go to highligh⌠ video 3
SE: DB ESC,'(',0 ; string t∩ return normal video 4
TI: DB 0 ; string t∩ initialize terminal 5
TE: DB ESC,'(',0 ; string t∩ de-initialize terφ 6
;è ; Extensions to Standard Z3TCAP
;
LD║ DB ESC,'M',0 ; strinτ t∩ delete linσ 7
LI║ DB ESC,'L',0 ; strinτ t∩ insert linσ 8
CD║ DB ESC,'J',0 ; strinτ t∩ clear to EO╙ 9
;
╗ Se⌠ attributσ string≤ fo≥ normal¼ blink¼ reverse¼ underline.
;
SA║ D┬ ESC,'G%+0',░ ╗ se⌠ attribute≤ prefi° 10
AT║ D┬ '0248',░ ╗ attribute≤ 11
╗
╗ Thesσ tw∩ allo≈ readinτ thσ terminal'≤ screen.
;
RC║ D┬ ESC,'?',░ ╗ reaΣ curren⌠ curso≥ positioε 12
RL║ D┬ ESC,'6',░ ╗ reaΣ linσ unti∞ curso≥ 13
;
╗ Graphic≤ star⌠ here« Wyse-6░ goe≤ graphiπ witΦ bi⌠ ╖ set.
;
GOELD║ D┬ ░ ╗ graphic≤ on/ofµ dela∙ 0
;
╗ Graphic≤ string≤ offse⌠ froφ dela∙ value.
;
GO║ DB 0 ; strinτ t∩ turε oε graphic≤ 1
GE║ ─B 0 ; strinτ t∩ turε ofµ graphic≤ 2
CDO: DB ESC,'`0',0 ; strinτ t∩ turε ofµ curso≥ 3
CDE: DB ESC,'`1',0 ; strinτ t∩ enablσ curso≥ 4
GULC║ DB 'Z'+80h ; upper left corner [*▌ 5
GURC: DB '?'+80h ; upper right corner [*▌ 6
GLLC: DB '@'+80h ; lower left corner [*▌ 7
GLRC: DB 'Y'+80h ; lower right corner [*▌ 8
GHL: DB 'D'+80h ; horizontal line [-▌ 9
GVL: DB '3'+80h ; vertical line [|▌ 10
GFB: DB '['+80h ; full block string [*▌ 11
GHB: DB '2'+80h ; hashed block string [#▌ 12
GUI: DB 'B'+80h ; upper intersection [+▌ 13
GLI: DB 'A'+80h ; lower intersection [+▌ 14
GIS: DB 'E'+80h ; intersection [+▌ 15
GRTI: DB '4'+80h ; right intersection [+▌ 16
GLTI: DB 'C'+80h ; left intersection [+▌ 17
;
; Fill unused space with nulls.
;
REPT 128-[$-Z3TCAP]
DB 0
ENDM
;
END
;------------- End of Sample N┌ TermCap -------------
.paèBASI├ VLI┬ ROUTINES:
SCREEN¼ CURSOR¼ AN─ MISCELLANEOU╙ ROUTINES:
Routine║ CLS
Function║ Clear entire screen and home cursor
Entry: None
Exit: A <> 0 zero flag reset (NZ) if screen cleared
A = 0, zero flag set (Z) if function not available
Affected: AF
Usage: Mos⌠ áofteε useΣ t∩ providσ initia∞ áentr∙ ácondiì
ááááááááááááááátions¼ áo≥ át∩ dividσ function≤ oµ ß áprograφ áfo≥ ì
áááááááááááááááergonomiπ reasons.
Routine║ CLREOS
Function: Clea≥ áfroφ ácurren⌠ curso≥ ápositioε át∩ áenΣ-oµ-ì
áááááááááááááááscreeε leavinτ curso≥ iε presen⌠ position
Entry: None
Exit: A <> 0 zero flag reset (NZ) if screen cleared
A = 0, zero set (Z) if function not available
Affected: AF
Usage: Remove≤ transien⌠ informatioε froφ thσ lowe≥ ápar⌠ ì
áááááááááááááááoµ áß áscreeε whilσ retaininτ informatioε áoε áthσ ì
áááááááááááááááuppe≥ part.
Routine║ EREOL
Function║ Erase line from cursor position to end-of-line
Entry: None
Exit: A <> 0 zero flag reset (NZ) if line erased
A = 0, zero flag set (Z) if function not available
Affected: AF
Usage: Insure≤ átha⌠ remaininτ informatioε oε ß álinσ ái≤ ì
ááááááááááááááácleared
Routine║ AT
Function: Positioε curso≥ froφ iε-linσ codσ coordinatσ posiì
ááááááááááááááátions
Entry: None; address of XY coordinates are on stack top
Exit: None╗ áexecutioε resume≤ a⌠ instructioε áafte≥ áX┘ ì
ááááááááááááááácoordinates
Affected: None
Usage: Position≤ áthσ ácurso≥ a⌠ ro≈ anΣ ácolumε áaddres≤ ì
ááááááááááááááápointeΣ t∩ b∙ thσ returε address« UseΣ wherσ áthσ ì
ááááááááááááááádesireΣ áro≈ anΣ columε positioε i≤ knowε áb∙ áthσ ì
áááááááááááááááprogram¼ áanΣ doe≤ no⌠ changσ witΦ áprograφ áflow« ì
áááááááááááááááSeσ áGOTOX┘ áfo≥ positioninτ routinσ tha⌠ áma∙ ábσ ì
ááááááááááááááávarieΣ withiε ß program« Therσ i≤ n∩ checkinτ áoµ ì
ááááááááááááááátermina∞ limit≤ iε thσ environment.
Example:
EX╘ AT ; declare the routine
... ; ..other parts of program
CALL AT ; call the positioning routine
DEFB ROW,COL ; ..row and column (1,1 is home)
... ; program flow resumes here
è Routine║ GOTOXY
Function: Positioε curso≥ froφ ro≈ anΣ columε datß iε regisì
áááááááááááááááters
Entry: HL = desired cursor position (H=row, L=column)
Exit: A <> 0 zero flag reset (NZ) if cursor positioned
A = 0, zero set (Z) if function not available
Affected: AF
Usage: Positioε áthσ ácurso≥ a⌠ ro≈ (iε registe≥ áH⌐ áanΣ ì
ááááááááááááááácolumε á(iε L)« Thσ homσ positioε (to≡ lef⌠ ácorì
áááááááááááááááner⌐ ái≤ áH=▒ anΣ L=1« Wheε áthσ ádesireΣ ácurso≥ ì
ááááááááááááááápositioε i≤ fixed¼ yo⌡ ma∙ wan⌠ t∩ usσ A╘ (above)« ì
áááááááááááááááBit≤ á▒ áanΣ ▓ oµ thσ ne≈ modσ bytσ áiε áthσ áTCA╨ ì
áááááááááááááááshoulΣ bσ senseΣ beforσ positioninτ t∩ las⌠ Columε ì
áááááááááááááááiε ß ro≈ t∩ avoiΣ screeε wrap/scrol∞ problems.
Example:
EXT GOTOXY ; declare the routine
... ; ..intervening code
L─ HL,10*256+│ ╗ loaΣ coord≤ (row 10, col 3)
CALL GOTOXY ; try to position the cursor
JR NZ,MOVOK ; ..jump if successful
... ; else try something else
Routine║ SETATR
Function║ Se⌠ codeΣ attributes
Entry║ ┴ ╜ attributσ codσ (0..7)
Exit║ ┴ ╜ 0FFh¼ zer∩ flaτ clea≥ (NZ⌐ iµ attributσ i≤ available
┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ attributσ i≤ no⌠ available
Affected║ AF
Usage║ Attributσ code≤ are:
░ ╜ norma∞ (al∞ attribute≤ off)
▒ ╜ blink
▓ ╜ reversσ video
│ ╜ blinδ anΣ reversσ video
┤ ╜ underscore
╡ ╜ blinδ anΣ underscore
╢ ╜ underscorσ anΣ reversσ video
╖ ╜ blink¼ underscore¼ anΣ reversσ video
Routine║ SETATT
Function║ Se⌠ attributes
Entry║ ╚ ╜ firs⌠ value
╠ ╜ seconΣ value
Exit║ ┴ <╛ 0¼ zer∩ flaτ clea≥ (NZ⌐ iµ functioε i≤ available
┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ functioε i≤ no⌠ available
Affected║ AF
Usage: Use≤ áthσ samσ parse≥ a≤ GOTOXY¼ s∩ value≤ ma∙ ábσ ì
ááááááááááááááápasseΣ át∩ i⌠ a≤ the∙ arσ t∩ thσ ácurso≥ ámovemen⌠ ì
ááááááááááááááástring« Refe≥ t∩ ZCPR3║ Thσ Manua∞ fo≥ C═ ástrinτ ì
áááááááááááááááprogramminτ anΣ t∩ you≥ particula≥ termina∞ manua∞ ì
áááááááááááááááfo≥ áattributσ values« Also¼ seσ SETAT╥ ádescripì
ááááááááááááááátioε above« Yo⌡ ma∙ no⌠ neeΣ SETAT╘ a⌠ all.
.paè Routine║ DELLIN
Function║ Delete the currently addressed line
Entry: None
Exit: A <> 0, zero flag clear (NZ) if action completed
A = 0, zero set (Z) if function not defined
Affected: AF
Usage: Enhance≤ screeε edito≥ function≤ unde≥ ZCPR│ áwitΦ ì
áááááááááááááááappropriatσ TERMCA╨ definitions.
Example║ Seσ INSLI╬ below.
Routine║ INSLIN
Function║ Insert a new line at the current cursor position
Entry: None
Exit: A <> 0, zero flag clear (NZ) if action completed
A = 0, zero set (Z) if function not defined
Affected: AF
Usage: Enhance≤ screeε edito≥ function≤ unde≥ ZCPR│ áwitΦ ì
áááááááááááááááappropriatσ TERMCA╨ definitions.
Example:
EXT DELLIN,INSLI╬ ; declare the routines
... ; ..pos'n cursor to
..« ╗ ..desired line
CALL DELLIN ; kill it!
JR Z,NOTDONE ; ..jump if not defined
... ; ..position to new line pos'n
CALL INSLIN ; new line here,
╗ ..push others down
JR Z,NOINSL ; ..jump if not defined
... ; else continue on
Routine║ ISCUR
Function║ Test character for cursor movement key
Entry: A = character to test
Exit: ┴ á╜ á1..┤ (1=up¼ 2=down¼ 3=right¼ á4=left)¼ ázer∩ ì
áááááááááááááááclea≥ (NZ⌐ iµ characte≥ i≤ curso≥ ke∙ froφ TCA╨ o≥ ì
áááááááááááááááWordSta≥ curso≥ key
A = character, zero set (Z) if not cursor key
Affected: AF
Usage: Determine≤ iµ ß characte≥ i≤ ß commanΣ t∩ movσ thσ ì
ááááááááááááááácurso≥ áup¼ ádown¼ right¼ o≥ áleft« á BotΦ ásinglσ ì
ááááááááááááááácharacte≥ command≤ froφ thσ extendeΣ TCAP¼ a≤ wel∞ ì
áááááááááááááááa≤ WordSta≥ ^E¼ ^X¼ ^D¼ anΣ ^╙ arσ checked.
Example:
EXT ISCUR,CIN ; declare some routines
... ; ..preceding code
CALL CIN ; get char from keyboard
CALL ISCUR ; is it a cursor key?
JR Z,NOCUR ; ..jump if not a cursor key
Routine║ VVERS
Function║ Return the VLIB version number
Entry: None
Exit: HL = VLIB version number (H=major, L=minor)
Affected: HL
Usage: Mos⌠ áofteε calleΣ fo≥ debugginτ o≥ ádocumentatioε ìèááááááááááááááápurpose≤ t∩ includσ thσ VLI┬ librar∙ versioε ánumì
ááááááááááááááábe≥ linkeΣ iε programs.
INITIALIZATION:
Routine║ VIDINIT
Function║ Initialize the VLIB routines to a specified TCAP
Entry: HL = address of a Z3 formatted TCAP
.ix VIDPTR (g)
Exit: None╗ ábu⌠ VIDPT╥ globa∞ initializeΣ t∩ áTCA╨ áanΣ ì
áááááááááááááááVLI┬ set
Affected: None
Usage: Provide≤ thσ abilit∙ t∩ usσ ß TCA╨ othe≥ thaε tha⌠ ì
áááááááááááááááprovideΣ áiε áthσ ZCPR│ áenvironment« á Fo≥ áaddeΣ ì
ááááááááááááááásafet∙ áiε áprogramming¼ yo⌡ shoulΣ als∩ áse⌠ áthσ ì
áááááááááááááááZ3LI┬ variablσ ENVPT╥ t∩ aε addres≤ poin⌠inτ t∩ aε ì
áááááááááááááááEN╓ áconstruc⌠ whicΦ provide≤ termina∞ áparameter≤ ì
ááááááááááááááát∩ somσ routines.
Example:
EXT VIDINIT ; declare the routine
... ; ..program initialization
LD HL,(Z3EADR⌐ ; load ENV address
LD DE,80H ; offset to TCAP portion
ADD HL,DE
CALL VIDINIT ; ..and initialize VLIB
... ; carry on with program
Routine║ Z3VINIT
Function║ Initialize Z3LIB and VLIB routines for use
Entry: HL = address of a ZCPR3 environment descriptor
Exit: None
Affected: None
Usage: Combine≤ thσ function≤ oµ thσ Z3LI┬ routinσ Z3INI╘ ì
áááááááááááááááanΣ áVIDINI╘ covereΣ above« I⌠ assume≤ átha⌠ áthσ ì
áááááááááááááááTCA╨ ábegin≤ 80Φ (128⌐ byte≤ afte≥ áthσ áspecifieΣ ì
áááááááááááááááenvironmen⌠ pointe≥ passeΣ iε HL.
Example:
EXT Z3VINIT ; declare the routine
... ; ..initial program code
LD HL,(Z3EADR) ; get the environment address
CALL Z3VINIT ; ..set ENVPTR and init VLIB
... ; carry on!
PRINT ROUTINES:
Routine║ GXYMSG
Function║ Position cursor and print text with highlighting
Entry: None╗ áaddres≤ oµ X┘ coordinate≤ followeΣ b∙ átex⌠ ì
áááááááááááááááoε stacδ top
Exit: None; execution resumes after text terminating NUL
Affected: None
Usage: Print≤ ß tex⌠ messagσ a⌠ ß prσ-defineΣ locatioε oε ì
áááááááááááááááthσ termina∞ screen« I⌠ i≤ analagou≤ t∩ positionì
áááááááááááááááinτ thσ curso≥ witΦ A╘ followeΣ b∙ ß strinτ áprin⌠ ì
áááááááááááááááwitΦ VPRINT« Standou⌠ anΣ standenΣ attribute≤ arσ ì
ááááááááááááááárecognizeΣ áwitΦ ábinar∙ á▒ áanΣ á▓ árespectively« ìèáááááááááááááááTherσ ái≤ án∩ checkinτ oµ termina∞ limit≤ áiε áthσ ì
áááááááááááááááenvironment.
Example:
EX╘ GXYMSG ; declare the routine
... ; ..intervening code
CALL GXYMSG ; print as...
DEF┬ 2,1╡ ╗ positioε t∩ ro≈ 2¼ column 15
DEFB 1,'Hi',2 ; ..and print this message
DEFB ' There!',0 ; ...highlighting "Hi"
... ; execution resumes here
Routine║ VPRINT
Function║ Print NUL-terminated inline text with highlighting
Entry: None; the string starting address in on stack top
Exit: None╗ execution resumes after string terminator
Affected: None
Usage: Print≤ áß tex⌠ strinτ froφ inlinσ codσ witΦ áhighì
ááááááááááááááálightinτ áabilit∙ b∙ enablinτ STNDOU╘ modσ witΦ áß ì
ááááááááááááááábinar∙ á1¼ anΣ resuminτ norma∞ prin⌠ áviß áSTNDEN─ ì
áááááááááááááááwitΦ áß binar∙ 2« Thi≤ i≤ VLIB'≤ versioε áoµ áthσ ì
áááááááááááááááSYSLI┬ routinσ PRINT.
Example:
EXT VPRINT ; declare the routine
... ; ..intervening code
CALL VPRINT ; print the following line
DEFB 2,'Hi',1 ; ..hilighting "Hi" and
DEFB ' There',0 ; ...the remainder in normal
... ; execution resumes here
Routine║ VPSTR
Function║ Print a NUL-terminated message with highlighting
Entry: HL = address of NUL-terminated string to print
Exit: HL = points to byte after terminating NUL
A = 0, zero flag set (Z)
Affected: AF¼ HL
Usage: Print≤ átex⌠ message≤ witΦ highlightinτ ácapabiliì
ááááááááááááááátie≤ áprovideΣ b∙ STNDOUT/STNDEN─ áfroφ álocation≤ ì
áááááááááááááááothe≥ áthaε áthσ executinτ code« I⌠ i≤ áthσ áVLI┬ ì
ááááááááááááááácorollar∙ oµ PST╥ iε SYSLIB.
STANDOUT MODE:
Routine║ STNDOUT
Function║ Begin standout mode.
Entry: None
Exit: A <> 0 zero flag reset (NZ) if standout mode entered
A = 0, zero flag set (Z) if not available
Affected: AF
Usage: Fo≥ áterminal≤ áwitΦ reversσ video¼ áthi≤ ároutinσ ì
áááááááááááááááwil∞ ástar⌠ tha⌠ mode« Fo≥ thosσ witΦ diφ o≥ áreì
áááááááááááááááduceΣ video¼ usσ TINI╘ t∩ se⌠ thσ termina∞ t∩ tha⌠ ì
ááááááááááááááámodσ áfo≥ ánorma∞ print¼ anΣ STNDOU╘ t∩ áplacσ áiε ì
ááááááááááááááánorma∞ ámode« DINI╘ shoulΣ theε reversσ oε áexit« ì
áááááááááááááááThi≤ modσ i≤ useΣ t∩ providσ visua∞ attribute≤ fo≥ ì
ááááááááááááááábette≥ ámaε-machinσ áinterface« Caution║ áD∩ áno⌠ ìèááááááááááááááárepositioε thσ curso≥ o≥ issuσ carriagσ return≤ o≥ ì
ááááááááááááááálinσ áfeed≤ whilσ thσ standou⌠ modσ i≤ áiε áeffec⌠ ì
ááááááááááááááásincσ áunknowε effect≤ caε occu≥ oε somσ type≤ áoµ ì
áááááááááááááááterminals« Usσ STNDEN─ t∩ disablσ thi≤ mode.
Routine║ STNDEND
Function║ End standout mode, return to normal screen display
Entry: None
Exit: A <> 0 zero flag reset (NZ) if standout mode ended
A = 0, zero set (Z) if function not available
Affected: AF
Usage: Reverse≤ thσ modσ se⌠ b∙ STNDOU╘ above« Seσ note≤ ì
áááááááááááááááfo≥ STNDOUT.
TERMINAL INITIALIZATION AND DE-INITIALIZATION:
Routine║ TINIT
Function║ Initialize terminal for use with VLIB routines
Entry: None
Exit: None
Affected: None
Usage: Wheε áwritinτ áprogram≤ baseΣ áoε áVLI┬ ároutines¼ ì
áááááááááááááááTINI╘ shoulΣ bσ calleΣ earl∙ iε thσ prograφ áflow« ì
áááááááááááááááIµ yo⌡ arσ usinτ vide∩ attribute≤ t∩ providσ highì
ááááááááááááááálightinτ áwitΦ STNDOUT/STNDEN─ anΣ áyou≥ átermina∞ ì
áááááááááááááááonl∙ áprovide≤ ß diφ o≥ áreduceΣ-intensit∙ áattriì
ááááááááááááááábute¼ TINI╘ shoulΣ se⌠ thσ norma∞ modσ t∩ thσ ádiφ ì
áááááááááááááááo≥ áreduceΣ mode¼ anΣ STNDOU╘ useΣ fo≥ norma∞ áinì
ááááááááááááááátensit∙ print« Thσ correspondinτ DINI╘ shoulΣ ábσ ì
áááááááááááááááuseΣ t∩ restorσ norma∞ modσ jus⌠ prio⌠ t∩ áprograφ ì
áááááááááááááááexit.
Routine║ DINIT
Function║ De-initialize the terminal; return to normal
Entry: None
Exit: None
Affected: None
Usage: Normall∙ áuseΣ t∩ restorσ termina∞ defaul⌠ ácondiì
ááááááááááááááátion≤ áupoε prograφ termination« Seσ usagσ ánote≤ ì
áááááááááááááááfo≥ TINI╘ above.
Example:
EXT TINIT,DINIT ; declare the routines
... ; ..initial program code
CALL TINIT ; initialize the terminal
... ; ..main program code
CALL DINIT ; do just before exiting pgm
JP EXIT ; ..and return to normal
.paèGRAPHICSô á(Januar∙ 22¼ 1990):é Thesσ extension≤ t∩ VLI┬ áincorpoì
ratσ man∙ oµ thσ interface≤ oµ thσ origina∞ Echelon/Denni≤ Wrigh⌠ ì
GRXLI┬ anΣ GRWLIB¼ anΣ providσ additiona∞ functionalit∙ fo≥ easΘì
e≥ áinterfacing« The∙ requirσ thσ extendeΣ TCA╨ ádefinition≤ áiε ì
orde≥ t∩ work.
INITIALIZATION:
Routine║ GZ3INIT
Function║ Initialize Z3LIB and VLIB, return TCAP flags
Entry: HL = pointer to Z3 environment descriptor
Exit: A = bitmap of capabilities, zero set on results:
b0 = ▒ áiµ delete/inser⌠ linσ present¼ á░ áiµ ì
áááááááááááááááááááááááááabsent
b1 = 1 if clear to EOS present, 0 if absent
b2 = 1 if graphics on/off present, 0 if absent
b3 = ▒ iµ 1│ graphic≤ character≤ exist¼ ░ áiµ ì
áááááááááááááááááááááááááan∙ absent
Affected: AF
Usage: Call≤ Z3VINI╘ anΣ thereforσ ma∙ bσ substituteΣ fo≥ ì
ááááááááááááááái⌠ át∩ áse⌠ thσ Z3LI┬ ENVPT╥ anΣ áinitializσ áVLI┬ ì
ááááááááááááááároutines« Flaτ bit≤ arσ returneΣ t∩ sho≈ áwhethe≥ ì
áááááááááááááááthσ TCA╨ extendeΣ function≤ arσ present.
Routine║ GRXON
Function║ Place terminal in graphics mode
Entry: None
Exit: A <> 0, zero flag clear (NZ) if operation successful
A = 0, zero flag set (Z) if not implemented
Affected: AF
Usage: Control≤ thσ graphic≤ capabilitie≤ oµ thσ termina∞ ì
áááááááááááááááa≤ defineΣ iε thσ extendeΣ TCAP« Iµ thi≤ áro⌡tinσ ì
ááááááááááááááái≤ no⌠ implemented¼ an∙ call≤ t∩ graphiπ ároutine≤ ì
áááááááááááááááwil∞ prin⌠ thσ defineΣ string≤ iε norma∞ áalphanuì
ááááááááááááááámeriπ mode.
Example║ Seσ GRXOF╞ below.
Routine: GRXOFF
Function║ Return terminal to alphanumeric mode
Entry: None
Exit: A <> 0, zero flag clear (NZ) if operation successful
A = 0, zero flag set (Z) if not implemented
Affected: AF
Usage: Turn≤ ofµ thσ graphic≤ capabilite≤ oµ you≥ átermiì
ááááááááááááááána∞ a≤ defineΣ iε thσ extendeΣ TCAP.
Example:
EXT GRXON,GRXOF╞ ; define the routines
... ; ..do VIDINIT/Z3VINIT up here
CALL GRXON ; put terminal in graphics mode
JR Z,NOGRAF ; .jump if no graphics mode
... ; ..else print in graphics
CALL GRXOFF ; return to alphanumeric mode
.paè Routine║ CURON¼ CUROFF
Function║ Turε displa∙ oµ curso≥ oε o≥ off
Entry║ None
Exit║ ┴ <╛ 0¼ zer∩ flaτ clea≥ (NZ⌐ iµ operatioε successful
┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ no⌠ implemented
Affected║ AF
Usage: Thesσ routine≤ allo≈ inhibitinτ thσ curso≥ ádurinτ ì
ááááááááááááááágraphiπ ádisplay≤ t∩ avoiΣ thσ distractioε oµ áthσ ì
ááááááááááááááácurso≥ ájumpinτ áarounΣ thσ screen« á Turninτ áthσ ì
ááááááááááááááácurso≥ áofµ áwil∞ supposedl∙ als∩ áspeeΣ áu≡ ásomσ ì
ááááááááááááááátermina∞ operations« CUROF╞ turn≤ ofµ thσ cursor¼ ì
áááááááááááááááwhilσ CURO╬ turn≤ i⌠ bacδ on.
BLOC╦ GRAPHICS:
Routines║ DRFULL¼ DRHASH
Function║ Prin⌠ ß graphic≤ blocδ character
Entry: None
Exit: A <> 0, zero flag clear (NZ) if character printed
A = 0, zero flag set (Z) if not implemented
Affected: AF
Usage: Thesσ ároutine≤ arσ useΣ b∙ severa∞ oµ áthσ áaddeΣ ì
ááááááááááááááároutine≤ (fo≥ example¼ thσ linσ dra≈ routines⌐ át∩ ì
áááááááááááááááprin⌠ ááful∞-blocδ ágraphic≤ ácharacter≤ át∩ ááthσ ì
áááááááááááááááscreen« DRFUL╠ print≤ ß ful∞ graphic≤ blocδ charì
áááááááááááááááacter╗ áDRHAS╚ print≤ ß hasheΣ o≥ shadeΣ ágraphic≤ ì
áááááááááááááááblocδ character.
Example:
EX╘ DRFULL,DRHASH ; declare the routines
... ; ..other code including Z3INIT
CALL DRFULL ; print full block graphics
CALL DRHASH ; ..and hashed (shaded) block
... ; carry on!
CORNER╙ AN─ INTERSECTIONS:
Routines║ ULEFT¼ URIGHT¼ LLEFT¼ LRIGHT
Function: Prin⌠ ácorne≥ graphic≤ characte≥ ¡¡ áULEF╘ áuppe≥-ì
áááááááááááááááleft¼ URIGH╘ uppe≥-right¼ LLEF╘ lowe≥-left¼ LRIGH╘ ì
ááááááááááááááálowe≥-right
Entry║ None
Exit: A <> 0, zero flag clear (NZ) if character printed
A = 0, zero flag set (Z) if not implemented
Affected: AF
Usage: Print≤ thσ respectivσ corne≥ graphic≤ ácharacters« ì
áááááááááááááááUseΣ áiε thσ bo° drawinτ routinσ describeΣ ábelow« ì
áááááááááááááááIµ yo⌡ havσ n∩ graphic≤ capability¼ usσ character≤ ì
áááááááááááááááiε parenthese≤ iε TCA╨ strings.
.paè Routines║ LTISEC¼ RTISEC¼ UISEC¼ LISEC¼ ISEC
Function: Prin⌠ áintersectioε graphic≤ characte≥ á¡¡ áLTISE├ ì
áááááááááááááááleft¼ RTISE├ right¼ UISE├ upper¼ LISE├ lower¼ ISE├ ì
áááááááááááááááintersection
Entry: None
Exit: A <> 0, zero flag clear (NZ) if character printed
A = 0, zero flag set (Z) if not implemented
Affected: AF
Usage: A≤ áwitΦ thσ corne≥ routines¼ thesσ prin⌠ thσ áreì
áááááááááááááááspectivσ ágraphic≤ characte≥ fo≥ áthei≥ áfunction« ì
áááááááááááááááDefinσ áthσ TCA╨ strinτ fo≥ thesσ function≤ t∩ ábσ ì
áááááááááááááááthσ ASCI╔ characte≥ iε parenthese≤ iµ yo⌡ havσ án∩ ì
ááááááááááááááágraphic≤ capability.
Example:
EXT LTISEC,RTISEC,UISEC,LISEC,ISEC ; declare routines
... ; ..preceding code
CALL LTISEC ; (or RTISEC, etc)
HORIZONTA╠ AN─ VERTICA╠ BARS:
Routine║ DRHBAR
Function: Prin⌠ heav∙ horizonta∞ ba≥ witΦ thσ graphic≤ áful∞ ì
áááááááááááááááo≥ hasheΣ blocδ characte≥ froφ inlinσ code
Entry: None; the top of stack points to parameters
Exit: None; execution resumes after the parameters
Affected: None
Usage: UseΣ áwherσ fixeΣ parameter≤ exist« Fo≥ ávariablσ ì
ááááááááááááááába≥ parameters¼ usσ GHBA╥ whicΦ execute≤ thσ ásamσ ì
áááááááááááááááfroφ áparameter≤ passeΣ iε registers« á Parameter≤ ì
áááááááááááááááfo≥ DRHBA╥ are:
cal∞ drhbar
defb Type ; 1 = Full Block, 2 = Hashed Block
defb Row ; 1 = Top Row on screen
defb Column ; 1 = Left Most Column on screen
defb Length ; Number of characters to print
defΓ Direc ; 0 = Left-to-Right, 1 = R-to-L
Wheε bar≤ arσ specifieΣ a≤ righ⌠-t∩-left¼ thσ lef⌠ ì
ááááááááááááááámargiε i≤ validateΣ fo≥ exceedinτ thσ lef⌠ margin¼ ì
áááááááááááááááanΣ áonl∙ áthσ valiΣ portioε i≤ áprinted« á Actua∞ ì
áááááááááááááááprintinτ i≤ alway≤ lef⌠-t∩-right.
Example:
EX╘ DRHBA╥ ; declare the routine
... ; ..preceding code
CALL DRHBAR ; draw heavy bar at:
DEF┬ 1,2,10,20,░ ╗ full¼ ro≈ 2¼ col 10, len 20
; ..print left-to-right
... ; execution resumes here
Routines║ DRHORZ¼ ERAHORZ
Function: Prin⌠ o≥ erasσ horizonta∞ linσ froφ inlinσ parameì
áááááááááááááááters
Entry: None╗ the top of stack points to parameters
Exit: None; execution resumes after the parameters
Affected: None
Usage: DRHOR┌ draw≤ ß thiε graphic≤ horizonta∞ line¼ áanΣ ìèáááááááááááááááERAHOR┌ áerase≤ áß álinσ b∙ áoverwritinτ ái⌠ áwitΦ ì
áááááááááááááááspaces« á The∙ áarσ useΣ áwherσ áfixeΣ áparameter≤ ì
áááááááááááááááexist« Fo≥ variablσ ba≥ parameters¼ usσ GHBA╥ anΣ ì
áááááááááááááááERAHBA╥ áwhicΦ áexecutσ thσ samσ áfroφ áparameter≤ ì
ááááááááááááááápasseΣ iε registers« Parameter≤ are:
cal∞ drhorz [or erahorz]
defb Row ; 1 = top row on screen
defΓ Column ; 1 = left most column on screen
defb Length ; number of characters to print
defb Direc ; 0 = left-to-right, 1 = right-to-left
Wheε áline≤ áarσ specifieΣ a≤ árigh⌠-t∩-left¼ áthσ ì
ááááááááááááááálef⌠ ámargiε i≤ validateΣ fo≥ exceedinτ áthσ álef⌠ ì
ááááááááááááááámargin¼ áanΣ áonl∙ thσ valiΣ portioε ái≤ áprinted« ì
áááááááááááááááActua∞ printinτ i≤ alway≤ lef⌠-t∩-right.
Example:
EX╘ DRHORZ,ERAHOR┌ ; declare the routines
... ; ..preceding code
CALL DRHORZ ; draw horizontal line at:
DEF┬ 2,10,20,░ ╗ ro≈ 2¼ co∞ 10¼ length 20
; ..print left-to-right
... ; execution resumes here
CALL ERAHORZ ; erase the horizontal line at:
DEF┬ 5,60,20,▒ ╗ ro≈ 5¼ co∞ 60¼ length 20
╗ ..froφ righ⌠-t∩-left
Routine║ GHBAR
Function: Prin⌠ ß graphic≤ horizonta∞ bar/linσ froφ áparameì
áááááááááááááááter≤ iε registers
Entry: A = bar type (0=line, 1=full block, 2=hashed block)
B = length of bar
C = print direction (0=left-to-right,1=right-to-left)
H = starting row (1=top of screen)
L = starting column (1=leftmost column)
Exit: None; registers are meaningless, the bar is printed
Affected: AF¼ BC¼ HL
Usage: UseΣ wherσ horizonta∞ ba≥ parameter≤ arσ calculatì
áááááááááááááááeΣ b∙ ß program¼ o≥ no⌠ knowε a⌠ assembl∙ time.
Examplσ (see als∩ note in DRHORZ example):
EXT GHBA╥ ; declare the routine
... ; ..preceding code
LD A,2 ; print bar w/hashed block char
LD HL,10*256+25 ; .start at row 10, column 25
LD BC,15*256+0 ; ..length of 15, left-to-right
CALL GHBAR ; print it graphically
Routine║ ERAHBAR
Function║ Erase horizontal bar from register parameters
Entry: B = length of bar
C = print direction (0=left-to-right,1=right-to-left)
H = starting row (1=top of screen)
L = starting column (1=leftmost column)
Exit: None; registers are meaningless, the bar is erased
Affected: AF¼ BC¼ HL
Usage: Erase≤ ß horizonta∞ ba≥ b∙ overwritinτ witΦ space≤ ì
áááááááááááááááwherσ áparameter≤ arσ calculateΣ b∙ ß program¼ áo≥ ìèáááááááááááááááarσ no⌠ knowε a⌠ assembl∙ time.
Examplσ (see als∩ note in ERAHORZ example):
EX╘ ERAHBAR ; declare the routine
... ; ..preceding code
LD HL,8*256+50 ; .start at row 8, column 50
LD BC,40*256+1 ; ..length of 40, right-to-left
CALL ERAHBAR ; erase it
Routine║ DRVBAR
Function: Dra≈ heav∙ vertica∞ ba≥ froφ parameter≤ passeΣ áoε ì
ááááááááááááááástack
Entry: None; parameters are addressed by top of stack
Exit: None╗ áexecutioε resume≤ afte≥ parameters¼ ba≥ ái≤ ì
áááááááááááááááprinted
Affected: None
Usage: UseΣ wheε ß heav∙ fixeΣ-locatioε ba≥ i≤ needed¼ o≥ ì
ááááááááááááááába≥ locatioε anΣ sizσ arσ knowε a⌠ assembl∙ átime« ì
áááááááááááááááBa≥ character≤ ma∙ bσ ful∞ o≥ hasheΣ block¼ eithe≥ ì
ááááááááááááááásinglσ áo≥ doublσ width« Seσ GVBA╥ fo≥ áthσ ásamσ ì
áááááááááááááááfunction≤ áfroφ áparameter≤ passeΣ áiε áregisters« ì
áááááááááááááááParameter≤ are:
cal∞ drvbar ; call routine passing param≤ addr
defb Type ; 1=solid single-wide, 2=solid
╗ double-wide¼ 3=hashed single-
╗ wide, 4=hashed double-wide
defΓ Row ; starting row (1=top row)
defΓ Column ; starting column (1=leftmost col)
defb Length ; number of columns in bar
defb Dir ; 0=top-to-bottom, 1=bottom-to-top
Wheε ß ba≥ i≤ drawε froφ bottoφ-t∩-top¼ check≤ arσ ì
ááááááááááááááámadσ fo≥ exceedinτ thσ to≡ oµ screeε (ro≈ 1)« Thσ ì
ááááááááááááááálengtΦ i≤ adjusteΣ iµ s∩ t∩ prin⌠ onl∙ thσ par⌠ oε ì
áááááááááááááááscreen« Bar≤ arσ alway≤ printeΣ to≡-t∩-bottom.
Example:
EXT DRVBAR ; declare the routine
... ; ..preceding code
CALL DRVBAR ; draw vertical bar as:
DEFB 2,20,10,5,0 ; solid single-width, row 20,
; ..col 10, 5 long,
╗ ..to≡-t∩-bottom
... ; execution resumes here
Routines║ DRVERT¼ ERAVERT
Function: Prin⌠ o≥ erasσ graphic≤ vertica∞ linσ froφ áinlinσ ì
áááááááááááááááparameters
Entry: None; the top of stack points to parameters
Exit: None; execution resumes after the parameters
Affected: None
Usage: DRVER╘ print≤ ß vertica∞ linσ anΣ ERAVER╘ erase≤ ß ì
ááááááááááááááávertica∞ linσ froφ inlinσ parameters« Thesσ árouì
ááááááááááááááátine≤ arσ useΣ wherσ fixeΣ parameter≤ exist« á Fo≥ ì
ááááááááááááááávariablσ ába≥ áparameter≤ usσ GVBA╥ áanΣ áERAVBAR¼ ì
áááááááááááááááwhicΦ áexecutσ thσ samσ froφ parameter≤ passeΣ áiε ì
áááááááááááááááregisters« Parameter≤ are:
.paè cal∞ drvert [or eravert]
defb Row ; 1=top row on screen
defb Column ; 1=leftmost column on screen
defb Length ; number of characters to print
defb Direc ; 0=top-to-bottom, 1=bottom-to-top
Wheε ß ba≥ i≤ drawε froφ bottoφ-t∩-top¼ check≤ arσ ì
ááááááááááááááámadσ fo≥ exceedinτ thσ to≡ oµ screeε (ro≈ 1)« Thσ ì
ááááááááááááááálengtΦ i≤ adjusteΣ iµ s∩ t∩ prin⌠ onl∙ thσ par⌠ oε ì
áááááááááááááááscreen« Bar≤ arσ alway≤ printeΣ to≡-t∩-bottom.
Example:
EX╘ DRVERT,ERAVER╘ ╗ declarσ thσ routines
..« ╗ ..precedinτ code
CALL DRVERT ; draw vertical line at:
DEFB 2,10,15,0 ; row 2, col 10, length 15
; ..print top-to-bottom
..« ; execution resumes here
CALL ERAVERT ; erase the vertical line at:
DEFB 22,60,20,1 ; row 22, col 60, length 20
; ..from bottom-to-top
Routine║ GVBAR
Function: Prin⌠ ágraphic≤ ávertica∞ bar/linσ áfroφ áregiste≥ ì
áááááááááááááááparameters
Entry: ┴ ╜ ba≥ typσ (0=line¼ 1=singlσ ful∞ block¼ á2=douì
áááááááááááááááblσ ful∞ block¼ 3=singlσ hasΦ block¼ 4=doublσ hasΦ ì
áááááááááááááááblock)
B = length of bar (number of characters)
C = print direction (0=top-to-bottom,1=bottom-to-top)
H = starting row (1=top of screen)
L = starting column (1=leftmost column)
Exit: None; registers are meaningless, the bar is printed
Affected: AF¼ BC¼ HL
Usage: Print≤ ácalculateΣ ávertica∞ ábar≤ áfroφ áprogram≤ ì
áááááááááááááááwherσ parameter≤ arσ no⌠ knowε a⌠ assembl∙ time.
Examplσ (see note in DRVERT example):
EX╘ GVBAR ; declare the routine
... ; ..preceding code
LD A,2 ; double bar w/full block char
LD HL,22*256+60 ; .start at row 22, column 60
LD BC,15*256+1 ; ..length of 15, bottom-to-top
CALL GVBAR ; print it graphically
Routine║ ERAVBAR
Function║ Erase vertical bar from register parameters
Entry: B = length of bar (number of characters)
├ ╜ prin⌠ directioε (0=to≡-t∩-bottom¼ 1=bottoφ-t∩-ì
ááááááááááááááátop)
H = starting row (1=top of screen)
L = starting column (1=leftmost column)
Exit: None; registers are meaningless, the bar is erased
Affected: AF¼ BC¼ HL
Usage: Erase≤ áß vertica∞ ba≥ b∙ overwritinτ witΦ áspace≤ ì
áááááááááááááááwherσ áparameter≤ arσ calculateΣ b∙ ß program¼ áo≥ ì
áááááááááááááááarσ áno⌠ áknowε a⌠ assembl∙ time« á D∩ átwicσ áfo≥ ì
ááááááááááááááádoublσ-widtΦ bar.è Examplσ (see note in ERAVERT example):
EX╘ ERAVBAR ; declare the routine
... ; ..preceding code
LD HL,8*256+10 ; .start at row 8, column 10
LD BC,15*256+0 ; ..length of 15, top-to-bottom
CALL ERAVBAR ; erase it
BO╪ DRAWIN╟ ROUTINES:
Routines║ DRFBOX¼ DRBOX¼ ERABOX
Function: Dra≈ anΣ erasσ graphic≤ characte≥ bo° froφ áinlinσ ì
áááááááááááááááparameters
Entry: None; the top of stack addresses box parameters
Exit: None╗ áexecutioε áresume≤ a⌠ ábytσ áfollowinτ áthσ ì
áááááááááááááááparameters
Affected: None
Usage: DRFBO╪ draw≤ graphic≤ boxe≤ frameΣ witΦ ful∞ blocδ ì
ááááááááááááááácharacters¼ DRBO╪ draw≤ graphic≤ boxe≤ frameΣ witΦ ì
ááááááááááááááánorma∞ ágraphic≤ linσ anΣ corne≥ ácharacters¼ áanΣ ì
áááááááááááááááERABO╪ áerase≤ ß box« Boxe≤ arσ drawε áfroφ áto≡-ì
ááááááááááááááálef⌠ át∩ bottoφ right¼ anΣ eraseΣ áb∙ áoverwritinτ ì
áááááááááááááááwitΦ spaces« Parameter≤ are:
cal∞ drfbox ; (or drbox or erabox)
defb Row ; starting row (1 = top row)
defb Column ; starting column
defb Height ; height of box in character rows
defb Width ; width of box in character positions
Example:
EX╘ DRFBOX,DRBOX,ERABOX ; declare routines
... ; ..preceding code
CALL DRBOX ; draw a normal box
DEFB 5,5,10,20 ; row 5, col 5, 10 spaces high
; ..and 20 spaces wide
CALL DRFBOX ; draw box framed w/solid blks
DEFB 10,30,6,25 ; row 10, col 30, 6 spaces high
; ..and 25 wide
CALL ERABOX ; erase the first box
DEFB 5,5,10,20
... ; ..and continue
Routines║ GFBOX¼ GBOX¼ GERBOX
Function: Dra≈ o≥ erasσ graphic≤ characte≥ bo° froφ registe≥ ì
áááááááááááááááparameters
Entry: B = width of box in character spaces
C = height of box in lines
H = starting row (top left corner, 1=top row)
╠ á╜ startinτ columε (to≡ lef⌠ corner¼ á1=leftmos⌠ ì
ááááááááááááááácolumn)
Exit: None; registers indeterminate, box drawn
Affected: AF¼ BC¼ HL
Usage: GFBO╪ ádraw≤ graphic≤ bo° frameΣ witΦ soliΣ áblocδ ì
ááááááááááááááácharacters¼ áGBO╪ ádraw≤ graphiπ bo° áframeΣ áwitΦ ì
ááááááááááááááálinσ anΣ corne≥ graphic≤ characters¼ GERBO╪ erase≤ ì
ááááááááááááááábo° áb∙ overwritinτ witΦ spaces« á Thesσ ároutine≤ ì
áááááááááááááááimplemen⌠ áthσ samσ function≤ a≤ thσ previou≤ ábo° ìèááááááááááááááároutines¼ ábu⌠ áderivσ thei≥ parameter≤ áfroφ áCP╒ ì
áááááááááááááááregisters« á Usσ áthesσ ároutine≤ áfo≥ ácalculateΣ ì
ááááááááááááááávalue≤ o≥ fo≥ parameter≤ no⌠ knowε a⌠ assembly.
Example:
EX╘ GFBOX,GBOX,GERBOX ; declare the routines
... ; ..preceding code
LD BC,30*256+10 ; 30 spaces wide, 10 high
LD HL,10*256+20 ; ..at row 10, col 20
CALL GBOX ; draw it!
Routine║ CHKBOX
Function║ Check and adjust box parameters
Entry: B = width of box in character spaces
C = height of box in lines
H = starting row (top left corner, 1=top row)
╠ á╜ startinτ columε (to≡ lef⌠ corner¼ á1=leftmos⌠ ì
ááááááááááááááácolumn)
Exit: ┴ á<╛ 0¼ zer∩ clea≥ (NZ⌐ iµ bo° drawable¼ áparameì
áááááááááááááááter≤ set
A = 0, zero flag clear (Z) if box not drawable
Affected: AF, anΣ maybe B├ anΣ HL if parameters arσ adjusted
Usage: Thi≤ ároutinσ ái≤ useΣ internall∙ át∩ áadjus⌠ ábo° ì
ááááááááááááááádimension≤ át∩ áscreeε sizσ reflecteΣ iε áthσ áCR╘ ì
ááááááááááááááádatß iε thσ Z│ environment« Startinτ ro≈ o≥ ácolì
áááááááááááááááumε áexceedinτ áthσ maximuφ heigh⌠ o≥ áwidtΦ áwil∞ ì
ááááááááááááááácausσ áthσ áerro≥ status« I⌠ ma∙ ábσ áuseΣ áafte≥ ì
ááááááááááááááásettinτ áregister≤ fo≥ ß GRBO╪ o≥ GRFBO╪ ácal∞ át∩ ì
ááááááááááááááásavσ áthσ áactua∞ ábo° parameter≤ áwhicΦ áwil∞ ábσ ì
ááááááááááááááádrawn.
Example:
EXT CHKBOX,GBOX ; declare the routines
... ; ..set up for box draw
CALL CHKBOX ; validate the dimen/location
JR Z,NOGOOD ; ..jump if can't draw this one
LD (HITWID),BC ; else save width/height
LD (ROWCOL),HL ; ..and row/col start loc'n
CALL GBOX ; draw this box
...
PULL-DOW╬ MENUS:
Routine║ SETPDM
Function: Se⌠ áselec⌠ men⌡ anΣ iteφ men⌡ ba≥ áfo≥ ápul∞-dowε ì
ááááááááááááááámen⌡ froφ inlinσ data
Entry: None; top of stack points to menu data area
Exit: A <> 0, zero flag clear (NZ) if pull-down menu OK
A = 0, zero set (Z) if error or not supported
Affected: AF
Usage: á SETPD═ áuse≤ inlinσ parameter≤ anΣ áestablishe≤ áß ì
ááááááááááááááásinglσ men⌡ selection¼ anΣ se⌠ informatioε fo≥ thσ ì
ááááááááááááááápul∞-dowε iteφ selectioε bar« Thσ numbe≥ oµ ámen⌡ ì
áááááááááááááááselection≤ ái≤ determineΣ b∙ screeε width¼ anΣ áu≡ ì
ááááááááááááááát∩ áteε áselection≤ ma∙ bσ supported« á Men⌡ ádatß ì
ááááááááááááááádescription≤ áarσ ASCI╔ tex⌠ string≤ áwitΦ ábinar∙ ì
ááááááááááááááávalue≤ oµ onσ t∩ teε (onl∙ ▒-╡ currentl∙ used⌐ át∩ ìèááááááááááááááádenotσ specia∞ feature≤ anΣ fields.
Thσ men⌡ datß areß i≤ structured a≤ follows:
Menu number (byte⌐ in the range of 1..10
Menu name (string) terminated by binary 1
Item selection strings terminated by binary 3's
Optiona∞ field≤ ma∙ bσ intersperseΣ witΦ selectioε ì
ááááááááááááááástrings:
Sub-header strings terminated by binary 2's
Separator lines indicateΣ b∙ binary ┤ (byte)
Blank lines indicateΣ b∙ binary ╡ (byte)
Example:
EXT SETPDM ; declare the routine
... ; ..call PDMINI up here
CALL SETPDM
DEFB 1 ; menu number (1..10)
DEFB 'MenuName',1 ; name on menu bar
DEFB 'Subheader',2 ; optional subheader(s)
DEFB 4 ; optional separator line
DEFB 'Item 1',3 ; first item name
DEFB 5 ; optional blank line
DEFB 'Item 2',3 ; second item name
DEFB 0 ; end of menu item list
... ; ..execution resumes here
Routine║ SETPDR
Function║ Se⌠ áselec⌠ men⌡ anΣ iteφ men⌡ ba≥ áfo≥ ápul∞-dowε ì
ááááááááááááááámen⌡ froφ registe≥ data
Entry: HL = pointer to menu data area
Exit: A <> 0, zero flag clear (NZ) if pull-down menu OK
A = 0, zero set (Z) if error or not supported
HL = address of byte after terminating NUL
Affected: AF¼ HL
Usage: á SETPD╥ use≤ ß separatσ datß areß pointeΣ t∩ b∙ áH╠ ì
áááááááááááááááanΣ áestablishe≤ ß singlσ men⌡ selection¼ anΣ áse⌠ ì
áááááááááááááááinformatioε fo≥ thσ pul∞-dowε iteφ selectioε ábar« ì
áááááááááááááááThσ ánumbe≥ áoµ men⌡ selection≤ i≤ ádetermineΣ áb∙ ì
áááááááááááááááscreeε áwidth¼ áanΣ u≡ t∩ teε áselection≤ áma∙ ábσ ì
ááááááááááááááásupported« Men⌡ datß description≤ arσ ASCI╔ átex⌠ ì
ááááááááááááááástring≤ witΦ binar∙ value≤ oµ onσ t∩ teε (onl∙ ▒-╡ ì
ááááááááááááááácurrentl∙ áused⌐ át∩ denotσ specia∞ áfeature≤ áanΣ ì
áááááááááááááááfields.
Thσ men⌡ datß areß i≤ structured a≤ follows:
Menu number (byte⌐ in the range of 1..10
Menu name (string) terminated by binary 1
Item selection strings terminated by binary 3's
Optiona∞ field≤ ma∙ bσ intersperseΣ witΦ selectioε ì
ááááááááááááááástrings:
Sub-header strings terminated by binary 2's
Separator lines indicateΣ b∙ binary ┤ (byte)
Blank lines indicateΣ b∙ binary ╡ (byte)
Example║ Seσ SETPD═ above.
è Routine║ CLRPDM
Function║ Clear a pull-down menu from the menu selection bar
Entry: A = menu number to clear (0 = clear all)
Exit: A <> 0, zero flag clear (NZ) if operation successful
A = 0, zero flag set (Z) if entry not found
Affected: AF
Usage: Delete≤ áaε entr∙ froφ thσ men⌡ ba≥ anΣ move≤ áal∞ ì
ááááááááááááááásubsequen⌠ áentrie≤ át∩ thσ left« á Logica∞ áentr∙ ì
ááááááááááááááánumber≤ ásta∙ áthσ samσ a≤ wheε loaded¼ ábu⌠ áthi≤ ì
áááááááááááááááfunctioε refer≤ t∩ thσ physica∞ positioninτ oε thσ ì
ááááááááááááááámen⌡ bar.
Example:
EXT CLRPDM ; declare the variable
... ; ..establish pull-down menus
LD A,4 ; remove the 4th entry
CALL CLRPDM ; ..in the bar
JR NZ,REMOK ; jump if removal OK
...
Routine║ SELPDM
Function: Ente≥ ápul∞-dowε men⌡ anΣ returε menu/iteφ áselecì
ááááááááááááááátions
Entry: None
Exit: ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ pul∞-dowε men⌡ áescapσ ì
áááááááááááááááke∙ pressed
A <> 0, zero clear (NZ) if menu item selected
H = menu numbe≥ selected
L = item selection numbe≥ selected
Affected: AF¼ HL
Usage: Thi≤ routinσ form≤ thσ hear⌠ oµ thσ pul∞-dowε men⌡ ì
ááááááááááááááásystem« Wheε entered¼ contro∞ wil∞ no⌠ returε át∩ ì
áááááááááááááááthσ prograφ unti∞ eithe≥ thσ pul∞-dowε men⌡ escapσ ì
ááááááááááááááácharacte≥ i≤ pressed¼ o≥ ß valiΣ men⌡ anΣ iteφ arσ ì
áááááááááááááááselected« á B∙ áevaluatinτ áthσ áreturneΣ ávalues¼ ì
áááááááááááááááspecifiπ áaction≤ ma∙ bσ takeε sucΦ áa≤ áselectinτ ì
áááááááááááááááprogram≤ t∩ run¼ item≤ t∩ list¼ etc.
Routine║ MCLS
Function║ Clear terminal screen except for pull-down menu bar
Entry: None
Exit: A <> 0, zero flag reset (NZ) if screen cleared OK
A = 0 zero flag set (Z) if CLREOS not implemented
Affected: AF
Usage: Clear≤ áthσ áscreeε áfroφ linσ ▓ át∩ áthσ áenΣ-oµ-ì
áááááááááááááááscreen¼ át∩ preservσ pul∞-dowε men⌡ selectioε ába≥ ì
áááááááááááááááoε linσ 1.
Routine║ PDMINI
Function║ Initialize pull-down menu functions
Entry: None
Exit: None; internal menu variables are initialized
Affected: None
Usage: Thi≤ ároutinσ mus⌠ bσ calleΣ beforσ thσ ápul∞-dowε ì
ááááááááááááááámen⌡ ásysteφ i≤ used« I⌠ clear≤ needeΣ ávariable≤ ì
áááááááááááááááanΣ set≤ thσ defaul⌠ pul∞-dowε men⌡ escapσ characìèáááááááááááááááte≥ t∩ ES├ (1Bh).
Example:
EXT PDMINI ; declare the routine
... ; ..preliminary code sections
CALL PDMINI ; initialize pull-down menus
... ; ..now set menus, etc
Routine║ ISPDM
Function║ Check character for pull-down menu escape character
Entry: A = character to check
Exit: A = character
Zero clear (NZ) if it is the escape character
Zer∩ flaτ se⌠ (Z⌐ iµ no⌠ thσ escapσ charaπter
Affected: Flags
Usage: Thi≤ routinσ i≤ useΣ iε thσ pul∞-dowε men⌡ áselecì
ááááááááááááááátioε ácodσ t∩ sensσ fo≥ thσ escapσ character¼ áanΣ ì
áááááááááááááááma∙ ábσ useΣ iε ß simila≥ modσ iε othe≥ áprograms« ì
áááááááááááááááSe⌠ thσ desireΣ characte≥ witΦ SPDMCHR.
Example:
EXT ISPDM,CIN ; declare some routines
... ; ..preceding code
CALL CIN ; get a character from console
CALL ISPDM ; is it the escape char?
JR NZ,HAVIT ; ..jump if so
... ; else loop or whatever..
Routine║ SPDMCHR
Function: Changσ áthσ ávaluσ oµ thσ ápul∞-dowε ámen⌡ áescapσ ì
ááááááááááááááácharacter
Entry: ┴ ╜ ne≈ characte≥ t∩ usσ a≤ pul∞-dowε men⌡ áescapσ ì
ááááááááááááááácharacter
Exit: None╗ áthσ characte≥ i≤ se⌠ (normall∙ ES├-1Bh¼ áo≥ ì
ááááááááááááááá^▄-1Ch)
Affected: None
Usage: Change≤ áthσ pul∞-dowε men⌡ escapσ characte≥ áfroφ ì
áááááááááááááááthσ initia∞ valuσ oµ ES├ (1Bh)« Norma∞ value≤ arσ ì
áááááááááááááááeithe≥ ES├ (1Bh⌐ o≥ ^▄ (1Ch).
READIN╟ TH┼ TERMINA╠ SCREEN:
Routine║ GETCUR
Function║ Ge⌠ thσ curren⌠ curso≥ positioε froφ thσ terminal
Entry║ None
Exit║ ┴ ╜ 0FFh¼ zer∩ flaτ clea≥ (NZ⌐ iµ successful
H╠ ╜ curren⌠ curso≥ positioε (iµ NZ)
┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ functioε i≤ no⌠ available
Affected║ AF¼ HL
Usage║ Return≤ curso≥ positioε a≤ useΣ b∙ GOTOX┘ ároutinσ ì
ááááááááááááááá(╚ ╜ row¼ ╠ ╜ column).
Example:
EX╘ GETCUR,GOTOX┘ ╗ declarσ routines
«.« ╗ ..intervening code
CAL╠ GETCU╥ ╗ ge⌠ cursor position
J╥ Z,NOTAVAI╠ ╗ ..jum≡ if not available
L─ (CURPOS),H╠ ╗ storσ position for laterè «.« ╗ .«you≥ screen routines
L─ HL,(CURPOS⌐ ╗ ge⌠ back stored position
CAL╠ GOTOX┘ ╗ anΣ restore cursor
╗ t∩ where it was
Routine║ GETLIN
Function║ ReaΣ ß linσ froφ thσ termina∞ screen
Entry║ Curso≥ positioneΣ a⌠ enΣ oµ line
Exit║ ┴ ╜ 0FFh¼ zer∩ flaτ clea≥ (NZ⌐ iµ successful
H╠ ╜ addres≤ oµ nul∞-terminateΣ strinτ froφ terminal (if NZ)
┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ functioε i≤ no⌠ available
Affected║ AF¼ HL
Usage: Read≤ linσ containinτ curso≥ froφ thσ firs⌠ columε ì
ááááááááááááááát∩ á(anΣ including⌐ thσ curren⌠ curso≥ column¼ ás∩ ì
ááááááááááááááápositioε thσ curso≥ first.
Example:
EX╘ GOTOXY,GETLI╬ ╗ declarσ routines
..« ╗ ..intervening code
L─ H,▒ ╗ ro≈ 1
L─ L,8░ ╗ columε 80
CAL╠ GOTOX┘ ╗ position the cursor
CAL╠ GETLI╬ ╗ ge⌠ thσ line
J╥ Z,NOTAVAI╠ ╗ ..jum≡ if not available
.paè