home *** CD-ROM | disk | FTP | other *** search
/ PC Underground / UNDERGROUND.ISO / memory / flat / demormem.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-07-28  |  2.1 KB  |  69 lines

  1. {
  2.  
  3.  **************************************************************************
  4.  ***                   ABACUS' "PC UNDERGROUND"                         ***
  5.  ***                  ================================                  ***
  6.  ***                                                                    ***
  7.  ***               Demo program for using RMEM unit                     ***
  8.  ***                                                                    ***
  9.  *** The program demonstrates the use of the RMEM unit.                 ***
  10.  *** Program loads an image into RMEM, and then displays it from RMEM.  ***
  11.  ***                                                                    ***
  12.  *** Author          : Boris Bertelsons  (InspirE)                      ***
  13.  *** Filename        : DEMORMEM.PAS                                     ***
  14.  *** Last Update     : 04/28/94                                         ***
  15.  *** Version         : 1.0                                              ***
  16.  *** Compiler        : Turbo Pascal 6.0 and above                       ***
  17.  **************************************************************************
  18.  
  19. }
  20. program demo386;
  21.  
  22. uses dos,crt,rmem,gifunit;
  23.  
  24. var imageposition : longint;
  25.  
  26. procedure load_the_gifimage;
  27. begin;
  28.   getmem(vscreen,64000);
  29.   Init_ModeX;
  30.   blackpal;
  31.   LoadGif('example.gif',vscreen,0,0);
  32.   textmode(3);
  33. end;
  34.  
  35. procedure show_the_gifimage;
  36. begin;
  37.   Init_ModeX;
  38.   p13_2_modex(0,16000);
  39.   setpal;
  40. end;
  41.  
  42. begin
  43.   memory_checks(500,2700);
  44.   enable_Realmem(2700);
  45.  
  46.   if not Rgetmem(imageposition,64000) then begin;
  47.     textmode(3);
  48.     writeln('Error reserving memory !!!');
  49.   end;
  50.   load_the_gifimage;
  51.  
  52.   writeln('Loaded the GIF image into memory.');
  53.   writeln('Now storing the image in RMEM and clearing Load buffer !');
  54.   Rmem_write(vscreen,imageposition,64000);
  55.   fillchar(vscreen^,64000,0);
  56.  
  57.   writeln('Cleared the Load buffer !');
  58.   writeln('Now loading the image from RMEM');
  59.   writeln('<ENTER>, to display the image ... ');
  60.   readln;
  61.   Rmem_read(imageposition,vscreen,64000);
  62.   show_the_gifimage;
  63.  
  64.   readln;
  65.   textmode(3);
  66.   Exit_Rmem;
  67. end.
  68.  
  69.