; SHOWMAIN.Z80 show: call stopzex ; Turn off ZEX input redirection call stopxsub ; Turn off XSUB input redirection call tinit ; Initialize terminal ld a,(fcb+1) ; See if initial menu selection made cp ' ' jp nz,getcmd1 ; If character present, take as menu choice ; Header show1: call banner ; Print banner call gxymsg defb 3,27 ; Row 3, column 27 defb '--> ',highon,' SHOW Main Menu ',highoff,' <--',0 ; Left column of display ld hl,7*100h+7 ; Row 7, column 7 ld (infoxy),hl call vprxy ; Position display advance line number and print defb ' ' defb ' PACKAGE DATA',0 call vprxy defb ' F -- ' defb highon, defb ' Flow Command Package ' defb highoff,0 call vprxy defb ' R -- ' defb highon, defb ' Resident Command Pkg ' defb highoff,0 call vprxy defb ' C -- ' defb highon, defb ' CPR Commands ' defb highoff,0 call vprxy defb ' I -- ' defb highon defb ' Input/Output Package ' defb highoff,0 call dispxy call vprxy ; Skip an extra line defb ' ' defb ' ENVIRONMENT',0 call vprxy defb ' E -- ' defb highon defb ' Error Handler ' defb highoff,0 call vprxy defb ' M -- ' defb highon defb ' Memory Utility ' defb highoff,0 call vprxy defb ' N -- ' defb highon defb ' Named Directory ' defb highoff,0 call vprxy defb ' P -- ' defb highon defb ' Path Expression ' defb highoff,0 call vprxy defb ' S -- ' defb highon defb ' Shell Stack ' defb highoff,0 ; Right column ld hl,7*100h+40 ; Row 7, column 40 ld (infoxy),hl call vprxy defb ' ' defb ' ZCPR3 SYSTEM DATA',0 call vprxy defb ' 1 -- ' defb highon defb ' Module Data ' defb highoff,0 call vprxy defb ' 2 -- ' defb highon defb ' Message Buffers ' defb highoff,0 call vprxy defb ' 3 -- ' defb highon defb ' Environment Data ' defb highoff,0 call vprxy defb ' 4 -- ' defb highon defb ' System File Names ' defb highoff,0 call dispxy call vprxy defb ' ' defb ' CPR OPTIONS',0 call vprxy defb ' 5 -- ' defb highon defb ' CPR Facilities ' defb highoff,0 call vprxy defb ' 6 -- ' defb highon defb ' Special Options ' defb highoff,0 call vprxy defb ' 7 -- ' defb highon defb ' Access Options ' defb highoff,0 call dispxy call vprxy defb ' X -- ' defb highon defb ' Exit ' defb highoff,0 ; Input Command from User getcmd: call gxymsg ; Print prompt defb 23,4,highon,' SHOW Command: ',highoff,' ',0 call capine ; Get command getcmd1: call ctabscan ; Scan for and process command call vprint ; Print error message defb bell,0 jr getcmd ; Print Banner banner: call cls ; Clear screen call gxymsg ; Print banner message defb 1,26 ; Row 1, column 26 defb '>>>> ' defb 'SHOW Version ' defb [version/10]+'0','.',[version mod 10]+'0' if testv <> ' ' defb testv endif defb ' <<<<',0 ret ; Command Table ctable: defb '1' ; ENV descriptor data defw envdes defb '2' ; Message buffer data defw msg defb '3' ; CRT and Printer defw cpdata defb '4' ; File Names defw fnames defb '5' ; System Facilites defw facility defb '6' ; Special CPR Options defw special defb '7' ; Access Options defw access defb 'C' ; CPR Command Listing defw cpr defb 'F' ; FCP Command Listing defw fcp defb 'R' ; RCP Command Listing defw rcp defb 'E' ; Error Handler Display defw errorh defb 'I' ; I/O Package Display defw iopack defb 'M' ; Memory Utility defw memory defb 'N' ; Named Directory Data defw namedir defb 'P' ; Path Display defw pdisp defb 'S' ; Shell Stack Display defw shstack defb 'X' ; Exit defw exit defb ctrlc ; Exit defw exit defb cr ; New Screen defw show1 defb ' ' ; New Screen defw show1 defb ctrlr ; New Screen defw show1 defb 0 ; end of table ; Scan for and transfer control to command routine ctabscan: ld hl,ctable ; Point to command table ld c,a ; Put command character in C ctab1: ld a,(hl) ; Get character from table or a ; Done? ret z ; If so, return cp c ; Check for match jr z,ctab2 ; Branch on match inc hl ; Otherwise, skip to next command in table inc hl inc hl jr ctab1 ctab2: inc hl ; Point to address ld a,(hl) ; Get it into HL inc hl ld h,(hl) ld l,a pop af ; Clear stack jp (hl) ; Jump to command entry point ; END SHOWMAIN.Z80