home *** CD-ROM | disk | FTP | other *** search
- /* header file for pcshow include files and variables */
-
- /* include statements */
-
- #include <stdio.h> /* standard i/o routines */
- #include <fcntl.h> /* other standard routines */
- #include <stdlib.h> /* more lattice c standard i/o routines */
- /*#include <tardev.h> /* targa header files */
- #include <math.h> /* some math functions needed */
- /*#include <time.h> /* some time functions needed */
- #include "df.h" /* header file with defines for HDF */
-
- #define MOUSE
- /* remove comments before compiling for mouse operation */
-
- /* define statements */
- #define TRUE 1
- #define FALSE 0
- #define HI 2
- #define LO 3
- #define SCRLLEFT 203
- #define SCRLUP 200
- #define SCRLDOWN 208
- #define SCRLRIGHT 205
- #define PAGEUP 201
- #define PAGEDOWN 209
- #define HOME 199
- #define END 207
- #define ALTSCRLUP 152
- #define ALTSCRLDOWN 160
- #define ALTSCRLLEFT 155
- #define ALTSCRLRIGHT 157
- #define ALTPAGEUP 153
- #define ALTPAGEDOWN 161
- #define ALTHOME 151
- #define ALTEND 159
- #define HDF 'h'
- #define RASTER 'b'
- #define NO9 '9'
- #define VGA 'v'
- #define EGA 'e'
- #define TARGA 't'
- #define RAWSIZE 32000 /* maximum size of the block to be read in from disk */
- #define LINEEGA egaline(xwhere,ywhere+i,store[i+yoff],max(min(xdim-xoff,maxx-xwhere),0),trans,xoff)
- /* call to print a line on the ega screen */
- #define LINEVGA vgaline1(xwhere,ywhere+i,store[i+yoff],xoff,max(min(maxx-xwhere,xdim-xoff),0))
- /* call to print a line on the vga screen */
- #define LINENO9 no9line(xwhere,ywhere+i,store[i+yoff],xoff,max(min(maxx-xwhere,xdim-xoff),0))
- /* call to print a line on the no. 9 screen */
- /*#define LINET16 t16line(xwhere,ywhere+i,store[i+yoff],xoff,max(min(maxx-xwhere,xdim-xoff),0))*/
- /* call to print a line on the Targa16 screen */
-
- /* define a bigger stack */
- int _STACK = 8192;
-
- /* regular variables defined */
-
- int i,j,k,l,c, /* temporary global counters and such */
- xdim,ydim, /* x & y dimensions for the image to be displayed */
- file, /* the file pointer for binary files */
- xoff=0,yoff=0, /* the offset into the picture to be displayed */
- palnum=0, /* the palette number which is currently displayed */
- show=0, /* a binary variable telling whether the palette is displayed on the screen */
- palmax=-1, /* the number of palettes in memory */
- maxx,maxy, /* the x & y dimensions of the screen */
- palspeed=0, /* how fast the palette rotates */
- lastref, /* the last reference number used in palette searching */
- lasttag, /* the last tag number used in searching for palettes */
- newref, /* reference number for a new palette */
- imref, /* the current image's reference number */
- imtag, /* the current image's tag number */
- slope, /* slope of line in fiddle mode */
- offset, /* offset for center of palette for fiddle mode */
- animate=0, /* the animation toggle */
- one_file=0, /* the one file animation toggle */
- first_hdf=1, /* boolean to flag the first time through an hdf animation */
- cycled=0, /* boolean variable to tell whether a sequence has been animated */
- oneimage=0, /* boolean variable to indicate whether there are multiple binary images to be displayed */
- xshow, /* the width of the image */
- m1,m2,m3,m4, /* mouse variables */
- leftbutton, /* boolean variables for buttons on the mouse */
- rightbutton,
- mouse=0, /* boolean variable to determine if the mouse is active */
- mx,my, /* last position where the mouse was at */
- pal_xoff=0, /* location of the upper left hand corner of the color bar */
- pal_yoff,
- screen=1, /* boolean variable for screen on or off */
- before=0, /* boolean variable for mouse activated previously */
- anispeed=0, /* speed for animation */
- doneinit=0, /* boolean variable to keep track of whether the palette has been initialized for ega mode */
- getout=0, /* boolean variable to exit program */
- pal_height, /* height in bytes of the color bar on the screen */
- expandit=1, /* preference boolean variable to expand(1) or interpolate(0) */
- center=0, /* boolean variable to specify a centered image */
- file_err, /* the error returned from file operations */
- file_attr, /* the file attribute to look for */
- xwhere=0,ywhere=0; /* where the upper left hand of the image is */
-
- #ifdef QAK
- long waitcount; /* counter for timing out */
- #endif
-
- unsigned short int l16[512]; /* array for the targa line */
-
- char *store[1024], /* one per line of image */
- *p, /* temporary character storage */
- mode, /* the display mode we are in = EGA,VGA,NO9,TARGA */
- filetype='h'; /* the type of file to be read = 'h,'b' */
-
- unsigned char rmap[256],gmap[256],bmap[256], /* the red, green, and blue bytes for 24 bit palettes */
- pal[768], /* the full 24 bit palette, interleaved as red, green, blue, red, green ... */
- *rpal[16],*gpal[16],*bpal[16], /* arrays of pointers to different palettes */
- *egapals[16], /* array of pointers to different ega palettes */
- raw[RAWSIZE], /* for file buffering */
- filename[128], /* name of binary image file */
- old_path[128], /* the name of the original path to restore when execution stops */
- drive[3], /* array to hold the name of the drive */
- path[64], /* array to hold the name of the path */
- node[9], /* array to hold the name of a node (drive:path\node.ext) */
- ext[4], /* array to hold the name of a file extension */
- palfile[128] = {0,0}, /* starts out = NULL */
- palstore[8][512], /* large array to store the portion of the screen the palette overlays */
- bigstore[4096]; /* array to expand four lines of imcomp compressed image into */
-
- unsigned char trans[256], /* translation table for palette in ega mode */
- trans1[256]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}, /* temporary translation table */
- count[64], /* the colors to choose from in ega mode */
- regrs[16]; /* the actual palette for ega mode */
-
- static unsigned char *mem_error="\nNot enough memory for image to be stored";
- extern unsigned char *DTAPTR; /* pointer to a DTA containing filenames to be found (located in dosio.asm) */
-
- FILE *fp, /* file pointer for binary image files */
- *pfp; /* file pointer for binary palette files */
-
- /* number nine variables */
- char *NO9ram;
- int *NO9bank; /* bank control registers */
-
- struct {
- int xdim,
- ydim;
- } dims; /* dimension structure for HDF dimension reads */
-
- /* HDF stuff */
- DF *dff; /* HDF file descriptor */
- DFdesc ddstr; /* HDF structure for the tag & ref of something */
-