Uses Crt,Dos,Graphics,General,Keyb,Joys,Xms,Sound,road;

Const Silence=True;
      DemoStatus=1;

var
Cmem         :boolean;
EMem         :boolean;
JoyOn        :boolean;
Audio,k      :boolean;
AllOk        :boolean;
F            :File;
CurrDirectory:string;
Timeout      :word;

Procedure Beep(St:boolean);
begin
if Silence then exit;
(*if St then Begin Sound(200);delay(150);NoSound end else
             Begin Sound( 50);delay(150);NoSound end*)
end;


begin
GetDir(0,CurrDirectory);
chdir(CurrDirectory);

Emem:=XmsMem>2048+2048;
Cmem:=MemAvail>400000;
JoyOn:=CheckJoy1;
Audio:=DetectSoundBlaster;

Initgraph(1000);

Initkeyb;

LoadLogo(MaxBobs-2);
loadpic('Pics\BackTest.pcx',Pseg,Pofs);
loadpal('Pics\BackTest.pcx',0,255);
PlaceLogo;
GetFbob(100,0,0,319 shl SVGA,199 shl SVGA);
clr(0);
Lbob('Pics\Acces2.pcx','Data\Check.Dat',1);

Fbob(100,0,0);
bob(2-ord(JoyOn),235 shl SVGA,103 shl SVGA);
scrswap;
Beep(JoyOn);
Delay(250);

Fbob(100,0,0);
bob(2-ord(JoyOn),235 shl SVGA,103 shl SVGA);
bob(2- ord(Cmem),235 shl SVGA,118 shl SVGA);
scrswap;
Beep(Cmem);
Delay(250);

Fbob(100,0,0);
bob(2-ord(JoyOn),235 shl SVGA,103 shl SVGA);
bob(2- ord(Cmem),235 shl SVGA,118 shl SVGA);
bob(2- ord(Emem),235 shl SVGA,133 shl SVGA);
scrswap;
Beep(Emem);
Delay(250);

Fbob(100,0,0);
bob(2-ord(JoyOn),235 shl SVGA,103 shl SVGA);
bob(2- ord(Cmem),235 shl SVGA,118 shl SVGA);
bob(2- ord(Emem),235 shl SVGA,133 shl SVGA);
bob(2-ord(Audio),235 shl SVGA,148 shl SVGA);
scrswap;
Beep(Audio);
Delay(250);
Timeout:=0;
AllOk:=Joyon and Cmem and Emem and Audio;
repeat
inc(TimeOut);
Fbob(100,0,0);
k:=not K;
if not(Joyon) then
begin if k then bob(2-ord(JoyOn),235 shl SVGA,103 shl SVGA); end else bob(2-ord(JoyOn),235 shl SVGA,103 shl SVGA);
if not(Cmem ) then
begin if k then bob(2-ord(Cmem ),235 shl SVGA,118 shl SVGA); end else bob(2-ord(Cmem ),235 shl SVGA,118 shl SVGA);
if not(Emem ) then
begin if k then bob(2-ord(Emem ),235 shl SVGA,133 shl SVGA); end else bob(2-ord(Emem ),235 shl SVGA,133 shl SVGA);
if not(Audio) then
begin if k then bob(2-ord(Audio),235 shl SVGA,148 shl SVGA); end else bob(2-ord(Audio),235 shl SVGA,148 shl SVGA);delay(150);
scrswap;
until ((keypush>0) and Not AllOk) or (AllOk and (TimeOut>5));
fade(4);
clr(0);
scrswap;
if Cmem and Emem then begin
(********* EXIT *************)
  assign(F,'password.WWW');
  rewrite(f,1);
  writefile('Release',8,f);
  close(f);
(****************************)
end else begin
(********* EXIT *************)
 loadpic('Pics\BackNrun.pcx',Pseg,Pofs);
 loadpal('Pics\BackNrun.pcx',0,255);
 scrswap;
  delay(2000);
  assign(F,'password.WWW');
  rewrite(f,1);
  writefile('Exit',8,f);
  close(f);

fade(4);
clr(0);
scrswap;
(****************************)
end;

KillGraph;
empty;
KeyClear;
KillKeyb;
end.
