home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol130 / cnfg1.bas < prev    next >
Encoding:
BASIC Source File  |  1984-04-29  |  7.8 KB  |  224 lines

  1. 1 ' signon subsystem -- Subsystem Configurator overlay 1
  2. 5 '    by dick lieber
  3. 6 DIM TEXTFILE$(8)
  4. 7 DIM ACLARRAY%(6,11)
  5. 9 %INCLUDE CONFIG.CMN
  6. 30 OVRVERSION$="1.4 {10/14/82}"    'not in release 1.0
  7. 31 PWDFILE$="pwds"
  8. 32 BSTRING$=CHR$(8)+" "+CHR$(8)
  9. 33 DEFDRIVE$="A:"
  10. 34 CONFIGFILE$="CONFIG"
  11. 69 '
  12. 74 DIM PARAPROMPT$(6)
  13. 75 '
  14. 77 ON ERROR GOTO 1000
  15. 129 CRLF$=CHR$(&HA)+CHR$(&HD)
  16. 130 '    on-off function
  17. 131 DIM ONOFF$(1)
  18. 132 ONOFF$(0)="Off"
  19. 133 ONOFF$(1)="On "    '    #
  20. 134 DEF FNONOFF$(ONOFF%)=ONOFF$(ONOFF%)
  21. 135 DEF FNLINES$(NLINES%)=STRING$(NLINES%,CRLF$)
  22. 136 DEF FNMAKEHEX$(S$,POINTER%,SIZE%)=
  23.     RIGHT$("0000"+HEX$(ASC(MID$(S$,POINTER%))), SIZE%)+"H "
  24. 137 DEF FNDISPHEX$(X%)=RIGHT$("00"+HEX$(X%),2)+"H "
  25. 399 GOTO 10000
  26. 400 %INCLUDE 400500.SSB
  27. 1000 '
  28. 1005 '    Error handler
  29. 1010 ' 1.5
  30. 1015 A$="Error Trap":CR%=2: GOSUB 400
  31. 1031 IF ERR=53 THEN NOFILE%=1:RESUME NEXT
  32. 1032 IF ERR=62 THEN RESUME NEXT
  33. 1040 ON ERROR GOTO 0
  34. 3000 '
  35. 3007 '    convert hex or decimal string to single variable
  36. 3014 '    ANSWER$ => ANSWER (0-0FFFFH)
  37. 3021 ' 1.1    #
  38. 3028 ANSWER=0
  39. 3035 IF RIGHT$(ANSWER$,1)<>"H" THEN ANSWER=VAL(ANSWER$): GOTO 3091
  40. 3042 ANSWER$=LEFT$(ANSWER$,LEN(ANSWER$)-1)
  41. 3049 FOR INDEX%=1 TO LEN(ANSWER$)
  42. 3056    PIXIE$=MID$(ANSWER$,(LEN(ANSWER$)-INDEX%+1),1)
  43. 3063    IF PIXIE$ => "A" THEN PIXIE$="1"+CHR$(&H30+(ASC(PIXIE$)-&H41))
  44. 3070    NUMBER=VAL(PIXIE$) * 16 ^ (INDEX%-1)
  45. 3077    ANSWER=ANSWER+NUMBER
  46. 3084 NEXT INDEX%
  47. 3091 IF ANSWER > 65535! THEN ANSWER=0
  48. 3092 IF ANSWER > 32768! THEN ANSWER = ANSWER - 65536!
  49. 3098 RETURN
  50. 3100 '
  51. 3105 '    clear screen
  52. 3110 '
  53. 3115 A$=CLEARSCR$:CR%=1:GOSUB 400: RETURN
  54. 3300 '
  55. 3305 '    get a single letter -- change to selection # fo menus etc.
  56. 3310 '
  57. 3315 MAX%=0:GOSUB 500
  58. 3320 IF ANSWER$="" THEN SELECTION%=0: RETURN
  59. 3325 SELECTION%=ASC(ANSWER$)-64
  60. 3327 IF SELECTION% < 0 THEN SELECTION%=0
  61. 3330 RETURN
  62. 4700 '
  63. 4705 '    pause 
  64. 4710 '
  65. 4715 PRINT TAB(25);
  66. 4720 LINE INPUT "Press RETURN to continue."; A$
  67. 4725 RETURN
  68. 7900 '
  69. 7901 '    hardware dependent paramaters
  70. 7902 '1.2    #
  71. 7903 GOSUB 3100: PRINT: PRINT TAB(30);"Hardware Dependency Options"
  72. 7904 PRINT:PRINT
  73. 7905 PRINT TAB(20);"a        Poke access level into RAM: ";
  74.     FNONOFF$(RAMPOKE%)
  75. 7906 PRINT TAB(20);"b   Allow user to set modem options: ";
  76.     FNONOFF$(MODEMCTLOPT%)
  77. 7907 PRINT TAB(20);"c  Restrict option for ZCPR (WHEEL): ";
  78.     FNONOFF$(WHEELOPTION%)
  79. 7908 PRINT TAB(20);"d                Modem control port: ";
  80.     HEX$(MODEMPORT%);"H"
  81. 7909 PRINT TAB(20);"e         Value to disconnect modem: ";
  82.     HEX$(DISCONNECT%);"H"
  83. 7910 PRINT TAB(20);"f Show caller's name on status line: ";
  84.     FNONOFF$(STATUSLINE%)
  85. 7911 PRINT:PRINT TAB(20);"Type letter of your choice, RETURN for main menu > ";
  86. 7912 GOSUB 3300
  87. 7913 IF SELECTION%=0 THEN RETURN
  88. 7914 ON SELECTION% GOSUB 7917,7928,7929,7953,7957,8100
  89. 7915 CHANGED%=CHANGED%+1
  90. 7916 GOTO 7900
  91. 7917 GOSUB 3100: PRINT:PRINT TAB(20);
  92.     "a    Poke access level into RAM: ";FNONOFF$(RAMPOKE%):
  93.     PRINT:PRINT TAB(20);"B    ADDRESS TO POKE (3FH STANDARD): ";
  94.     HEX$(RAMPOKEADDRESS%);"H"
  95. 7918 PRINT:PRINT TAB(20);
  96.     "Press letter of your choice or RETURN for last menu > ";
  97. 7919 GOSUB 3300
  98. 7920 IF SELECTION%=0 THEN RETURN
  99. 7921 IF SELECTION%=1 THEN IF RAMPOKE%=0 THEN RAMPOKE%=1 ELSE RAMPOKE%=0
  100. 7922 IF SELECTION% <> 2 THEN GOTO 7917
  101. 7923 PRINT:PRINT:PRINT
  102.     TAB(15);"Type address to poke access level into (decimal or hex) > ";
  103. 7924 MAX%=5: GOSUB 500
  104. 7925 IF NKEY%=0 THEN RETURN
  105. 7926 GOSUB 3000: RAMPOKEADDRESS%=ANSWER
  106. 7927 GOTO 7917
  107. 7928 MODEMCTLOPT%=MODEMCTLOPT% XOR 1: RETURN
  108. 7929 GOSUB 3100:
  109.     PRINT:PRINT TAB(20);"a           ZCPR Restrict mode (WHEEL): ";
  110.     FNONOFF$(WHEELOPTION%)
  111. 7930 IF WHEELOPTION% <> 0 THEN
  112.     PRINT:PRINT TAB(20);"b            Address of WHEEL byte: ";HEX$(WHEEL%);"H":
  113.     PRINT:PRINT TAB(20);"c       WHEEL value for user 15 access: ";
  114.     HEX$(RESTRICT%);"H":
  115. 7931 IF WHEELOPTION% <> 0 THEN
  116.     PRINT:PRINT TAB(20);"d    WHEEL value for no user 15 access: ";
  117.     HEX$(UNRESTRICT%);"H"
  118. 7932 PRINT: PRINT TAB(20);"Type letter of your selection > ";
  119. 7933 GOSUB 3300
  120. 7934 IF SELECTION%=0 THEN RETURN
  121. 7935 IF SELECTION% > 1 AND WHEELOPTION% =0 THEN GOTO 7929
  122. 7936 ON SELECTION% GOSUB 7938, 7939, 7943, 7948
  123. 7937 GOTO 7929
  124. 7938 WHEELOPTION%= WHEELOPTION% XOR 1: IF WHEELOPTION% > 1 THEN WHEELOPTION%=0: RETURN ELSE RETURN
  125. 7939 PRINT:PRINT TAB(20);" New location of WHEEL byte > ";
  126. 7940 MAX%=5: GOSUB 500
  127. 7941 IF NKEY%=0 THEN RETURN
  128. 7942 GOSUB 3000: WHEEL%=ANSWER: RETURN
  129. 7943 PRINT:PRINT TAB(20);"This value gets plugged into WHEEL"
  130. 7944 PRINT TAB(20);"to allow access to user 15  > ";
  131. 7945 MAX%=2: GOSUB 500
  132. 7946 IF NKEY%=0 THEN RETURN
  133. 7947 GOSUB 3000: RESTRICT%=ANSWER: RETURN
  134. 7948 PRINT:PRINT TAB(20);"This value gets plugged into WHEEL"
  135. 7949 PRINT; TAB(20);"to turn off access to user 15 (usually 0) > ";
  136. 7950 MAX%=2: GOSUB 500
  137. 7951 IF NKEY%=0 THEN RETURN
  138. 7952 GOSUB 3000: UNRESTRICT%=ANSWER: RETURN
  139. 7953 PRINT: PRINT TAB(20);
  140.     "Port that allows disconnecting modem > ";
  141. 7954 MAX%=3: GOSUB 500
  142. 7955 IF NKEY%=0 THEN RETURN
  143. 7956 GOSUB 3000: MODEMPORT%=ANSWER: RETURN
  144. 7957 PRINT: PRINT TAB(20);
  145.     "Value of byte that will disconnect modem > ";
  146. 7958 MAX%=3: GOSUB 500
  147. 7959 IF NKEY%=0 THEN RETURN
  148. 7960 GOSUB 3000: DISCONNECT%=ANSWER: RETURN
  149. 8100 '    terminal status line parameters
  150. 8101 ' 1.0
  151. 8102 GOSUB 3100
  152. 8103 PRINT:PRINT TAB(30);"Terminal Status Line Options"
  153. 8104 PRINT:PRINT
  154. 8105 PRINT TAB(10);"a    Show name on terminal status line: ";
  155.     FNONOFF$(STATUSLINE%)
  156. 8106 IF STATUSLINE%=0 THEN GOTO 8119
  157. 8107 PRINT TAB(10);"b        Maximum length of status line:"; STATLEN%
  158. 8108 PRINT TAB(10);"c         String to access status line: ";
  159. 8109 FOR INDEX%=1 TO LEN(STATINIT$)-1:
  160.     PRINT FNMAKEHEX$(STATINIT$,INDEX%,2);:
  161.     NEXT INDEX%
  162. 8110 PRINT TAB(10);"d  String to end access to status line: ";
  163. 8111 FOR INDEX%=1 TO LEN(STATEND$)-1:
  164.     PRINT FNMAKEHEX$(STATEND$,INDEX%,2);:
  165.     NEXT INDEX%
  166. 8112 PRINT TAB(10);"e       String to turn off status line: ";
  167. 8113 FOR INDEX%=1 TO LEN(STATQUIT$)-1:
  168.     PRINT FNMAKEHEX$(STATQUIT$,INDEX%,2);:
  169.     NEXT INDEX%
  170. 8114 PRINT TAB(10);"f                            Data Port: "; FNDISPHEX$(STATDATA%)
  171. 8115 PRINT TAB(10);"g                          Status Port: ";
  172.     FNDISPHEX$(STATSTATUS%)
  173. 8116 PRINT TAB(10);"h                       Transmit Ready: "; FNDISPHEX$(STATRDY%)
  174. 8117 PRINT TAB(10);"i                  Bit = one for ready: ";
  175.     FNONOFF$(STATPOLARITY%)
  176. 8118 PRINT TAB(10);"Select letter > ";
  177. 8119 GOSUB 3300
  178. 8120 IF SELECTION%=0 THEN RETURN
  179. 8121 ON SELECTION% GOSUB 8123,8125,8130,8136,8141,8147,8151,8155,8159
  180. 8122 GOTO 8100
  181. 8123 '
  182. 8124 STATUSLINE%= 1 XOR STATUSLINE%: RETURN
  183. 8125 PRINT:PRINT TAB(20);"Width of status line. > ";
  184. 8127 MAX%=2: GOSUB 500
  185. 8128 IF NKEY%<>0 THEN STATLEN%=VAL(ANSWER$)
  186. 8129 RETURN
  187. 8130 PRINT:PRINT TAB(20);"Type the character string used to access"
  188. 8131 PRINT TAB(20);"the terminal status line. > ";
  189. 8133 KEEPLOWER%=1: MAX%=20: CTRLOK%=1: GOSUB 500
  190. 8134 IF NKEY%<>0 THEN STATINIT$=ANSWER$+"~"
  191. 8135 RETURN
  192. 8136 PRINT:PRINT TAB(20);"Type the string that returns your"
  193. 8137 PRINT TAB(20);"terminal to normal mode. > ";
  194. 8138 KEEPLOWER%=1: MAX%=20: CTRLOK%=1: GOSUB 500
  195. 8139 IF NKEY%<>0 THEN STATEND$=ANSWER$+"~"
  196. 8140 RETURN
  197. 8141 PRINT:PRINT TAB(20);"Type the optional character string that"
  198. 8142 PRINT TAB(20);"will turn off the status line. > ";
  199. 8144 KEEPLOWER%=1: MAX%=20: CTRLOK%=1: GOSUB 500
  200. 8145 IF NKEY%<>0 THEN STATQUIT$=ANSWER$+"~"
  201. 8146 RETURN
  202. 8147 PRINT TAB(20);"Data Port > ";
  203. 8148 MAX%=3: GOSUB 500
  204. 8149 IF NKEY%<>0 THEN GOSUB 3000: STATDATA%=ANSWER
  205. 8150 RETURN
  206. 8151 PRINT: PRINT TAB(20);"Status port > ";
  207. 8152 MAX%=3: GOSUB 500
  208. 8153 IF NKEY%<>0 THEN GOSUB 3000: STATSTATUS%=ANSWER
  209. 8154 RETURN
  210. 8155 PRINT: PRINT TAB(20);"Value of bit to test for ready. > ";
  211. 8156 MAX%=3: GOSUB 500
  212. 8157 IF NKEY%<>0 THEN GOSUB 3000: STATRDY%=ANSWER
  213. 8158 RETURN
  214. 8159 STATPOLARITY%=STATPOLARITY% XOR 1: RETURN
  215. 10000 '
  216. 10010 '    main program starts here
  217. 10020 ' 1.1
  218. 10080 GOSUB 7900
  219. 10095 GOSUB 3100
  220. 10096 PRINT FNLINES$(10);TAB(20);"Please wait."
  221. 10097 CHAIN MGRDRIVE$+CONFIGFILE$
  222. 10100 PRINT "Cannot find ";MGRDRIVE$+CONFIGFILE$;"."
  223. 20000 ' end
  224.