home *** CD-ROM | disk | FTP | other *** search
- program Vidtex3;
-
- {This program turns high-res CompuServe VidTex files into a screen
- picture, writing directly to memory for speed. Examples of such
- picture files can be found in the CB section (CB Pictures); simply
- download the characters as text until you hear a beep; then write
- to your file. Only one picture per file. Enter name of picture file
- at prompt on this program.}
-
-
- type
- vidrecord = record
- inchar : char;
- end;
-
- var
- vidfile : file of vidrecord;
- vidrec : vidrecord;
- vtxfile : string[15];
- count,i,j,bytewatch : integer;
- check,comp1 : string[6];
- toggle,pix, inbyte,incount : byte;
- bytecount,bytetoggle:integer;
-
- procedure PutByte(thisone:byte);
-
- begin
-
- bytewatch := bytewatch+1;
- if bytewatch = 64 then
- begin
- if bytetoggle = 8192 then bytecount := bytecount + 80;
- bytewatch := 0;
- bytetoggle:=8192-bytetoggle;
- end;
- Mem[$b800:bytecount+bytetoggle+bytewatch]:=thisone;
- end;
-
- begin
- Write('Which file ? ');
- readln(vtxfile);
- check := ' ';
- assign(vidfile,vtxfile);
- reset(vidfile);
- GraphMode;
- count := -1;
- comp1 := char(27)+'GH';
- while not (check = comp1) do
- begin
- count := count + 1;
- seek(vidfile,count);
- read(vidfile,vidrec);
- with vidrec do
- begin
- check := copy(check,1,3) + inchar;
- check := copy(check,2,3);
- end;
- end;
- reset(vidfile);
- toggle := 3;
- inbyte :=0;
- incount := 0;
- bytewatch := -1;
- bytetoggle :=0;
- bytecount :=0;
- for i := count + 1 to filesize(vidfile)-1 do
- begin
- seek(vidfile,i);
- read(vidfile,vidrec);
- toggle := 3-toggle;
- with vidrec do
- begin
- pix := ord(inchar);
- for j:= 1 to pix-32 do
- begin
- incount := incount +1;
- inbyte := (inbyte shl 2)+toggle;
- if incount=4 then
- begin
- incount :=0;
- PutByte(inbyte);
- inbyte :=0;
- end;
-
- end;
-
- end;
- end;
- while keypressed = false do
- begin end;
- end.
- nb