home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / GFXFX2.ZIP / CHARSET.PAS < prev    next >
Pascal/Delphi Source File  |  1995-02-14  |  1KB  |  44 lines

  1.  
  2. program convert_charset; { CHARSET.PAS }
  3. { Convert CHARSET.INC to CHARS.INC for SCR_TXT2.PAS,
  4.   Beatify CHARS.INC yourself. By Bas van Gaalen. }
  5. uses dos,u_vga,u_ansi,u_kb;
  6. {$i charset.inc}
  7. const
  8.   txtptr:pointer=ptr($b800,0);
  9.   outfname:pathstr='chars.inc';
  10. var
  11.   txtfile:text;
  12.   chars:array[0..4,0..319] of word;
  13.   v,x:word;
  14.   i,y:byte;
  15. begin
  16.   setvideo(259);
  17.   ansi_2txt(imagedata,txtptr^,imagedata_length);
  18.   assign(txtfile,outfname);
  19.   rewrite(txtfile);
  20.  
  21.   for i:=0 to 4 do { 5-line hi charset }
  22.     for x:=0 to 79 do begin { 80 small characters on one line }
  23.       for y:=0 to 3 do begin { 4 lines of big characters }
  24.         v:=memw[$b800:y*5*160+i*160+x+x];
  25.         memw[$b800:(i*5+20+y)*160+x+x]:=v;
  26.         chars[i,y*80+x]:=v;
  27.       end;
  28.     end;
  29.  
  30.   writeln(txtfile,'  chars:array[0..4,0..319] of word=(');
  31.   write(txtfile,'    ');
  32.   for y:=0 to 4 do begin { 5-line hi charset }
  33.     for x:=0 to 319 do begin { 320 bytes in one line }
  34.       write(txtfile,chars[y,x],',');
  35.       if x mod 10=9 then begin writeln(txtfile); write(txtfile,'    '); end;
  36.     end;
  37.     write(txtfile,'),(');
  38.   end;
  39.   writeln(txtfile,')');
  40.  
  41.   close(txtfile);
  42.   waitkey(0);
  43. end.
  44.