Uses Crt,Dos,Graphics,General,Keyb,Joys,Xms,Sound,Road,Confunit,CdUnit,CdVars;

Const Silence=True;

var
F            :File;
CurrDirectory:string;
y,y1,Base    :integer;
Timeout      :word;
Opt          :array[0..2,0..2] of word;
sel          :array[0..2] of word;
BaseS        :array[0..6] of string;


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

InitCD;
PlayTrack(1+1);

Initgraph(2000);
(*initsound(4096);*)

Initkeyb;
initfont;
loadfont('PICS\Font.Pcx');

LoadConfig;

Lbob('Pics\Write2.pcx','Data\Cursore.Dat',1);
LoadLogo(MaxBobs-2);
loadpic('Pics\BackSetS.pcx',Pseg,Pofs);
loadpal('Pics\BackSetS.pcx',0,255);
PlaceLogo;
getfbob(MaxBobs,0,0,319 shl SVGA,199 shl SVGA);
clr(0);
scrswap;

Bases[0]:='210';
Bases[1]:='220';
Bases[2]:='230';
Bases[3]:='240';
Bases[4]:='250';
Bases[5]:='260';

if Baseport=$210 then Base:=0;
if Baseport=$220 then Base:=1;
if Baseport=$230 then Base:=2;
if Baseport=$240 then Base:=3;
if Baseport=$250 then Base:=4;
if Baseport=$260 then Base:=5;

if Irq=5  then Sel[1]:=0;
if Irq=7  then Sel[1]:=1;
if Irq=10 then Sel[1]:=2;

if DMA=1  then Sel[2]:=0;
if DMA=3  then Sel[2]:=1;
if DMA=5  then Sel[2]:=2;

Opt[1,0]:=5;
Opt[1,1]:=7;
Opt[1,2]:=10;
Opt[2,0]:=1;
Opt[2,1]:=3;
Opt[2,2]:=5;
resettime;

repeat
fbob(MaxBobs,0,0);
if keystate(72) then dec(y);
if keystate(80) then inc(y);
if keystate(57) or keystate(28) then begin
if y>0 then inc(Sel[y]) else
 begin
  inc(Base,1);
  if Base>5 then Base:=0;
 end;
 if Sel[y]>2 then Sel[y]:=0;
end;
repeat until not keystate(80) and not keystate(72) and not keystate(28) and not keystate(57);

if y>2 then y:=0;
if y<0 then y:=2;
bob(1,107 shl SVGA,(y*25+93) shl SVGA);
text(175 shl SVGA,(75+25) shl SVGA,BaseS[Base],True);
text(175 shl SVGA,(75+50) shl SVGA,ToStr(Opt[1,Sel[1]],0),True);
text(175 shl SVGA,(75+75) shl SVGA,ToStr(Opt[2,Sel[2]],0),True);
(*repeat until time>25;*)

resettime;
scrswap;
until keystate(1);

if Base=0 then Baseport:=$210;
if Base=1 then Baseport:=$220;
if Base=2 then Baseport:=$230;
if Base=3 then Baseport:=$240;
if Base=4 then Baseport:=$250;
if Base=5 then Baseport:=$260;
Irq:=Opt[1,Sel[1]];
Dma:=Opt[2,Sel[2]];

SaveConfig;

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

StopAudio;
KillFont;
(*KillSound;*)
KillGraph;
KillKeyb;
TextMode(2);
end.
