home *** CD-ROM | disk | FTP | other *** search
- {$R-,S-}
- program pcxshow;
-
- uses
- PCXBIN;
-
- procedure grab_a_key;
- { Key result ends up in AX register }
- { Could be defined as function grab_a_key : Word }
- inline($CD/$28/ { INT 28 }
- $B4/$01/ { MOV AH, 01 }
- $CD/$16/ { INT 16 }
- $74/$F8/ { JZ -08 }
- $B4/$00/ { MOV AH, 00 }
- $CD/$16); { INT 16 }
-
-
- var
- OrigMode : Word;
- Pics : Byte;
- FileName : string;
-
- procedure ErrorMsg(Msg : string);
- begin
- DrawMode(OrigMode);
- WriteLn(Msg);
- end;
-
- (************************************************************************)
- (* This is where your converted picture file is linked into the program.*)
- (* Be sure to run BINOBJ with the parameters as follows *)
- (* BINOBJ picfile.pcx picfile.obj PicProc *)
- (* | | | *)
- (* | | --- Same as the procedure name *)
- (* your picture ^--to this--<-- *)
- (* file | *)
- (* procedure PicProc; external; | *)
- (* | *)
- (* {$L BUGSPIC.OBJ } >-- Change this -->- *)
- (* *)
- (* NOTE: Please remember the number of bytes translated by BINOBJ as *)
- (* I have not figured out a way to tell the filesize. *)
- (* This number is the second parameter passed to the Drawpic *)
- (* procedure. *)
- (************************************************************************)
-
- procedure PicProc; external;
- {$L BUGSPIC.OBJ }
-
- begin
- OrigMode := LastDrawMode;
- (**********************************************************************)
- (* Draw Picture using PicProc as file to load and 11351 as # of bytes *)
- (* to load *)
- (**********************************************************************)
- case DrawPic(@PicProc,11351) of
- NoError : ;
- IOError : ErrorMsg('IO Error occurred while reading '+FileName);
- BadFormat : ErrorMsg('I can''t identify '+FileName+' as graphical.');
- PaletteMissing : ErrorMsg('Palette File for '+FileName+' not found.');
- end;
-
- grab_a_key;
-
- DrawMode(OrigMode);
- end.