Skip to content

Latest commit

 

History

History
260 lines (246 loc) · 8.93 KB

sysop2a.pas

File metadata and controls

260 lines (246 loc) · 8.93 KB
 
Nov 18, 2000
Nov 18, 2000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
(*****************************************************************************)
(*> <*)
(*> Telegard Bulletin Board System - Copyright 1988,89,90 by <*)
(*> Eric Oman, Martin Pollard, and Todd Bolitho - All rights reserved. <*)
(*> <*)
(*> Module name: SYSOP2A.PAS <*)
(*> Module purpose: System Configuration "A" command <*)
(*> (Modem Configuration) <*)
(*> <*)
(*****************************************************************************)
{$A+,B+,D-,E+,F+,I+,L+,N-,O+,R-,S+,V-}
unit sysop2a;
interface
uses
crt, dos,
{rcg11172000 no overlay under Linux.}
{overlay,}
cuser,
common;
procedure pomodem;
implementation
const
aresure='Are you sure this is what you want? ';
function wantit:boolean;
begin
nl; wantit:=pynq(aresure);
end;
procedure noch;
begin
print('No change.');
end;
function showmodemstring(s:astr):astr;
var o:astr;
i:integer;
begin
o:='';
for i:=1 to length(s) do
case s[i] of
^@..^L,^N..^[:
o:=o+'^'+chr(ord(s[i])+64);
^M:o:=o+'|';
else
o:=o+s[i];
end;
showmodemstring:=o;
end;
procedure newmodemstring(var vs:astr; what:astr; len:integer);
var i:integer;
changed:boolean;
begin
print('Current modem '+what+' string: "'+showmodemstring(vs)+'"');
nl;
print('Use: "^" preceding control codes (^@..^[)');
print(' "|" for a carriage return');
print(' "~" for a half-second delay');
nl;
print('Enter NEW modem '+what+' string:');
prt(':');
if (len>78) then mpl(78) else mpl(len);
inputwn(vs,len,changed);
if (changed) then begin
for i:=1 to length(vs) do
case vs[i] of
'|':vs[i]:=^M;
'^':if ((i<>length(vs)) and (vs[i+1] in ['@'..'['])) then begin
vs[i]:=chr(ord(vs[i+1])-64);
delete(vs,i+1,1);
end;
end;
end else
noch;
end;
(*
function whatflags:astr;
var s:string[64];
begin
with modemr do begin
if (ctschecking) then s:='CTS check ON, ' else s:='CTS check OFF, ';
if (dsrchecking) then s:=s+'DSR check ON, ' else s:=s+'DSR check OFF, ';
if (usexonxoff) then s:=s+'XON/XOFF ON, ' else s:=s+'XON/XOFF OFF, ';
if (hardwired) then s:=s+'"Hard-wired" carrier' else s:=s+'Normal carrier';
end;
whatflags:=s;
end;
*)
procedure pomodem;
var modemrf:file of modemrec;
s:string[80];
i,c1,c2,cc:integer;
c,ccc:char;
abort,next,done:boolean;
begin
done:=FALSE;
repeat
with modemr do begin
cls;
sprint(#3#5+'Modem configuration');
nl;
abort:=FALSE; next:=FALSE;
printacr('1. Maximum baud rate : '+cstrl(waitbaud),abort,next);
printacr('2. COM port number : '+cstr(comport),abort,next);
printacr('3. Modem initialization string:',abort,next);
printacr(' "'+showmodemstring(init)+'"',abort,next);
printacr('4. Modem answer string : "'+showmodemstring(answer)+'"',abort,next);
printacr('5. Modem hangup string : "'+showmodemstring(hangup)+'"',abort,next);
printacr('6. Modem offhook string : "'+showmodemstring(offhook)+'"',abort,next);
printacr('7. No-call init time : '+cstr(nocallinittime),abort,next);
printacr('A. 9600 ARQ rate baud : '+cstrl(arq9600rate)+' baud',abort,next);
(*
printacr('F. Comm flags: '+whatflags,abort,next);
*)
printacr('F. Force baud rates? : '+syn(not noforcerate),abort,next);
printacr('R. Modem result codes:',abort,next);
printacr(' Case 1 Case 2 (ARQ)',abort,next);
printacr(' R1. NO CARRIER : '+cstr(nocarrier),abort,next);
printacr(' R2. NO DIALTONE: '+cstr(nodialtone),abort,next);
printacr(' R3. BUSY : '+cstr(busy),abort,next);
for i:=0 to 5 do begin
case i of
0:s:=' 300'; 1:s:='1200'; 2:s:='2400';
3:s:='4800'; 4:s:='9600'; 5:s:='19200';
end;
s:=' R'+cstr(i+4)+'. '+s+' BAUD : '+
mn(resultcode[1][i],3)+' '+
mn(resultcode[2][i],3);
printacr(s,abort,next);
end;
nl;
prt('Enter selection or (Q)uit : ');
onek(c,'Q1234567AFR'^M); nl;
case c of
'1':if (incom) then begin
sprint(#3#7+'This can only be changed locally!!@M');
pausescr;
end else begin
print('This is the baud rate that Telegard will use when waiting for calls');
print('at the WFC menu. This should be your modem''s MAXIMUM BAUD RATE.');
nl;
print('The current rate is: '+cstrl(waitbaud)+' baud.');
nl;
print('A:300 B:1200 C:2400 D:4800 E:9600 F:19200 G:38400');
prt('Modem speed? (A-G) : '); onek(ccc,'QABCDEFG'^M);
if (ccc in ['A'..'G']) then
case ccc of
'A':waitbaud:=300;
'B':waitbaud:=1200;
'C':waitbaud:=2400;
'D':waitbaud:=4800;
'E':waitbaud:=9600;
'F':waitbaud:=19200;
'G':waitbaud:=38400;
end;
end;
'2':if (incom) then begin
sprint(#3#7+'This can only be changed locally!!@M');
pausescr;
end else begin
prt('Com port (1-4)? '); inu(cc);
if (cc in [1..4]) then
if (wantit) then begin
remove_port;
comport:=cc;
iport;
end
else noch;
end;
'3':newmodemstring(init,'init',80);
'4':newmodemstring(answer,'answer',40);
'5':newmodemstring(hangup,'hangup',40);
'6':newmodemstring(offhook,'offhook',40);
'7':begin
prt('No call modem re-initialization: '); inu(c1);
if (not badini) then nocallinittime:=c1;
end;
'A':begin
print('This is the baud rate Telegard will USE between Telegard and your');
print('modem when a 9600 ARQ result code is received. Note that in most');
print('9600+ modems, the rate is 19,200 baud. Some even newer modems');
print('support 38,400 baud. OLDER modems (very old ones) only support 9600');
print('baud. CONSULT YOUR MODEM MANUAL, and make the best choice!');
nl;
print('The current rate is: '+cstrl(arq9600rate)+' baud.');
nl;
print('Valid SUPPORTED rates are 9600, 19200, and 38400 bauds.');
nl;
prt('(A):9600 (B):19200 (C):38400 or (Q)uit : ');
onek(ccc,'QABC'^M);
if (ccc in ['A'..'C']) then
case ccc of
'A':arq9600rate:=9600;
'B':arq9600rate:=19200;
'C':arq9600rate:=38400;
end;
end;
(*
'F':begin
print('These are communications flags used by Telegard.');
print('Do NOT change them unless you are having problems with');
print('your *current* setup, and you KNOW what you are doing!');
nl;
print('Current flag setup: '+whatflags);
nl;
print('(C)TS checking, (D)SR checking,');
print('(X)ON/XOFF, (H)ard-wired carrier');
nl;
prt('Which flag: '); onek(c,'QCDHX'^M);
case c of
'C':ctschecking:=not ctschecking;
'D':dsrchecking:=not dsrchecking;
'H':hardwired:=not hardwired;
'X':usexonxoff:=not usexonxoff;
end;
c:=#0;
end;
*)
'F':noforcerate:=not noforcerate;
'R':begin
prt('Which result code? '); onek(ccc,'Q123456789');
cc:=ord(ccc)-48;
if (cc in [1..9]) then begin
if (cc in [1..3]) then begin
prt('Enter new result code: '); inu(c1);
if not badini then
if wantit then
case cc of
1:nocarrier:=c1;
2:nodialtone:=c1;
3:busy:=c1;
end
else noch;
end else begin
prt('Enter case 1 result code: '); inu(c1);
if (not badini) then resultcode[1][cc-4]:=c1;
prt('Enter case 2 result code: '); inu(c2);
if (not badini) then resultcode[2][cc-4]:=c2;
end;
end;
end;
'Q':done:=TRUE;
end;
end;
until ((done) or (hangup));
assign(modemrf,systat.gfilepath+'modem.dat');
reset(modemrf); seek(modemrf,0); write(modemrf,modemr); close(modemrf);
end;
end.