home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Interdit
/
pc-interdit.iso
/
sound
/
voc
/
vocdemo.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-10-30
|
3KB
|
124 lines
uses crt,dos,vocplay,design;
var ch : char;
next_voc : integer;
Vocname : string;
procedure Write_Helptext;
begin;
textcolor(lightgray);
textbackground(black);
clrscr;
writeln(' MICRO APPLICATION VOC-Player Version 1.0, (c) 1994',
' Auteur : Boris Bertelsons');
writeln;
writeln(' Usage: Vocdemo <Filename[.VOC]> [options]');
writeln;
writeln(' Les options :');
writeln(' -H : cet écran');
writeln(' -In : utilise l''interruption n');
writeln(' -Dn : utilise le canal DMA n');
writeln(' -Pxxx : utilise l''adresse de base xxx');
writeln;
Cursor_On;
halt(0);
end;
procedure interprete_commandline;
var cs,hs : string;
li,code : integer;
FicNom : boolean;
begin;
for li := 1 to 10 do begin;
cs := paramstr(li);
FicNom := true;
{ demande d'Aide ? }
if (pos('-h',cs) <> 0) or (pos('/h',cs) <> 0) or
(pos('-H',cs) <> 0) or (pos('/H',cs) <> 0) or
(pos('-?',cs) <> 0) or (pos('/?',cs) <> 0) then begin;
write_Helptext;
FicNom := false;
end;
{ force irq }
if (pos('-i',cs) <> 0) or (pos('/i',cs) <> 0) or
(pos('-I',cs) <> 0) or (pos('/I',cs) <> 0) then begin;
force_irq := true;
hs := copy(cs,3,length(cs)-2);
val(hs,dsp_irq,code);
FicNom := false;
end;
{ Force DMA ? }
if (pos('-d',cs) <> 0) or (pos('/d',cs) <> 0) or
(pos('-D',cs) <> 0) or (pos('/D',cs) <> 0) then begin;
force_dma := true;
hs := copy(cs,3,length(cs)-2);
val(hs,dma_ch,code);
FicNom := false;
end;
{ Force Base ? }
if (pos('-p',cs) <> 0) or (pos('/p',cs) <> 0) or
(pos('-P',cs) <> 0) or (pos('/P',cs) <> 0) then begin;
hs := copy(cs,3,length(cs)-2);
if hs = '200' then dsp_adr := $200;
if hs = '210' then dsp_adr := $210;
if hs = '220' then dsp_adr := $220;
if hs = '230' then dsp_adr := $230;
if hs = '240' then dsp_adr := $240;
if hs = '250' then dsp_adr := $250;
if hs = '260' then dsp_adr := $260;
if hs = '270' then dsp_adr := $270;
if hs = '280' then dsp_adr := $280;
Startport := dsp_adr;
Endport := dsp_adr;
FicNom := false;
end;
if FicNom then begin;
Vocname := cs;
end;
end;
end;
procedure Jouer_FicVoc(filename : string);
var li : integer;
ch : char;
loopcounter : word;
begin;
loopcounter := 0;
repeat
inc(loopcounter);
clrscr;
writexy(10,08,'Attention ! Le VOC se trouve dans une boucle !!!');
writexy(10,10,'Terminer en appuyant sur la touche >> Q <<');
writexy(10,14,'Desactiver Smartdrv parce qu''il est leeeent !');
gotoxy(10,17);
write('Passage n°',loopcounter);
Init_Voc(filename);
ch := #0;
repeat
if keypressed then ch := readkey;
until VOC_READY or (upcase(ch) = 'Q');
VOC_DONE;
until upcase(ch) = 'Q';
end;
begin;
cursor_off;
interprete_commandline;
Init_SB;
textcolor(lightgray);
textbackground(black);
write_sbconfig;
delay(1333);
repeat
textcolor(15);
textbackground(1);
clrscr;
Vocname := select_fichier('*.voc','*.voc','','');
if Vocname = 'xxxx' then next_voc := 255
else Jouer_FicVoc(Vocname);
until next_voc = 255;
cursor_on;
textmode(3);
end.