REM TARBELL DUPLEX 816 PCPROM INSTALLATION PROGRAM REM Copyright (c) 1985, Tarbell Electronics REM Last changed 2-18-85 by Don Tarbell REM Set up constants. mv = 20 REM max number of video types. mk = 60 REM max number of defined keys. null$ = "" REM zero length string. serfil$ = "SETSER.EXE" REM set serial file. vidfil$ = "PINSTALL.VID" REM video parameter file. REM DIMENSION ARRAYS. DIM mfr$(mv) REM manufacturer. DIM model$(mv) REM model. DIM norows(mv) REM number of rows. DIM nocols(mv) REM number of columns. DIM nochars(mv) REM number of characters. DIM vtype(mv) REM type of video terminal. DIM in(5,mv) REM insert line. DIM dl(5,mv) REM delete line. DIM sd(5,mv) REM set dim. DIM sb(5,mv) REM set bright. DIM cs(5,mv) REM clear to end of screen. DIM sc(8,mv) REM set cursor position. DIM gc(3,mv) REM enter graphics character mode. DIM ac(3,mv) REM exit graphics character mode. DIM gp(3,mv) REM enter graphics point plot mode. DIM cp(3,mv) REM exit graphics point plot mode. DIM baud(12) REM Duplex baud rate table. DIM crtist(128) REM crt initialization sequence table. DIM key(2,mk) REM keyboard definitions. START: GOSUB OPENING bauda = 0 REM initialize baud rate codes. baudb = 0 LOOP: GOSUB MAINMEN IF ans$ = "V" THEN GOSUB VIDEO: GOTO LOOP IF ans$ = "K" THEN GOSUB KEYBOARD: GOTO LOOP IF ans$ = "P" THEN GOSUB PRINTER: GOTO LOOP IF ans$ = "X" THEN GOTO EXIT PRINT:PRINT PRINT ans$;" is an invalid entry. Try again." GOTO LOOP EXIT: PRINT:PRINT PRINT "Exiting back to operating system." STOP OPENING: PRINT:PRINT PRINT " Tarbell Duplex 816 PCPROM Installation" PRINT " Copyright (c) 1985 Tarbell Electronics" PRINT " Version 1.1 of 2-12-85" PRINT RETURN MAINMEN: PRINT:PRINT PRINT " MAIN INSTALLATION MENU" PRINT PRINT " Enter To Install" PRINT " ----- ---------------------" PRINT " V Video Display" PRINT " K Keyboard" PRINT " P Printer" PRINT " X To exit this program" PRINT INPUT "Enter:";ans$ ans$ = UCASE$(ans$) RETURN VIDEO: PRINT:PRINT PRINT "Want to enter your own parameters"; GOSUB GETYN IF ans$ = "Y" THEN GOTO VIDEOC filnam$ = vidfil$ IF END #1 THEN NOTFOUND OPEN filnam$ AS 1 IF END #1 THEN VIDEO1 VIDEO3: FOR i = 1 TO 20 READ #1;mfr$(i),model$(i),nocols(i), \ norows(i),nochars(i),vtype(i) READ #1;in(1,i),in(2,i),in(3,i),in(4,i),in(5,i), \ dl(1,i),dl(2,i),dl(3,i),dl(4,i),dl(5,i), \ sd(1,i),sd(2,i),sd(3,i),sd(4,i),sd(5,i), \ sb(1,i),sb(2,i),sb(3,i),sb(4,i),sb(5,i) READ #1;cs(1,i),cs(2,i),cs(3,i),cs(4,i),cs(5,i), \ sc(1,i),sc(2,i),sc(3,i),sc(4,i),sc(5,i), \ sc(6,i),sc(7,i),sc(8,i),gc(1,i),gc(2,i), \ gc(3,i),ac(1,i),ac(2,i),ac(3,i),gp(1,i), \ gp(2,i),gp(3,i),cp(1,i),cp(2,i),cp(3,i) NEXT i VIDEO1: nt = i -1 PRINT:PRINT PRINT " Select Video Display" PRINT FOR i = 1 TO nt PRINT tab(5);i;tab(10);mfr$(i);" ";model$(i) NEXT i PRINT PRINT "Enter number (1-";nt;"),"; INPUT " to go on, or M for menu:";ans$ IF UCASE$(ans$) = "M" THEN RETURN IF ans$ = null$ THEN GOTO VIDEO3 v = VAL(ans$) IF v < 1 OR v > nt THEN \ PRINT:PRINT v;"is not right." :\ GOTO VIDEO1 PRINT PRINT "Want to install ";mfr$(v);" ";model$(v);" in ";serfil$; GOSUB GETYN IF ans$ = "Y" THEN GOSUB VIDEOI RETURN VIDEOC: PRINT PRINT "NOTE: All codes are decimal ASCII." PRINT GOSUB VIDEOMR REM get manufacturer. GOSUB VIDEOMN REM get model number. GOSUB VIDEOCC REM get character columns. GOSUB VIDEORO REM get rows. GOSUB VIDEOTP REM get type of terminal. GOSUB VIDEOIL REM get insert line sequence. GOSUB VIDEODL REM get delete line sequence. GOSUB VIDEOSD REM get set dim sequence. GOSUB VIDEOSB REM get set bright sequence. GOSUB VIDEOCS REM get clear screen sequence. GOSUB VIDEOSC REM get set cursor sequence. GOSUB VIDEOGC REM get enter character graphics seq. GOSUB VIDEOGP REM get enter point-plot graphics seq. VIDEOL: GOSUB VIDEOP REM print out what was entered. PRINT PRINT "Want to change any of the above"; GOSUB GETYN IF ans$ = "N" THEN GOTO VIDEOE PRINT INPUT "Enter item number:";n IF n<1 OR n>12 THEN \ PRINT "Incorrect item number." :\ GOTO VIDEOL ON n GOSUB VIDEOMR,VIDEOMN,VIDEOCC,VIDEORO, \ VIDEOTP,VIDEOIL,VIDEODL,VIDEOSD, \ VIDEOSB,VIDEOCS,VIDEOSC,VIDEOGC, \ VIDEOGP GOTO VIDEOL VIDEOE: nochars(1) = nocols(1) * norows(1) PRINT PRINT "Want to add this terminal to bottom of ";vidfil$; GOSUB GETYN IF ans$ = "Y" THEN GOSUB VIDEOA PRINT PRINT "Want to install this terminal into file ";serfil$; GOSUB GETYN IF ans$ = "Y" THEN v=1:GOSUB VIDEOI RETURN VIDEOA: REM Add terminal 1 to bottom of file vidfil$. filnam$ = vidfil$ IF END #1 THEN NOTFOUND OPEN filnam$ AS 1 IF END #1 THEN VIDEOAW VIDEOAR: READ #1;LINE temp$ REM read till end of file. GOTO VIDEOAR VIDEOAW: LET i = 1 PRINT #1;mfr$(i),model$(i),nocols(i),norows(i),nochars(i),vtype(i) PRINT #1;in(1,i),in(2,i),in(3,i),in(4,i),in(5,i), \ dl(1,i),dl(2,i),dl(3,i),dl(4,i),dl(5,i), \ sd(1,i),sd(2,i),sd(3,i),sd(4,i),sd(5,i), \ sb(1,i),sb(2,i),sb(3,i),sb(4,i),sb(5,i) PRINT #1;cs(1,i),cs(2,i),cs(3,i),cs(4,i),cs(5,i), \ sc(1,i),sc(2,i),sc(3,i),sc(4,i),sc(5,i), \ sc(5,i),sc(7,i),sc(8,i),gc(1,i),gc(2,i), \ gc(3,i),ac(1,i),ac(2,i),ac(3,i),gp(1,i), \ gp(2,i),gp(3,i),cp(1,i),cp(2,i),cp(3,i) CLOSE 1 RETURN VIDEOI: REM Install terminal #v parameters into file serfil$. vbaud = 0: sbaud = 0 PRINT:PRINT "Want DTR handshaking on this terminal";: GOSUB GETYN IF ans$ = "Y" THEN vtype(v) = vtype(v) + 2 PRINT:PRINT "Want to set the console baud rate";: GOSUB GETYN IF ans$ = "N" THEN GOTO VIDEOIN GOSUB GETBAUD: vbaud = sbaud PRINT:PRINT "Same for keyboard";: GOSUB GETYN IF ans$ = "N" THEN GOSUB GETBAUD bauda = 16 * sbaud + vbaud VIDEOIN: filnam$ = serfil$ IF END #2 THEN NOTFOUND OPEN filnam$ RECL 128 AS 2 nocharlo = MOD(nochars(v),256) nocharhi = INT(nochars(v)/256) ans$ = chr$(nocols(v)) + chr$(norows(v)) + \ chr$(nocharlo) + chr$(nocharhi) + \ chr$(vtype(v)) FOR i = 1 TO 5: ans$ = ans$ + chr$(in(i,v)): NEXT i FOR i = 1 TO 5: ans$ = ans$ + chr$(dl(i,v)): NEXT i FOR i = 1 TO 5: ans$ = ans$ + chr$(sd(i,v)): NEXT i FOR i = 1 TO 5: ans$ = ans$ + chr$(sb(i,v)): NEXT i FOR i = 1 TO 5: ans$ = ans$ + chr$(cs(i,v)): NEXT i FOR i = 1 TO 8: ans$ = ans$ + chr$(sc(i,v)): NEXT i FOR i = 1 TO 3: ans$ = ans$ + chr$(gc(i,v)): NEXT i FOR i = 1 TO 3: ans$ = ans$ + chr$(ac(i,v)): NEXT i FOR i = 1 TO 3: ans$ = ans$ + chr$(gp(i,v)): NEXT i FOR i = 1 TO 3: ans$ = ans$ + chr$(cp(i,v)): NEXT i ans$ = ans$ + chr$(bauda) PRINT USING "&"; #2,7;ans$ CLOSE 2 RETURN NOTFOUND: REM File filnam$ was not found. PRINT PRINT "The file ";filnam$;" was too short or not found." RETURN GETBAUD: REM Get code to get baud rates. baud(1)=110: baud(2)=134.5: baud(3)=150: baud(4)=300 baud(5)=600: baud(6)=1200: baud(7)=2000: baud(8)=2400 baud(9)=4800: baud(10)=1800: baud(11)=9600: baud(12)=19200 PRINT PRINT tab(10);"Enter to select" PRINT tab(10);"----- ---------" FOR b = 1 TO 12 PRINT tab(11);b;tab(18);baud(b) NEXT b PRINT INPUT "Enter number from 1 to 12, or 0 for no change:";sbaud IF sbaud<0 OR sbaud>12 THEN \ PRINT sbaud;"is not in table." :\ GOTO GETBAUD RETURN VIDEOMR: PRINT INPUT "Who is the manufacturer of your display?";mfr$(1) RETURN VIDEOMN: PRINT INPUT "What is the model number?";model$(1) RETURN VIDEOCC: PRINT INPUT "How many character columns does it have?";nocols(1) RETURN VIDEORO: PRINT INPUT "How many rows (lines) does it have?";norows(1) RETURN VIDEOTP: PRINT vtype(1) = 0 PRINT "Is it a serial terminal"; GOSUB GETYN IF ans$ = "Y" THEN vtype(1) = vtype(1) + 1 PRINT "Is it a memory-mapped video"; GOSUB GETYN IF ans$ = "Y" THEN vtype(1) = vtype(1) + 4 PRINT "Does it use decimal digits for cursor position"; GOSUB GETYN IF ans$ = "Y" THEN vtype(1) = vtype(1) + 8 RETURN VIDEOIL: PRINT FOR j = 1 TO 5: in(j,1)=0: NEXT j INPUT "How many codes are in INSERT LINE sequence?";in(1,1) IF in(1,1)>4 THEN PRINT "Sorry, the max is 4.":GOTO VIDEOIL FOR j = 1 TO in(1,1) PRINT "code";j; INPUT ":";in(j+1,1) NEXT j RETURN VIDEODL: PRINT FOR j = 1 TO 5: dl(j,1)=0: NEXT j INPUT "How many codes are in DELETE LINE sequence?";dl(1,1) IF dl(1,1)>4 THEN PRINT "Sorry, 4 max.":GOTO VIDEODL FOR j = 1 TO dl(1,1) PRINT "code";j; INPUT ":";dl(j+1,1) NEXT J RETURN VIDEOSD: PRINT FOR j = 1 TO 5: sd(j,1)=0: NEXT j INPUT "How many codes are in SET DIM sequence?";sd(1,1) IF sd(1,1)>4 THEN PRINT "Max is 4.":GOTO VIDEOSD FOR j = 1 TO sd(1,1) PRINT "code";j; INPUT ":";sd(j+1,1) NEXT j RETURN VIDEOSB: PRINT FOR j = 1 TO 5: sb(j,1)=0: NEXT j INPUT "How many codes are in SET BRIGHT sequence?";sb(1,1) IF sb(1,1)>4 THEN PRINT "Max is 4.":GOTO VIDEOSB FOR j = 1 TO sb(1,1) PRINT "code";j; INPUT ":";sb(j+1,1) NEXT j RETURN VIDEOCS: PRINT FOR j = 1 TO 5: cs(j,1)=0: NEXT j INPUT "How many in CLEAR TO END OF SCREEN sequence?";cs(1,1) IF cs(1,1)>4 THEN PRINT "Sorry, maximum=4.":GOTO VIDEOCS FOR j = 1 TO cs(1,1) PRINT "code";j; INPUT ":";cs(j+1,1) NEXT j RETURN VIDEOSC: PRINT FOR j = 1 TO 8: sc(j,1)=0: NEXT j INPUT "How many codes in SET CURSOR sequence?";sc(1,1) IF sc(1,1)>7 THEN PRINT "Maximum is 7.":GOTO VIDEOSC IF sc(1,1) = 0 THEN RETURN PRINT "Does column come before row"; GOSUB GETYN IF ans$ = "Y" THEN sc(1,1) = sc(1,1) + 128 PRINT PRINT "Enter any offset that's added to column and row." INPUT "Enter 0 if there's no offset:";os PRINT PRINT "Enter 128 for both row and column below." FOR j = 1 TO sc(1,1) PRINT "code";j; INPUT ":";sc(j+1,1) IF sc(j+1,1) = 128 THEN sc(j+1,1) = 128 + os NEXT j RETURN VIDEOGC: PRINT PRINT "Does your terminal print PC-DOS graphic characters"; GOSUB GETYN IF ans$ = "N" THEN GOTO VIDEOGC2 FOR j = 1 TO 3: gc(j,1)=0: NEXT j INPUT "How many codes in ENTER CHARACTER GRAPHICS sequence?";gc(1,1) IF gc(1,1)>2 THEN PRINT "Sorry, maximum is 2.":GOTO VIDEOGC FOR j = 1 TO gc(1,1) PRINT "code";j; INPUT ":";gc(j+1,1) NEXT j PRINT FOR j = 1 TO 3: ac(j,1)=0: NEXT j INPUT "How many codes in EXIT CHARACTER GRAPHICS sequence?";ac(1,1) IF ac(1,1)>2 THEN PRINT "Sorry, maximum is 2.":GOTO VIDEOGC FOR j = 1 TO ac(1,1) PRINT "code";j; INPUT ":";ac(j+1,1) NEXT j RETURN VIDEOGC2: PRINT PRINT "Enter the decimal code (1-255) that you want" PRINT "to substitute for any graphics characters." INPUT "Enter 0 to pass graphic characters through:";gc(1,1) RETURN VIDEOGP: PRINT FOR j = 1 TO 3: gp(j,1)=0: NEXT j INPUT "Enter character to use for POINT-PLOT graphics:";gp(1,1) FOR j = 1 TO 3: cp(j,1)=0: NEXT j RETURN VIDEOP: PRINT:PRINT PRINT "This is how you set up the terminal:" PRINT PRINT " 1: Manufacuter: ";mfr$(1) PRINT " 2: Model: ";model$(1) PRINT " 3: Number of columns: ";nocols(1) PRINT " 4: Number of rows: ";norows(1) PRINT " 5: Type of terminal: "; IF (vtype(1) AND 1) = 1 THEN PRINT "serial "; IF (vtype(1) AND 4) = 4 THEN PRINT "memory mapped "; IF (vtype(1) AND 8) = 8 THEN PRINT "ANSI"; PRINT PRINT " 6: Insert line sequence: "; FOR j = 1 TO in(1,1):PRINT in(j+1,1);:NEXT j:PRINT PRINT " 7: Delete line sequence: "; FOR j = 1 TO dl(1,1):PRINT dl(j+1,1);:NEXT j:PRINT PRINT " 8: Set intensity to dim: "; FOR j = 1 TO sd(1,1):PRINT sd(j+1,1);:NEXT j:PRINT PRINT " 9: Set intensity bright: "; FOR j = 1 TO sb(1,1):PRINT sb(j+1,1);:NEXT j:PRINT PRINT "10: Clear to end screen: "; FOR j = 1 TO cs(1,1):PRINT cs(j+1,1);:NEXT j:PRINT PRINT "11: Set cursor position: "; t$ = "row" u$ = "column" IF sc(1,1) > 127 THEN \ k = sc(1,1) - 128 :\ t$ = "column" :\ u$ = "row" FOR j = 1 TO sc(1,1) IF sc(j+1,1) > 127 THEN \ PRINT t$; :\ t$ = u$ IF sc(j+1,1) > 128 THEN PRINT "+";sc(j+1,1)-128; IF sc(j+1,1) < 128 THEN PRINT sc(j+1,1); NEXT j PRINT IF gc(1,1) > 4 THEN \ PRINT "12: Graphics character: ";gc(1,1):GOTO VIDEOP2 PRINT "12: Enter graphics mode: "; :\ FOR j = 1 TO gc(1,1) PRINT gc(j+1,1); NEXT j PRINT VIDEOP2: PRINT "13: Point-plot character: ";gp(1,1) PRINT RETURN KEYBOARD: PRINT:PRINT PRINT " Select Keyboard Parameters" PRINT PRINT "Remember to use decimal numbers for ASCII codes." PRINT INPUT "How many keys do you want to define?";nk IF nk > mk THEN \ PRINT:PRINT "Sorry,";mk;"is the limit." :\ GOTO KEYBOARD PRINT INPUT "What is the lead-in code (0 for none)?";leadin PRINT FOR n = 1 TO nk PRINT INPUT "Enter decimal code made by key:";key(1,n) INPUT "Decimal code to send to PC-DOS:";key(2,n) NEXT n PRINT:PRINT "Want to write it into ";serfil$;: GOSUB GETYN IF ans$ = "N" THEN RETURN filnam$ = serfil$ IF END #2 THEN NOTFOUND OPEN serfil$ RECL 128 AS 2 ans$ = chr$(nk) + chr$(leadin) FOR n = 1 TO nk ans$ = ans$ + chr$(key(1,n)) + chr$(key(2,n)) NEXT n PRINT USING "&";#2,8;ans$ CLOSE 2 RETURN PRINTER: REM Install printer parameters. PRINT:PRINT " Printer Installation" PRINT:PRINT "Only baud rate setting is supported at this time." PRINT "Is this what you want to do";: GOSUB GETYN IF ans$ = "N" THEN RETURN GOSUB GETBAUD baudb = sbaud PRINT:PRINT "Want to put baud rate into ";serfil$;: GOSUB GETYN IF ans$ = "N" THEN RETURN filnam$ = serfil$ IF END #2 THEN NOTFOUND OPEN serfil$ RECL 128 AS 2 PRINT USING "&";#2,9;chr$(baudb) CLOSE 2 RETURN GETYN: INPUT " (Y/N)?";ans$ ans$ = LEFT$(ans$,1) ans$ = UCASE$(ans$) RETURN