home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progbas / bload.arj / BLOAD.PAS
Pascal/Delphi Source File  |  1992-04-28  |  2KB  |  39 lines

  1. program bload_demo;
  2.  
  3. {A program to demonstrate how to load files saved the Basic BSAVE }
  4. {command into Turbo Pascal for display.                           }
  5. {By William Hersh, MD.                                            }
  6. {Not copyrighted.  Released to the public domain for all use.     }
  7.  
  8. type
  9.   newpage=array[1..16512] of byte;       {array of byte to hold screen     }
  10.   page=record                            {array to hold BSAVE'd file with  }
  11.     hdr: array[0..7] of byte;            {  special location for first     }
  12.     scr: newpage;                        {  8 attribute bytes              }
  13.   end;
  14.   str14=string[14];
  15.  
  16. var
  17.   grpage: newpage absolute $B800:$0000;  {screen location to write to      }
  18.   pageholder: page;                      {holder for all of BSAVE'd file   }
  19.   fileholder: file of page;              {file variable                    }
  20.   filename: str14;                       {file name                        }
  21.  
  22. procedure bload(filename: str14);
  23. begin
  24.   assign(fileholder,filename);           {open and                         }
  25.   reset(fileholder);                     {  reset file                     }
  26.   read(fileholder,pageholder);           {read BSAVE'd screen to pageholder}
  27.   close(fileholder);                     {close file                       }
  28.   grpage:=pageholder.scr;                {move picture into screen memory  }
  29. end;                                     {  stripped of first 7 bytes      }
  30.  
  31. begin {main program}
  32.   clrscr; gotoxy(1,5);
  33.   write('Name of BSAVE''d graphics file?  ');
  34.   read(filename);
  35.   graphcolormode;
  36.   bload(filename);
  37.   repeat until keypressed;
  38. end.