home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MCGA#07.ZIP / TEST07.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1992-06-12  |  1.2 KB  |  76 lines

  1. Program MCGATest;
  2.  
  3. uses
  4.   Crt,Dos,MCGA07,Palette;
  5.  
  6. var
  7.   Stop,
  8.   Start       :  LongInt;
  9.   Regs        :  Registers;
  10.   PicBuf,
  11.   StorageBuf  :  Pointer;
  12.   FileLength  :  Word;
  13.   Pal,
  14.   BlackPal    :  array [1..768] of Byte;
  15.  
  16. const
  17.   NumTimes    = 100;
  18.  
  19. Procedure LoadBuffer (S:String;Buf:Pointer);
  20. var
  21.   F           :  File;
  22.   BlocksRead  :  Word;
  23. begin
  24.   Assign (F,S);
  25.   Reset (F,1);
  26.   BlockRead (F,Buf^,65000,FileLength);
  27.   Close (F);
  28. end;
  29.  
  30. Procedure Pause;
  31. var
  32.   Ch     :  Char;
  33. begin
  34.   Repeat Until Keypressed;
  35.   While Keypressed do Ch := Readkey;
  36. end;
  37.  
  38. Procedure Control;
  39. begin
  40.   SetGraphMode ($13);
  41.  
  42.   LoadBuffer ('E:\NAVAJO.PCX',PicBuf);
  43.  
  44.   GetPCXPaletteAsm (PicBuf,@Pal,FileLength-768);
  45.   WritePalettePas (0,255,@Pal);
  46.   DisplayPCX (0,0,PicBuf);
  47.  
  48.   FillChar (BlackPal,SizeOf(BlackPal),0);
  49.   Pause;
  50.  
  51.   SetupFade (0,255,@BlackPal,20);
  52.   Repeat FadePalette Until DoneFade;
  53.   Pause;
  54.  
  55.   SetupFade (0,255,@Pal,20);
  56.   Repeat FadePalette Until DoneFade;
  57.   Pause;
  58.  
  59.   Oreo (0,255);
  60.   Pause;
  61.  
  62.   SetupFade (0,255,@Pal,20);
  63.   Repeat FadePalette Until DoneFade;
  64.   Pause;
  65.   SetGraphMode (3);
  66. end;
  67.  
  68. Procedure Init;
  69. begin
  70.   GetMem (PicBuf,65500);
  71. end;
  72.  
  73. Begin
  74.   Init;
  75.   Control;
  76. End.