Category : Pascal Source Code
Archive   : TPAINT.ZIP
Filename : CONVERT.PAS

 
Output of file : CONVERT.PAS contained in archive : TPAINT.ZIP
(* **************************************************** *)
(* *)
(* CONVERT.PAS *)
(* *)
(* This Program will convert screens with headers, *)
(* such as those saved by PC Paint (uncompressed), *)
(* Polaroid Palette, and BASIC's BSave into files *)
(* that can be displayed directly in a Turbo Pascal *)
(* program. The basic idea is to load the file into *)
(* a Buffer and then move the bytes beyond the *)
(* header file to the color screen. *)
(* The usual offset is 7 (PC Paint) or 8 (Polaroid) *)
(* bytes. *)
(* This procedure may fail if the file size is less *)
(* than the array size declared for ScreenType. In *)
(* that case EOF will be encountered before expected. *)
(* ScreenType may be declared to be a smaller array *)
(* size (say, 16,191 bytes) and the program should *)
(* then work. *)
(* How nice it is to be able to use a paint program *)
(* to create screens for your Turbo Pascal programs! *)
(* *)
(* (c) Donald L. Pavia *)
(* Depatment of Chemistry *)
(* March 1986 Western Washington University *)
(* Bellingham, Washington 98225 *)
(* *)
(* **************************************************** *)


program ConvertScreens;

{----------------------------------------------------------------------------}
{$I LoadSave.Lib}
{----------------------------------------------------------------------------}

var FilName,NewName : str255;
Color,Pal,Bckg : integer;
ScrnMode,Save,Wait : char;
Buffer : ScreenType;

procedure ConvertScreen (FileName : str255; OffSet : byte);

var DisplayFile : ScreenFile;

begin
assign (DisplayFile,FileName);
reset (DisplayFile);
read (DisplayFile,Buffer);
close (DisplayFile);

move (Buffer[Offset],Screen,16200);
end;
{----------------------------------------------------------------------------}

begin
clrscr; writeln;
write (' Enter FileName of Disk File : '); readln (FilName);
writeln;
write (' (1) Med Res or (2) HiRes ? : '); readln (ScrnMode);

if ScrnMode = '1' then begin
write (' Choice of Palette (0..3) ? : '); readln (Pal);
write (' Background Color (0..15) ? : '); readln (Bckg);
writeln end;
if ScrnMode = '2' then begin
write (' Choice of HiResColor (0..15) ? : '); readln (Color);
writeln end;

write (' Give Byte Offset [0 (Turbo), 7 (PCPaint,BSave), 8 (PSaver)] : ');
read (Offset); writeln; writeln;

write (' Save Image to Disk with New Name? Y/N ? : ');
read (Kbd,Save); writeln;

if UpCase(Save) = 'Y' then
begin write (' New FileName : '); read (NewName) end;

writeln;
writeln (' Press to See Result !!!! ');
write (' Then Press Again to End Program ');
read (Kbd,Wait);

case ScrnMode of
'1' : begin Graphcolormode; Palette (Pal); GraphBackground (Bckg) end;
'2' : begin HiRes; HiResColor (Color) end;
end;

ConvertScreen (FilName,OffSet); read (Kbd,Wait);

if UpCase(Save) = 'Y' then SaveScreen (NewName);

TextMode (c80); clrscr;
end.


  3 Responses to “Category : Pascal Source Code
Archive   : TPAINT.ZIP
Filename : CONVERT.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/