home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 March / pcx08_9703.iso / melyviz / pcx-user / demo / demo1 / plasma2.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1997-02-07  |  1.7 KB  |  85 lines

  1. {$G+}
  2. program Plazma;
  3.  
  4. uses Crt;
  5.  
  6.  var
  7.      screen : Array[1..64000] of byte absolute $0a000:$0000;
  8.      paletta: Array[0..764] of byte;
  9.      buff   : Array[0..2] of byte;
  10.      fi     : File;
  11.      TempB  : Byte;
  12.  
  13.  Procedure SetRGB(colnum, Red, Green, Blue: Byte);Assembler;
  14.   Asm
  15.    mov  dx,$3c8
  16.    mov  al,colnum
  17.    out  dx,al
  18.    inc  dx
  19.    mov  al,red
  20.    out  dx,al
  21.    mov  al,green
  22.    out  dx,al
  23.    mov  al,blue
  24.    out  dx,al
  25.   End;
  26.  
  27.  Procedure Graph;Assembler;
  28.   Asm
  29.     mov  ax,$13
  30.     int  $10
  31.   End;
  32.  
  33.  Procedure Backtotext;Assembler;
  34.   Asm
  35.     mov  ax,$3
  36.     int  $10
  37.   End;
  38.                                         { A paletta mozgatása }
  39.  Procedure Palanim;
  40.   Begin
  41.     move(paletta,buff,3);
  42.     move(paletta[3],paletta,762);
  43.     move(buff,paletta[762],3);
  44.    asm
  45.     cld
  46.     mov  dx,$3c8
  47.     mov  al,1
  48.     out  dx,al
  49.     lea  si,paletta
  50.     inc  dx
  51.     mov  cx,255*3
  52.     rep outsb
  53.    end;
  54.   End;
  55.  
  56. BEGIN
  57.  Graph;
  58.  
  59.  assign(fi,'plasma.dat');
  60.  TempB:=FileMode; {Elmentjuk az aktuális FileMode értékét !}
  61.  FileMode := 0; {Csak olvasásra nyitjuk meg, mert a PC-X CD-n a PLASMA.DAT
  62.                   read-only és a Pascal hörögne ha írásra akarnánk megnyitni
  63.                   egy read-only file-t !}
  64.  {$I-}
  65.  reset(fi, 1);
  66.  {$I+}
  67.  if IOResult <> 0 then begin
  68.                          WriteLn;
  69.                          WriteLn('Hoops ... Valami nem stimmel, nem sikerült megnyitni a PLASMA.DAT-ot !');
  70.                          Halt($FF);
  71.                         end;
  72.  blockread(fi, screen, 64000);
  73.  blockread(fi, paletta, 764);
  74.  close(fi);
  75.  FileMode:=TempB;
  76.  
  77.  repeat        { Palettaanimáció }
  78.   palanim;
  79.   delay(10);
  80.  until keypressed;
  81.  
  82.  readkey;
  83.  backtotext;
  84. END.
  85.