1 ' signon subsystem -- Subsystem Configurator overlay 1
5 '	by dick lieber
6 DIM TEXTFILE$(8)
7 DIM ACLARRAY%(6,11)
9 %INCLUDE CONFIG.CMN
30 OVRVERSION$="1.4 {10/14/82}"	'not in release 1.0
31 PWDFILE$="pwds"
32 BSTRING$=CHR$(8)+" "+CHR$(8)
33 DEFDRIVE$="A:"
34 CONFIGFILE$="CONFIG"
69 '
74 DIM PARAPROMPT$(6)
75 '
77 ON ERROR GOTO 1000
129 CRLF$=CHR$(&HA)+CHR$(&HD)
130 '	on-off function
131 DIM ONOFF$(1)
132 ONOFF$(0)="Off"
133 ONOFF$(1)="On "	'	#
134 DEF FNONOFF$(ONOFF%)=ONOFF$(ONOFF%)
135 DEF FNLINES$(NLINES%)=STRING$(NLINES%,CRLF$)
136 DEF FNMAKEHEX$(S$,POINTER%,SIZE%)=

	RIGHT$("0000"+HEX$(ASC(MID$(S$,POINTER%))), SIZE%)+"H "
137 DEF FNDISPHEX$(X%)=RIGHT$("00"+HEX$(X%),2)+"H "
399 GOTO 10000
400 %INCLUDE 400500.SSB
1000 '
1005 '	Error handler
1010 ' 1.5
1015 A$="Error Trap":CR%=2: GOSUB 400
1031 IF ERR=53 THEN NOFILE%=1:RESUME NEXT
1032 IF ERR=62 THEN RESUME NEXT
1040 ON ERROR GOTO 0
3000 '
3007 '	convert hex or decimal string to single variable
3014 '	ANSWER$ => ANSWER (0-0FFFFH)
3021 ' 1.1	#
3028 ANSWER=0
3035 IF RIGHT$(ANSWER$,1)<>"H" THEN ANSWER=VAL(ANSWER$): GOTO 3091
3042 ANSWER$=LEFT$(ANSWER$,LEN(ANSWER$)-1)
3049 FOR INDEX%=1 TO LEN(ANSWER$)
3056	PIXIE$=MID$(ANSWER$,(LEN(ANSWER$)-INDEX%+1),1)
3063	IF PIXIE$ => "A" THEN PIXIE$="1"+CHR$(&H30+(ASC(PIXIE$)-&H41))
3070	NUMBER=VAL(PIXIE$) * 16 ^ (INDEX%-1)
3077	ANSWER=ANSWER+NUMBER
3084 NEXT INDEX%
3091 IF ANSWER > 65535! THEN ANSWER=0
3092 IF ANSWER > 32768! THEN ANSWER = ANSWER - 65536!
3098 RETURN
3100 '
3105 '	clear screen
3110 '
3115 A$=CLEARSCR$:CR%=1:GOSUB 400: RETURN
3300 '
3305 '	get a single letter -- change to selection # fo menus etc.
3310 '
3315 MAX%=0:GOSUB 500
3320 IF ANSWER$="" THEN SELECTION%=0: RETURN
3325 SELECTION%=ASC(ANSWER$)-64
3327 IF SELECTION% < 0 THEN SELECTION%=0
3330 RETURN
4700 '
4705 '	pause 
4710 '
4715 PRINT TAB(25);
4720 LINE INPUT "Press RETURN to continue."; A$
4725 RETURN
7900 '
7901 '	hardware dependent paramaters
7902 '1.2	#
7903 GOSUB 3100: PRINT: PRINT TAB(30);"Hardware Dependency Options"
7904 PRINT:PRINT
7905 PRINT TAB(20);"a        Poke access level into RAM: ";

	FNONOFF$(RAMPOKE%)
7906 PRINT TAB(20);"b   Allow user to set modem options: ";

	FNONOFF$(MODEMCTLOPT%)
7907 PRINT TAB(20);"c  Restrict option for ZCPR (WHEEL): ";

	FNONOFF$(WHEELOPTION%)
7908 PRINT TAB(20);"d                Modem control port: ";

	HEX$(MODEMPORT%);"H"
7909 PRINT TAB(20);"e         Value to disconnect modem: ";

	HEX$(DISCONNECT%);"H"
7910 PRINT TAB(20);"f Show caller's name on status line: ";

	FNONOFF$(STATUSLINE%)
7911 PRINT:PRINT TAB(20);"Type letter of your choice, RETURN for main menu > ";
7912 GOSUB 3300
7913 IF SELECTION%=0 THEN RETURN
7914 ON SELECTION% GOSUB 7917,7928,7929,7953,7957,8100
7915 CHANGED%=CHANGED%+1
7916 GOTO 7900
7917 GOSUB 3100: PRINT:PRINT TAB(20);

	"a	Poke access level into RAM: ";FNONOFF$(RAMPOKE%):

	PRINT:PRINT TAB(20);"B	ADDRESS TO POKE (3FH STANDARD): ";

	HEX$(RAMPOKEADDRESS%);"H"
7918 PRINT:PRINT TAB(20);

	"Press letter of your choice or RETURN for last menu > ";
7919 GOSUB 3300
7920 IF SELECTION%=0 THEN RETURN
7921 IF SELECTION%=1 THEN IF RAMPOKE%=0 THEN RAMPOKE%=1 ELSE RAMPOKE%=0
7922 IF SELECTION% <> 2 THEN GOTO 7917
7923 PRINT:PRINT:PRINT

	TAB(15);"Type address to poke access level into (decimal or hex) > ";
7924 MAX%=5: GOSUB 500
7925 IF NKEY%=0 THEN RETURN
7926 GOSUB 3000: RAMPOKEADDRESS%=ANSWER
7927 GOTO 7917
7928 MODEMCTLOPT%=MODEMCTLOPT% XOR 1: RETURN
7929 GOSUB 3100:

	PRINT:PRINT TAB(20);"a	       ZCPR Restrict mode (WHEEL): ";

	FNONOFF$(WHEELOPTION%)
7930 IF WHEELOPTION% <> 0 THEN

	PRINT:PRINT TAB(20);"b		    Address of WHEEL byte: ";HEX$(WHEEL%);"H":

	PRINT:PRINT TAB(20);"c	   WHEEL value for user 15 access: ";

	HEX$(RESTRICT%);"H":
7931 IF WHEELOPTION% <> 0 THEN

	PRINT:PRINT TAB(20);"d	WHEEL value for no user 15 access: ";

	HEX$(UNRESTRICT%);"H"
7932 PRINT: PRINT TAB(20);"Type letter of your selection > ";
7933 GOSUB 3300
7934 IF SELECTION%=0 THEN RETURN
7935 IF SELECTION% > 1 AND WHEELOPTION% =0 THEN GOTO 7929
7936 ON SELECTION% GOSUB 7938, 7939, 7943, 7948
7937 GOTO 7929
7938 WHEELOPTION%= WHEELOPTION% XOR 1: IF WHEELOPTION% > 1 THEN WHEELOPTION%=0: RETURN ELSE RETURN
7939 PRINT:PRINT TAB(20);" New location of WHEEL byte > ";
7940 MAX%=5: GOSUB 500
7941 IF NKEY%=0 THEN RETURN
7942 GOSUB 3000: WHEEL%=ANSWER: RETURN
7943 PRINT:PRINT TAB(20);"This value gets plugged into WHEEL"
7944 PRINT TAB(20);"to allow access to user 15  > ";
7945 MAX%=2: GOSUB 500
7946 IF NKEY%=0 THEN RETURN
7947 GOSUB 3000: RESTRICT%=ANSWER: RETURN
7948 PRINT:PRINT TAB(20);"This value gets plugged into WHEEL"
7949 PRINT; TAB(20);"to turn off access to user 15 (usually 0) > ";
7950 MAX%=2: GOSUB 500
7951 IF NKEY%=0 THEN RETURN
7952 GOSUB 3000: UNRESTRICT%=ANSWER: RETURN
7953 PRINT: PRINT TAB(20);

	"Port that allows disconnecting modem > ";
7954 MAX%=3: GOSUB 500
7955 IF NKEY%=0 THEN RETURN
7956 GOSUB 3000: MODEMPORT%=ANSWER: RETURN
7957 PRINT: PRINT TAB(20);

	"Value of byte that will disconnect modem > ";
7958 MAX%=3: GOSUB 500
7959 IF NKEY%=0 THEN RETURN
7960 GOSUB 3000: DISCONNECT%=ANSWER: RETURN
8100 '	terminal status line parameters
8101 ' 1.0
8102 GOSUB 3100
8103 PRINT:PRINT TAB(30);"Terminal Status Line Options"
8104 PRINT:PRINT
8105 PRINT TAB(10);"a    Show name on terminal status line: ";

	FNONOFF$(STATUSLINE%)
8106 IF STATUSLINE%=0 THEN GOTO 8119
8107 PRINT TAB(10);"b        Maximum length of status line:"; STATLEN%
8108 PRINT TAB(10);"c         String to access status line: ";
8109 FOR INDEX%=1 TO LEN(STATINIT$)-1:

	PRINT FNMAKEHEX$(STATINIT$,INDEX%,2);:

	NEXT INDEX%
8110 PRINT TAB(10);"d  String to end access to status line: ";
8111 FOR INDEX%=1 TO LEN(STATEND$)-1:

	PRINT FNMAKEHEX$(STATEND$,INDEX%,2);:

	NEXT INDEX%
8112 PRINT TAB(10);"e       String to turn off status line: ";
8113 FOR INDEX%=1 TO LEN(STATQUIT$)-1:

	PRINT FNMAKEHEX$(STATQUIT$,INDEX%,2);:

	NEXT INDEX%
8114 PRINT TAB(10);"f                            Data Port: "; FNDISPHEX$(STATDATA%)
8115 PRINT TAB(10);"g                          Status Port: ";

	FNDISPHEX$(STATSTATUS%)
8116 PRINT TAB(10);"h                       Transmit Ready: "; FNDISPHEX$(STATRDY%)
8117 PRINT TAB(10);"i                  Bit = one for ready: ";

	FNONOFF$(STATPOLARITY%)
8118 PRINT TAB(10);"Select letter > ";
8119 GOSUB 3300
8120 IF SELECTION%=0 THEN RETURN
8121 ON SELECTION% GOSUB 8123,8125,8130,8136,8141,8147,8151,8155,8159
8122 GOTO 8100
8123 '
8124 STATUSLINE%= 1 XOR STATUSLINE%: RETURN
8125 PRINT:PRINT TAB(20);"Width of status line. > ";
8127 MAX%=2: GOSUB 500
8128 IF NKEY%<>0 THEN STATLEN%=VAL(ANSWER$)
8129 RETURN
8130 PRINT:PRINT TAB(20);"Type the character string used to access"
8131 PRINT TAB(20);"the terminal status line. > ";
8133 KEEPLOWER%=1: MAX%=20: CTRLOK%=1: GOSUB 500
8134 IF NKEY%<>0 THEN STATINIT$=ANSWER$+"~"
8135 RETURN
8136 PRINT:PRINT TAB(20);"Type the string that returns your"
8137 PRINT TAB(20);"terminal to normal mode. > ";
8138 KEEPLOWER%=1: MAX%=20: CTRLOK%=1: GOSUB 500
8139 IF NKEY%<>0 THEN STATEND$=ANSWER$+"~"
8140 RETURN
8141 PRINT:PRINT TAB(20);"Type the optional character string that"
8142 PRINT TAB(20);"will turn off the status line. > ";
8144 KEEPLOWER%=1: MAX%=20: CTRLOK%=1: GOSUB 500
8145 IF NKEY%<>0 THEN STATQUIT$=ANSWER$+"~"
8146 RETURN
8147 PRINT TAB(20);"Data Port > ";
8148 MAX%=3: GOSUB 500
8149 IF NKEY%<>0 THEN GOSUB 3000: STATDATA%=ANSWER
8150 RETURN
8151 PRINT: PRINT TAB(20);"Status port > ";
8152 MAX%=3: GOSUB 500
8153 IF NKEY%<>0 THEN GOSUB 3000: STATSTATUS%=ANSWER
8154 RETURN
8155 PRINT: PRINT TAB(20);"Value of bit to test for ready. > ";
8156 MAX%=3: GOSUB 500
8157 IF NKEY%<>0 THEN GOSUB 3000: STATRDY%=ANSWER
8158 RETURN
8159 STATPOLARITY%=STATPOLARITY% XOR 1: RETURN
10000 '
10010 '	main program starts here
10020 ' 1.1
10080 GOSUB 7900
10095 GOSUB 3100
10096 PRINT FNLINES$(10);TAB(20);"Please wait."
10097 CHAIN MGRDRIVE$+CONFIGFILE$
10100 PRINT "Cannot find ";MGRDRIVE$+CONFIGFILE$;"."
20000 ' end
