home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-386-Vol-2of3.iso
/
c
/
ctkit11.zip
/
BBSENDU.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-12-15
|
24KB
|
1,148 lines
Unit BBSEndU;
interface
uses
Async2, dos, crt, ctgraph,ctu, graph;
const
Version = '0.0';
Rev = 'A'; {revision code, for compatibility checking}
Esc = #27;
EndChar = #255;
OK = #1;
NOTOK = #2;
NulCh = #0;
AltX = Chr(45);
AltC = Chr(46);
AltF = Chr(33);
Alpha = ['A'..'Z','0'..'9','a'..'z','.',':'];
InitCode = Esc+#236;
var
f: text;
ComStr: string;
lastpress, TrueUK, Tlim: longint;
lastd, WaitMin, BaudRate, ComPort, FillPat, FillCol, UserNum: word;
stringing, SysAllowed, ModemOn, Local, DoTimeCheck, CTOn, SoundOn: boolean;
StrungStr, PName, BBSName, DataDir: string;
TrueSL, BkCol, FgCol: byte;
TrueGold: real;
DLim: word;
Function KeyPressed: boolean;
Function KeyCheck: boolean;
Procedure MakeTime (var T: longint; var D: word);
Procedure SendStr(s: string);
Procedure SendLine(s: string);
Procedure ExitProg;
Function WaitForChar: char;
Procedure RdLn (var s; l: byte);
Procedure Initialize;
Procedure SendCommand (R: byte; ComStr, ExStr: string);
Procedure PutPic(num: byte; x, y: word; how: byte);
Procedure LoadPic(num: byte; place, length: word; fn: string);
Procedure DoText(x, y: word; tx: string);
Procedure GrInfo(var gd, gm: word);
Procedure InitGr(d, m: word);
Procedure ScreenPage (apage, vpage: byte);
Procedure DoLine (x1, y1, x2, y2: word; color: byte);
Procedure DoCircle (x, y, rad: word; color: byte);
Procedure DoRect (x1, y1, x2, y2: word; color: byte);
Function TestResp: boolean;
Function MemFree: longint;
Procedure LeaveCT;
Procedure ClearScr;
Procedure SetCol (fore, back: byte);
Procedure InLineXY (len: byte; x, y: word; var thestring: string);
Procedure FillStyle (pattern, color: word);
Procedure GetPic (num: byte; x1, y1, x2, y2: word);
Procedure DefSeries (Ser, Step, Command, ExNum: byte; StrStr: string);
Procedure DoSeries (Ser: byte);
Procedure DefExStr (num: byte; exstr: string);
Procedure SetGD(gd: byte);
Procedure LoadSong (SongNum: byte; Place: word; FN: string);
Procedure DoSong (SongNum: byte);
Procedure DefAnim (Flm, Frame, PicN: byte; pause, x, y: word; Way: byte);
Procedure ShowAnim (Flm: byte; AuxX, AuxY: word);
Procedure TextStyle (Size, font: word);
Procedure FillCircle (x, y, rad: word);
Procedure FillBar (x1, y1, x2, y2: word);
Procedure FillFlood (x, y: word; BorderCol: byte);
Procedure DefNote (Song, Note, l, n, o: byte);
Procedure ChPalette(ColorNum: word; Color: shortint);
Procedure DoArc (x, y, stangle, endangle, rad: word);
Procedure VirtWind (x1, y1, x2, y2: word; Clip: boolean);
Procedure HighLight (x1, y1, x2, y2: word);
Procedure UnHighLight;
Procedure DefScroll (x1, y1, x2, y2, scramt: word);
Procedure ScrollUp;
Procedure ScrollDown;
Procedure SetFg (fore: byte);
{ To do:
???
}
implementation
const
maxmemused = 31043;
type
Images = array[1..MaxMemUsed] of word;
ColType = Array [0..3] of boolean;
CDType = array[1..2] of integer;
TPicType = array[1..15000] of word;
SeriesType = record
r, ExNum: byte;
ComStr: string[10];
end;
AnimType = record
PicN, Way: byte;
x, y, pause: word;
end;
var
sysoff, SpaceP: boolean;
x1, y1, x2, y2, ndex: word;
MemUsed: longint;
CurCom, Bad: byte;
PicFile: file;
t1, t2, SysEnd: byte;
redstr: string;
Memty: longint;
Function Keypressed: boolean;
var
regs: registers;
begin
Regs.AH := $0B;
Intr($21,Regs);
keypressed := (Regs.AL = 255);
end;
Function KeyCheck: boolean;
begin
KeyCheck := ((modemOn) and (Async_Buffer_Check)) or ((KeyPressed) and (Not sysoff) and (SysAllowed));
end;
Procedure MakeTime (var T: longint; var D: word);
var
s1, s2, hh, mm: word;
begin
GetDate (s1,s2,hh,D);
GetTime (hh,mm,s1,s2);
T := mm+hh*60+D*60*24;
end;
Procedure SendStr(s: string);
var
X: byte;
begin
if sysallowed then
begin
if grmode then
begin
for x := 1 to length(s) do
if s[x] = #8 then
begin
MoveTo(GetX-TextWidth('X'),GetY);
SetFillStyle (1,Fill2);
Bar (GetX,GetY,GetX+TextWidth('X'),GetY+TextHeight('X'));
SetFillStyle (Fill1,Fill2);
end else begin
OutText(s[x]);
end;
end else
Write (s);
end;
if modemon then
for x := 1 to Length(s) do
Async_send(s[x]);
end;
Procedure SendLine(s: string);
var
X: byte;
begin
SendStr(s);
if modemon then
begin
Async_send(^M);
Async_Send(#10);
end;
if SysAllowed then
begin
if grmode then
MoveTo (0,Gety+textHeight('X')+2)
else
Writeln;
end;
end;
Procedure ExitProg;
begin
Async_Close;
halt;
end;
FUNCTION WaitForChar : CHAR;
VAR
CurD: WORD;
CurT: longint;
ch, tc: char;
tb, FunkyLocal, KeyLocal: boolean;
BEGIN
maketime (LastPress, LastD);
REPEAT
maketime (curt, curd);
if (modemon) and (SysEnd > 0) and (KeyPressed) then
begin
if not(async_buffer_check) then
Async_Send(ReadKey);
if sysend = 1 then
SysEnd := 0;
end;
if ((CurD >= LastD) and (CurT > LastPress + WaitMin + 1)) or
(DoTimeCheck and (CurT > TLim+WaitMin) and (CurD >= DLim)) then
begin
DoCode (5,#0+#0,'');
SendLine ('Out of time. Aborting program.');
ExitProg;
end;
if (modemon) and (not async_carrierdetect) then
begin
Writeln ('NO CARRIER');
Writeln ('Aborting...');
halt;
end;
if (sysoff or (Not SysAllowed)) and (KeyPressed) and (readkey=#0) and (readkey='D') then
begin
DoCode (5,#0+#0,'');
SendLine ('Sysop aborted. Sorry.');
ExitProg;
end;
until KeyCheck;
IF (modemon) and (Async_Buffer_Check) THEN
begin
Local := false;
WaitForChar := Async_Read;
end ELSE begin
local := true;
ch := ReadKey;
if (ch = #0) then
begin
tc := readkey;
case tc of
'D': begin
DoCode (5,#0+#0,'');
SendLine ('Sysop aborted. Sorry.');
ExitProg;
end;
#71: tc := '7';
#72: tc := '8';
#73: tc := '9';
#75: tc := '4';
#77: tc := '6';
#79: tc := '1';
#80: tc := '2';
#81: tc := '3';
end;
WaitForChar := tc;
end else
WaitForChar := ch;
end;
END;
Procedure Rdln (var s; l: byte);
var
x, kp: integer;
ch: char;
ts: string;
begin
kp := 0;
ts := '';
repeat
ch := WaitForChar;
if (ch = #8) and (kp > 0) then
begin
SendStr (#8+' '+#8);
dec(ts[0]);
Dec (kp);
end;
if (ch > #31) and (kp < L) then
begin
tS := ts + ch;
inc(kp);
SendStr (ch);
end;
until ch = #13;
SendLine ('');
move (ts, s, kp+1);
end;
Procedure Initialize;
const
BSet: set of byte = [3,6,12,24,48,96,192];
var
ch: char;
s, ts: string;
ts2: string[12];
BStr, CStr: string[30];
cnt, x, y: word;
f: text;
f2: file;
found: boolean;
begin
TrueGold := 0;
TrueSL := 0;
TrueUK := 0;
UserNum := 0;
s := ParamStr(1);
if Paramcount = 0 then
s := '/L';
if (s='/l') or (s='/L') then
begin
ModemOn := False;
SendLine ('Playing local mode.');
SendStr ('Enter name: ');
RdLn(PName,30);
exit;
end;
Assign (f, s);
{$I-}
reset(f);
{$I+}
If IOResult <> 0 then
begin
Writeln ('Chain file not found!'); {Got to do something about non-WWIV!}
Halt;
end;
{Dif chain files....}
ts := '';
x := Length(S);
repeat
tS := ConCat(UpCase(s[x]),ts);
dec(x);
until (x=0) or (s[x]='\');
found := false;
if ts = 'DOOR.SYS' then
begin
found := true;
Readln (f,CStr);
Readln (f,BStr);
for x := 3 to 9 do
Readln (f);
Readln (f,PName);
end;
if ts = 'CALLINFO.BBS' then
begin
found := true;
Readln (f, PName);
for x := 2 to 28 do
Readln (f);
Readln (f, CStr);
Readln (f);
Readln (f, BStr);
end;
ts2 := ts;
Delete(ts2,8,1);
if ts2 = 'DORINFO.DEF' then
begin
found := true;
for x := 1 to 3 do
Readln (f);
Readln (f,CStr);
Readln (f,BStr);
Readln (f);
Readln (f,PName);
x := 1;
while (x < Length(BStr)) and (BStr[x] <> ' ') do
inc(x);
Delete (BStr,x,Length(Bstr)-x+1);
end;
if ts = 'PCBOARD.SYS' then
begin
Close(F);
found := true;
Assign (F2, s);
Reset(F2,1);
Seek (F2,13);
BStr := '';
repeat
Blockread (F2,Ch,1);
if ch <> ' ' then
BStr := BStr + ch;
until (ch = ' ') or (Length(BStr) = 5);
Seek (F2,25);
PName := '';
repeat
Blockread (F2,Ch,1);
if ch <> ' ' then
PName := PName + ch;
until (ch = ' ') or (Length(PName) = 15);
Seek (F2,125);
Blockread (F2,Ch,1);
CStr := ch;
Close(F2);
Reset(F);
end;
if ts = 'SFDOORS.DAT' then
begin
found := true;
Readln (f);
Readln (f, PName);
for x := 3 to 4 do
Readln (f);
Readln (f, BStr);
Readln (f, CStr);
end;
if ts = 'CHAIN.TXT' then
begin
Found := true;
Readln (F,PName);
Val (Pname, UserNum, cnt);
Readln (f,PName);
{TTime!!!!}
for cnt := 3 to 6 do
Readln (f);
Readln (f,TrueGold);
for cnt := 8 to 10 do
Readln (f);
Readln (f,TrueSL);
for cnt := 12 to 17 do
Readln (F);
Readln (f, DataDir);
{ for cnt := 18 to 19 do }
Readln (f);
Readln (f, BStr);
Readln (f, CStr);
readln (f, BBSName);
for cnt := 23 to 25 do
Readln (f);
Readln (f, TrueUK);
end;
Close(F);
if not found then
begin
Writeln ('Unknown chain file format!'); {done something about non-WWIV!}
Halt;
end;
if CStr[Length(CStr)] = ':' then
dec(cstr[0]);
while (Length(CStr) > 0) and ((CStr[1] < '1') or (CStr[1] > '8')) do
Delete (CStr,1,1);
{
Writeln ('Name: ',PName);
Writeln ('Com: ',CStr);
Writeln ('Baud: ',BStr);
}
Val(BStr, BaudRate, cnt);
Val(Cstr, ComPort, cnt);
{Done loading...}
Async_CheckCTS := false;
if not Async_Open (Comport, BaudRate) then
begin
Writeln ('Invalid COMport or baud rate specification!');
Halt;
end;
if async_CarrierDetect then
SysAllowed := False
else
ModemOn := false;
for cnt := 2 to 4 do
begin
s := ParamStr(cnt);
if (s='/l') or (s='/L') then
begin
Async_Close;
ModemOn := False;
SysAllowed := true;
SendLine ('Playing local mode');
end;
if (s='/b') or (s='/B') then
begin
SysAllowed := true;
if Async_CarrierDetect then
ModemOn := true;
end;
if Upcase(s[2]) = 'X' then
begin
Delete (s,1,2);
Val (s,y,x);
if (ModemOn) and (y in Bset) then
begin
BaudRate := y*100;
if Async_Open(Comport,Baudrate) then
Writeln ('COM',Comport,' locked at ',BaudRate,'.');
end;
end;
if (upcase(s[2])='Q') then
Quiet := true;
end;
if not sysallowed then
begin
Writeln ('Playing remote only. Nothing should be displayed until the program is');
Writeln ('finished. Press F10 at any time to abort and really annoy '+Pname+'.');
end;
end;
Procedure SendCommand (R: byte; ComStr, ExStr: string);
var
tc, ch: char;
x: byte;
w1, w2: integer;
ts: string;
tsa: boolean;
begin
if not cton then
exit;
if stringing then
begin
StrungStr := ComStr;
exit;
end;
tc := #0;
Bad := 0;
CurCom := r;
while (modemon) and (async_buffer_check) and (r in [2, 4, 5, 10, 11, 15, 17, 22]) do
tc := WaitForChar;
redstr := '';
lastok := true;
if ModemOn then
begin
ts := Initcode;
for x := 1 to Length(ts) do
Async_send(ts[x]);
if keypressed then
begin
if (readkey = #0) and (readkey = 'D') then
begin
DoCode (5,#0+#0,'');
SendLine ('Sysop aborting...');
ExitProg;
end;
end;
ch := chr(r);
Async_Send(ch);
for x := 1 to Length(ComStr) do
Async_send(ComStr[x]);
if ExStr <> '' then
begin
for x := 1 to Length(ExStr) do
Async_send(ExStr[x]);
Async_Send(EndChar);
end;
lastok := true;
if sysallowed and (not (r in [4,10,11,12,15])) then
DoCode (r,ComStr,Exstr);
t1 := 0;
t2 := 0;
sysoff := true;
case r of
4: begin
t1 := ord(WaitForChar);
t2 := ord(WaitForChar);
if sysallowed then
begin
DetectGraph (w1,w2);
if w1 < t1 then
t1 := w1;
if w2 < t2 then
t2 := w2;
end;
end;
11: begin
for t1 := 1 to 4 do
redstr := redstr + WaitForChar;
Move (RedStr[1], Memty, 4);
end;
12: begin
{ WaitMin := 2;
SysEnd := 1;
t1 := ord(WaitForChar);
SysEnd := 0; }
end;
15: begin
WaitMin := 6;
SysEnd := 2;
t1 := ord(WaitForChar);
SysEnd := 0;
for t2 := 1 to t1 do
redstr := redstr + WaitForChar;
end;
21: begin
{ t1 := ord(WaitForChar); }
end;
end;
sysoff := false;
WaitMin := 3;
end else begin
if not (r in [4,10,11,12,15]) then
DoCode (r,ComStr,Exstr);
if not lastok then
begin
Writeln ('did code not ok');
lastok := true;
end;
case r of
4: begin
DetectGraph (w1, w2);
t1 := w1;
t2 := w2;
end;
11: Memty := MemAvail;
end;
end;
end;
Function CommandOk: boolean;
var
ch: char;
tsa: boolean;
begin
CommandOk := true;
if not Lastok then
Writeln ('Command ok not');
if (CurCom in [2, 4, 5, 10, 11, 15, 22]) then
begin
if modemon then
begin
if CurCom = 10 then
WaitMin := 0;
{ sysoff := true; }
repeat
ch := WaitForChar; { ok or not? }
if (CurCom = 10) and (ch = #32) then
begin
SpaceP := true;
ch := notok;
end;
until (ch < #3);
WaitMin := 3;
{ sysoff := false; }
if ch <> ok then
begin
Writeln ('Error ',ord(ch));
inc(bad);
CommandOK := false;
end else
Bad := 0;
end else
if (not lastok) then
CommandOk := false;
end;
if (bad > 2) then
begin
DoCode(5,#0+#0,'');
SendLine ('');
SendLine ('Aborting program.');
ExitProg;
end;
end;
Procedure PutPic(num: byte; x, y: word; how: byte);
begin
ComStr[0] := #6;
ComStr[1] := Chr(num);
move (x, ComStr[2], 2);
move (y, ComStr[4], 2);
ComStr[6] := Chr(how);
SendCommand(1, ComStr, '');
end;
Procedure LoadPic(num: byte; place, length: word; fn: string);
var
x: byte;
begin
ComStr[0] := #5;
ComStr[1] := Chr(num);
move (place, ComStr[2], 2);
move (length, ComStr[4], 2);
x := 0;
lastok := true;
repeat
SendCommand (2, ComStr, FN);
if not lastok then
Writeln ('Load not...');
inc(x);
if x = 3 then
begin
DoCode (5,#0+#0,'');
SendLine (FN+' not found. You must have the proper .CT files in order to run');
SendLine ('the game. Aborting.');
ExitProg;
end;
until CommandOK;
end;
Procedure DoText(x, y: word; tx: string);
begin
if cton then
begin
ComStr[0] := #4;
move (x, ComStr[1], 2);
move (y, ComStr[3], 2);
if tx = '' then
tx := #254;
SendCommand (3, ComStr, tx);
end else
if tx[Length(tx)] = ' ' then
SendStr(tx)
else
SendLine (tx);
end;
Procedure GrInfo(var gd, gm: word);
var
x: byte;
begin
x := 0;
repeat
SendCommand (4, '', '');
inc(x);
if x = 3 then
begin
SendLine ('No response. Aborting...');
ExitProg;
end;
until CommandOk;
gd := t1;
gm := t2;
end;
Procedure InitGr(d, m: word);
var
x: byte;
begin
ComStr[0] := #2;
ComStr[1] := chr(d mod 256);
ComStr[2] := chr(m mod 256);
gd := d;
gm := m;
x := 0;
repeat
SendCommand (5, comstr, '');
inc(x);
if x = 3 then
begin
SendLine ('Graphics error. Aborting...');
ExitProg;
end;
until CommandOk;
end;
Procedure ScreenPage (apage, vpage: byte);
begin
ComStr[0] := #2;
ComStr[1] := chr(apage);
ComStr[2] := chr(vpage);
SendCommand (6, ComStr, '');
end;
Procedure DoLine (x1, y1, x2, y2: word; color: byte);
begin
ComStr[0] := #9;
move (x1, ComStr[1], 2);
move (y1, ComStr[3], 2);
move (x2, ComStr[5], 2);
move (y2, ComStr[7], 2);
ComStr[9] := chr(color);
fgcol := color;
SendCommand (7, ComStr, '');
end;
Procedure DoCircle (x, y, rad: word; color: byte);
begin
ComStr[0] := #7;
move (x, ComStr[1], 2);
move (y, ComStr[3], 2);
move (rad, ComStr[5], 2);
ComStr[7] := chr(color);
fgcol := color;
SendCommand (8, ComStr, '');
end;
Procedure DoRect (x1, y1, x2, y2: word; color: byte);
begin
ComStr[0] := #9;
move (x1, ComStr[1], 2);
move (y1, ComStr[3], 2);
move (x2, ComStr[5], 2);
move (y2, ComStr[7], 2);
ComStr[9] := chr(color);
fgcol := color;
SendCommand (9, ComStr, '');
end;
Function TestResp: boolean;
var
x: byte;
g: boolean;
begin
TestResp := true;
if not modemon then
exit;
SendLine ('If Crunchterm is not currently running, run it and press Ctrl-A.');
SendLine ('Hit space to cancel.');
x := 0;
SpaceP := false;
repeat
inc(x);
SendCommand (10, '', '');
g := commandok;
until (x = 3) or SpaceP or g;
if SpaceP or (x=3) then
TestResp := false;
end;
Function MemFree: longint;
begin
SendCommand (11, '', '');
MemFree := Memty;
end;
Procedure LeaveCT;
begin
SendCommand (12,'','');
end;
Procedure ClearScr;
begin
SendCommand (13, '', '');
end;
Procedure SetCol (fore, back: byte);
begin
Comstr[0] := #2;
bkcol := back;
fgcol := fore;
comstr[1] := chr(fore);
comstr[2] := chr(back);
SendCommand (14, ComStr, '');
end;
Procedure InLineXY (len: byte; x, y: word; var thestring: string);
begin
ComStr[0] := #5;
ComStr[1] := chr(len);
move (x, ComStr[2], 2);
move (y, ComStr[4], 2);
repeat
SendCommand (15, ComStr, '');
thestring := redstr;
if (not ModemOn) and (bad = 0) then
begin
GotoXY (x,y);
Readln (thestring);
end;
until CommandOK;
end;
Procedure FillStyle (pattern, color: word);
begin
comstr[0] := #4;
FillPat := Pattern;
FillCol := Color;
move (pattern, ComStr[1], 2);
move (color, ComStr[3], 2);
SendCommand (16, ComStr, '');
end;
Procedure GetPic (num: byte; x1, y1, x2, y2: word);
begin
ComStr[0] := #9;
ComStr[1] := chr(num);
move (x1, ComStr[2], 2);
move (y1, ComStr[4], 2);
move (x2, ComStr[6], 2);
move (y2, ComStr[8], 2);
SendCommand (17, ComStr, '');
end;
Procedure DefSeries (Ser, Step, Command, ExNum: byte; StrStr: string);
begin
ComStr[0] := #4;
ComStr[1] := chr(Ser);
ComStr[2] := chr(Step);
ComStr[3] := chr(Command);
ComStr[4] := chr(ExNum);
SendCommand (18, ComStr, StrStr);
end;
Procedure DoSeries (Ser: byte);
begin
SendCommand (19, Chr(ser), '');
end;
Procedure DefExStr (num: byte; exstr: string);
begin
SendCommand (20, Chr(num), ExStr);
end;
Procedure SetGD(gd: byte);
begin
SendCommand (21,Chr(gd),'');
end;
Procedure LoadSong (SongNum: byte; Place: word; FN: string);
var
test1: byte;
begin
ComStr[0] := #3;
ComStr[1] := chr(songnum);
Move (Place, ComStr[2], 2);
test1 := 0;
repeat
SendCommand (22, ComStr, FN);
inc(test1);
until (CommandOk) or (test1 = 2);
end;
Procedure DoSong (SongNum: byte);
begin
if SoundOn then
SendCommand (23, chr(SongNum), '');
end;
Procedure DefAnim (Flm, Frame, PicN: byte; pause, x, y: word; Way: byte);
begin
ComStr[0] := #10;
ComStr[1] := chr(Flm);
Comstr[2] := chr(Frame);
ComStr[3] := chr(PicN);
Move (Pause, Comstr[4], 2);
Move (x, Comstr[6], 2);
Move (y, Comstr[8], 2);
ComStr[10] := chr(Way);
SendCommand (24, ComStr, '');
end;
Procedure ShowAnim (Flm: byte; AuxX, AuxY: word);
var
kp: byte;
begin
ComStr[0] := #5;
ComStr[1] := chr(Flm);
Move (Auxx, Comstr[2], 2);
Move (Auxy, Comstr[4], 2);
SendCommand (25, ComStr, '');
end;
Procedure TextStyle (Size, font: word);
begin
ComStr[0] := #4;
Move (Size, ComStr[1], 2);
Move (Font, ComStr[3], 2);
SendCommand (26, ComStr, '');
end;
Procedure FillCircle (x, y, rad: word);
begin
ComStr[0] := #6;
move (x, ComStr[1], 2);
move (y, ComStr[3], 2);
move (rad, ComStr[5], 2);
SendCommand (27, ComStr, '');
end;
Procedure FillBar (x1, y1, x2, y2: word);
begin
ComStr[0] := #8;
move (x1, ComStr[1], 2);
move (y1, ComStr[3], 2);
move (x2, ComStr[5], 2);
move (y2, ComStr[7], 2);
SendCommand (28, ComStr, '');
end;
Procedure FillFlood (x, y: word; BorderCol: byte);
begin
ComStr[0] := #5;
move (x, ComStr[1], 2);
move (y, ComStr[3], 2);
ComStr[5] := Chr(BorderCol);
SendCommand (29, ComStr, '');
end;
Procedure DefNote (Song, Note, l, n, o: byte);
begin
ComStr[0] := #5;
ComStr[1] := chr(song);
ComStr[2] := chr(note);
ComStr[3] := chr(l);
ComStr[4] := chr(n);
ComStr[5] := chr(o);
SendCommand (30,ComStr,'');
end;
Procedure ChPalette(ColorNum: word; Color: shortint);
begin
ComStr[0] := #3;
Move (ColorNum, ComStr[1], 2);
ComStr[3] := chr(Color);
SendCommand (32, Comstr,'');
end;
Procedure DoArc (x, y, stangle, endangle, rad: word);
begin
ComStr[0] := #10;
Move (x, ComStr[1], 2);
Move (y, ComStr[3], 2);
Move (stangle, ComStr[5], 2);
Move (endangle, ComStr[7], 2);
Move (rad, ComStr[9], 2);
SendCommand (33, ComStr,'');
end;
Procedure VirtWind (x1, y1, x2, y2: word; Clip: boolean);
begin
ComStr[0] := #9;
move (x1, ComStr[1], 2);
move (y1, ComStr[3], 2);
move (x2, ComStr[5], 2);
move (y2, ComStr[7], 2);
if Clip then
Comstr[9] := #1
else
ComStr[9] := #0;
SendCommand (34, ComStr, '');
end;
Procedure HighLight (x1, y1, x2, y2: word);
begin
ComStr[0] := #8;
move (x1, ComStr[1], 2);
move (y1, ComStr[3], 2);
move (x2, ComStr[5], 2);
move (y2, ComStr[7], 2);
SendCommand (35, ComStr, '');
end;
Procedure UnHighLight;
begin
SendCommand (36, '', '');
end;
Procedure DefScroll (x1, y1, x2, y2, scramt: word);
begin
ComStr[0] := #10;
move (x1, ComStr[1], 2);
move (y1, ComStr[3], 2);
move (x2, ComStr[5], 2);
move (y2, ComStr[7], 2);
move (scramt, ComStr[9], 2);
SendCommand (37, ComStr, '');
end;
Procedure ScrollUp;
begin
SendCommand (38,'','');
end;
Procedure ScrollDown;
begin
SendCommand (39,'','');
end;
Procedure SetFg (fore: byte);
begin
fgcol := fore;
SendCommand (40, chr(fore), '');
end;
begin
apage := 0;
vpage := 0;
SysEnd := 0;
WaitMin := 3;
DoTimeCheck := false;
Stringing := false;
SysAllowed := true;
CTOn := false;
ModemOn := true;
StrungStr := '';
FillPat := 0;
FillCol := 0;
BkCol := 0;
fgCol := 7;
CurCom := 0;
Bad := 0;
sysoff := false;
Local := true;
SoundOn := true;
end.