unit bbskv;
{$O+,F+}
interface
uses dos,crt;

CONST

  esc=chr(27);

  ansicleol       = esc+'[K';   {ANSI cleol, clear to end of line. }
  ansicls         = esc+'[2J';  {ANSI cls, clear screen.           }
  ansiscp         = esc+'[s';   {ANSI scp, save cursor position.   }
  ansircp         = esc+'[u';   {ANSI rcp, restore cursor position.}
  ansidsr         = esc+'[6n';  {ANSI dsr, device status report    }

  ansifgblack     = esc+'[30m';
  ansifgred       = esc+'[31m';
  ansifggreen     = esc+'[32m';
  ansifgbrown     = esc+'[33m';
  ansifgblue      = esc+'[34m';
  ansifgmagenta   = esc+'[35m';
  ansifgcyan      = esc+'[36m';
  ansifggray      = esc+'[37m';
  ansifgdkgray    = esc+'[1;30m';
  ansifgltred     = esc+'[1;31m';
  ansifgltgreen   = esc+'[1;32m';
  ansifgyellow    = esc+'[1;33m';
  ansifgltblue    = esc+'[1;34m';
  ansifgltmagenta = esc+'[1;35m';
  ansifgltcyan    = esc+'[1;36m';
  ansifgwhite     = esc+'[1;37m';

  ansibgblack     = esc+'[40m';
  ansibgred       = esc+'[41m';
  ansibggreen     = esc+'[42m';
  ansibgbrown     = esc+'[43m';
  ansibgblue      = esc+'[44m';
  ansibgmagenta   = esc+'[45m';
  ansibgcyan      = esc+'[46m';
  ansibggray      = esc+'[47m';

  ansiblinkon     = esc+'[5m';
  ansiclrattr     = esc+'[0m';

  ansicup         = esc+'[1A';
  ansicdn         = esc+'[1B';
  ansicrt         = esc+'[1C';
  ansiclf         = esc+'[1D';


  low=false;
  high=true;
  one=1;
  zero=0;
  X00=$14;                                 {Fossil Interupt Location}
  hell=false;
  frozenover=true;
  carriagereturn=chr(13);
  linefeed=chr(10);
  backspace=chr(8);
  bs=backspace;
  space=chr(32);
  destructiveBS=backspace+space+backspace;
  clearscreen=chr(14);
  kludgemark=chr(1);
  null=chr(0);
  bell=chr(7);
  hivariable=9;
  crlf=carriagereturn+linefeed;

TYPE
  textf=text;

VAR
  zf: text;
  localansi:boolean;
  rip:boolean;
  ansi:boolean;
  usesuperbar:boolean;
  blinkhere:boolean;
  doingansi:boolean;
  {Signals CHANGECOLOUR whether or not to treat colour requests by
   ANSI rules or Tommy rules.  TRUE means ANSI rules.}

  quitnow         : boolean;
  crucial          : boolean; {Whether a user should be thrown off for timeout or not}

{ The following variables are used by the FOSSIL and comm routines and are
  somewhat cryptic.  Don't fuck with them. }

  Reg              : Registers;
  Rcvd,
  x                : Char;        {General purpose temporary global variable}
  Carrier          : Boolean;     {True if DCD for current com port is high}
  exitnow          : boolean;
  Test             : Byte;
  index,
  Number           : Integer;     {General purpose temporary integer}
  Comport          : integer;     {Current com port a la COMx:}
  initok           : boolean;     {Returned TRUE if OK received from modem}
  consoleonly      : boolean;     {If TRUE no input will be accepted from modem}
  localmode        : boolean;     {If TRUE no output will be sent to modem}
  ignorecarrier    : boolean;   {True if carrier is to be ignored}
  abort            : boolean;     {If TRUE user abort of output will be allowed}
  baudrate         : longint;        {The current BPS rate of the modem}
  baudstr          : string[7];   {The current BPS rate in string form}
  task             : byte;      {Node number in integer format}
  taskstr          : string[2]; {Node number in string format}
  connect          : boolean;     {Returned TRUE if any connect string received}
  lf               : boolean;     {If TRUE linefeeds will be sent}
  noecho           : boolean;     {If TRUE output will be directed to modem only}
  modemans         : boolean;
  mtimeout         : integer;        {Timeout for GETLNM calls, in seconds}

  Xtfile           : textf;  {            Generic textfile variable}

  timecount        : integer;
  LOGONsecond      : longint; {Second-of-the-day that user logged on}

  lastcolour:char;
  tmpf             : text;
  totallines       : longint;
  mon              : array[1..12] of word;
  forceoffsecond   : longint;
  NEWSECOND,
  newminute        : boolean;
  lsecond          : word;
  echochar         : char;
  desqview         : boolean; {TRUE if DESQview is detected}
  minimuminput     : byte; {Smallest input string to allow with GETLN}
  maximuminput     : byte; {Largest input string to allow with GETLN}
  currentfg,
  currentbg        : integer;
  usernumber       : word;
  debugmode        : boolean;
  quitcode         : byte;
  dvblog           : boolean;

(****** ALL FOLLOWING VARS/CONSTS/TYPES MOVED FROM MAIN RANCHO.PAS ******)

    dinode:word;
    registree:boolean;

    location: word;
    pregame:boolean;

    movesleft:integer;
    joustsleft:integer;
    timesjacuzzi:integer;

    tch:char;

    doquikemove:boolean;

    disease:boolean;
    distemp:longint;

    lastusedfilename:string[12];
    lastusedfile:file of longint;
    lastused:longint;

    BBSName : String[40];    {Host BBS's name}
    UserName: String[36];    {Current Player's BBS Name}

    giveupturn:boolean;
    beeninvkr:boolean;
    getoutvkr:boolean;
    invkr:boolean;
    iran,
    abortedfuck:boolean;
    spymode:boolean;
    autowrap:boolean; autocol:integer;

    school  : integer;
    tf:text;
    Parity  : Char;
    Bits,Stops : Word;
    TimeLeft : Integer;
    Moves   : Integer;
    DorType  : Integer;
    KillUser : Boolean;
    Stop : Integer;
    tstr:string[127];
    nomore:boolean;

    dorinfotime:longint;
    nodoorinfo:boolean;
    dipath,
    rundir:string[80];
    newtothisroom:boolean;
    directmode:boolean;

implementation

begin
  rundir:=fexpand('.\');
  ansi:=true;
  rip:=false;
  doingansi:=false;
  nomore:=false;
  newtothisroom:=false;
  localansi:=true;
  directmode:=false;
end.

