home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ADC_TP3.ZIP / VIDTEX.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1987-03-01  |  2.0 KB  |  92 lines

  1. program Vidtex;
  2.  
  3. {This program turns high-res CompuServe VidTex files into a screen
  4. picture, writing directly to memory for speed. Examples of such
  5. picture files can be found in the CB section (CB Pictures); simply
  6. download the characters as text until you hear a beep; then write
  7. to your file. Only one picture per file. Enter name of picture file
  8. at prompt on this program.}
  9.  
  10.  
  11. type
  12.    vidrecord = record
  13.                  inchar : char;
  14.                end;
  15.  
  16. var
  17.    vidfile : file of vidrecord;
  18.    vidrec : vidrecord;
  19.    vtxfile : string[15];
  20.    count,i,j,bytewatch   : integer;
  21.    check,comp1   : string[6];
  22.    toggle,pix, inbyte,incount  :  byte;
  23.    bytecount,bytetoggle:integer;
  24.  
  25. procedure PutByte(thisone:byte);
  26.  
  27. begin
  28.  
  29. bytewatch := bytewatch+1;
  30. if bytewatch = 64  then
  31. begin
  32. if bytetoggle = 8192 then bytecount := bytecount + 80;
  33. bytewatch := 0;
  34. bytetoggle:=8192-bytetoggle;
  35. end;
  36. Mem[$b800:bytecount+bytetoggle+bytewatch]:=thisone;
  37. end;
  38.  
  39. begin
  40.   Write('Which file ? ');
  41.   readln(vtxfile);
  42.   check := '   ';
  43.   assign(vidfile,vtxfile);
  44.   reset(vidfile);
  45.   GraphMode;
  46.   count := -1;
  47.   comp1 := char(27)+'GH';
  48.   while not (check = comp1)  do
  49.   begin
  50.     count := count + 1;
  51.     seek(vidfile,count);
  52.     read(vidfile,vidrec);
  53.     with vidrec do
  54.     begin
  55.       check := copy(check,1,3) + inchar;
  56.       check := copy(check,2,3);
  57.     end;
  58.   end;
  59.   reset(vidfile);
  60.   toggle := 3;
  61.   inbyte :=0;
  62.   incount := 0;
  63.   bytewatch := -1;
  64.   bytetoggle :=0;
  65.   bytecount :=0;
  66.   for i := count + 1 to filesize(vidfile)-1 do
  67.   begin
  68.     seek(vidfile,i);
  69.     read(vidfile,vidrec);
  70.     toggle := 3-toggle;
  71.     with vidrec do
  72.     begin
  73.       pix := ord(inchar);
  74.       for j:= 1 to pix-32 do
  75.       begin
  76.         incount := incount +1;
  77.         inbyte := (inbyte shl 2)+toggle;
  78.         if incount=4 then
  79.         begin
  80.           incount :=0;
  81.           PutByte(inbyte);
  82.           inbyte :=0;
  83.         end;
  84.  
  85.       end;
  86.  
  87.     end;
  88.   end;
  89. while keypressed = false do
  90. begin end;
  91. end.
  92.