home *** CD-ROM | disk | FTP | other *** search
/ Prima Shareware 3 / DuCom_Prima-Shareware-3_cd1.bin / PROGRAMO / PASCAL / FASTVGA / FASTFLI.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-07-13  |  1.8 KB  |  71 lines

  1. {$IFDEF Ver70}
  2. { Compiler directives for Turbo Pascal 7.0 }
  3. {$A+,B-,D+,E-,F-,I+,L+,N-,O-,P+,Q-,R-,S-,T-,V-,X+}
  4. {$IFDEF DPMI} {$G+} {$ELSE} {$G-} {$ENDIF}
  5. {$M 16384,0,655360}
  6. {$ENDIF}
  7.  
  8. {$IFDEF Ver60}
  9. { Compiler directives for Turbo Pascal 6.0 }
  10. {$A+,B-,D+,E-,F-,G-,I+,L+,N-,O-,R-,S-,V-,X+}
  11. {$M 16384,0,655360}
  12. {$ENDIF}
  13.  
  14. program FastFLI; { Play an FLI animation from the DOS command line }
  15.  
  16. { FastVGA v1.0, (C)1993 by Tal Cohen }
  17.  
  18. uses FastVGA,FLIUnit,Crt;
  19.  
  20. procedure ShowSyntax;
  21.  begin
  22.   WriteLn ('FastFLI version 1.0');
  23.   WriteLn;
  24.   WriteLn ('Created using FastVGA 1.0, (C)1993 by Tal Cohen');
  25.   WriteLn;
  26.   WriteLn ('Syntax: FASTFLI <filename> [delay-rate]');
  27.   WriteLn;
  28.   WriteLn ('No file extension is assumed. If delay-rate is not specified,');
  29.   WriteLn ('the FLI file''s normal timing is used. To play the FLI file');
  30.   WriteLn ('at maximal speed, set delay-rate to zero.');
  31.   WriteLn;
  32.   Halt;
  33.  end;
  34.  
  35. var DelayRate:Word;
  36.     ErByte:Byte;
  37.     ErInt:Integer;
  38.  
  39. begin
  40.  if (ParamCount>2) or (ParamCount<1) then ShowSyntax;
  41.  if ParamCount=2 then
  42.   begin
  43.    Val (ParamStr(2),DelayRate,ErInt);
  44.    if ErInt<>0 then ShowSyntax;
  45.   end
  46.  else
  47.   DelayRate:=NormalDelay;
  48.  
  49.  { THIS IS THE ACTUAL PLAYING LOOP: }
  50.  GoVGA256;
  51.  repeat
  52.   PlayFLI (ParamStr(1),DelayRate,True,ErByte);
  53.  until ErByte<>0;
  54.  TextMode (Co80);
  55.  
  56.  case ErByte of
  57.   1:WriteLn ('File not found.');
  58.   2:WriteLn ('File close error.');
  59.   3:WriteLn ('I/O read error or file corrupted.');
  60.   4:WriteLn ('Not an FLI file.');
  61.   5:WriteLn ('FLI file not in 320x200x256 mode.');
  62.   6:WriteLn ('Out of memory.');
  63.   99: { Esc pressed, no error } ;
  64.  else
  65.   begin
  66.    WriteLn ('Unknown error. Error code: ',ErByte);
  67.    WriteLn ('Please report to Tal Cohen at once.');
  68.   end;
  69.  end;
  70. end.
  71.