Category : C Source Code
Archive   : IMDSRC78.ZIP
Filename : IMDEF.H

 
Output of file : IMDEF.H contained in archive : IMDSRC78.ZIP
/**** IMDEF.H

Header file for IMDEF.H
Built by A. Warnock, ST Systems Corp., NASA/GSFC 5/90
This file contains only the various defined symbols for IMDISP
and it's associated modules.

****/

/* * * * External Function Prototypes * * * */


/* * * * External Global Variables * * * */
/*
This is the structure for the color palette.
The current palette is stored in PaletteTable.
*/
typedef struct Color
{
unsigned char r, g, b;
} Color ;

typedef struct Buffer
{
int location;
int handle;
int dispns;
int dispnl;
char file[80];
} Buffer;

/* * * * External Global Symbols * * * */

#define ALLOC_DTA 26 /* MS-DOS Int 21h Service */
#define CONTROL_LEFT_ARROW 243 /* Extended ASCII code */
#define CONTROL_RIGHT_ARROW 244 /* Extended ASCII code */
#define CURSORSIZE 9 /* The size of the cursor box square */
#define DOWN_ARROW 208 /* Extended ASCII code */
#define DOWN_LEFT_ARROW 207 /* Extended ASCII code */
#define DOWN_RIGHT_ARROW 209 /* Extended ASCII code */
#define END 207 /* Extended ASCII code */
#define ESCAPE 27 /* ASCII code */
#define FALSE 0
#define FREE 1 /* FREE block indicator */
#define GET_CUR_DIR 0x47 /* MS-DOS Int 21h Service */
#define HELP 63
#define HOME 199 /* Extended ASCII code */
#define INC 32
#define ImBufMax 30720 /* Size of the buffer for each open file */
/* the possible logical block sizes */
/* Buffer must be integral number of times */
#define LEFT_ARROW 203 /* Extended ASCII code */
#define LabelBufferLen 12288 /* Amount of label read in to parse */
#define MAXBATCHFILES 10 /* Max # of open batch files */
#define MAXBLOCK 0xffff /* Maximum block size */
#define MAXBUFFERS 26 /* Maximum buffers */
#define MAXDISPNL 768 /* The maximum number of lines of all displays */
#define MAXDISPNS 1024 /* The maximum number of samples of all displays */
#define MAXFONTSTROKES 3000 /* The size of the text font array */
#define MAXNUMFILES 512
#define MAXRECALL 20 /* Max commands to be recalled */
#define MINALLOC 128 /* Minimum MBSize value */
#define MINUSSTEP 45 /* ASCII code */
#define MaxNumImages 3 /* Maximum number of open images */
#define MaxOpenFiles 10 /* Maximum number of open files at one time */
#define NALLOC 16 /* Number of bytes per paragraph */
#define NCOMMANDS 45 /* Number of IMDISP commands */
#define PAGELEN dispnl/20
#define PLUSSTEP 43 /* ASCII code */
#define P_DATA 0x3c9 /* VGA Palette Data port */
#define P_READ 0x3c7 /* VGA Palette Read port */
#define P_WRITE 0x3c8 /* VGA Palette Write port */
#define RETURN 13 /* ASCII code */
#define RIGHT_ARROW 205 /* Extended ASCII code */
#define SELECT_ITEM 13 /* ASCII code */
#define SEL_DRIVE 14 /* MS-DOS Int 21h Service */
#define SRCH_FIRST 78 /* MS-DOS Int 21h Service */
#define SRCH_NEXT 79 /* MS-DOS Int 21h Service */
#define TRUE 1
#define UP_ARROW 200 /* Extended ASCII code */
#define UP_LEFT_ARROW 199 /* Extended ASCII code */
#define UP_RIGHT_ARROW 201 /* Extended ASCII code */
#define WHAT_DRIVE 25 /* MS-DOS Int 21h Service */
#define X_DIR 59 /* MS-DOS Int 21h Service */

#define DISPMAXNUM (3*(dispnl/(TextHeight+5)-5))
#define MAXALLOC NALLOC * ( ( MAXBLOCK-HSIZE-SSIZE ) / NALLOC )
#define SSIZE sizeof ( SUNIT ) /* Size of SUNIT */

/* Used to define where the refresh buffer resides - Ron Baalke - 05/04/91 */

#define NOWHERE -3
#define IMAGE -2
#define SCREEN -1
#define VIRTUAL_FILE 1
#define EXTENDED_MEMORY 2
#define EXPANDED_MEMORY 3


/* Used to define the file format type when saving an image */
/* Ron Baalke 02/15/92 */

#define PDS_FORMAT 0
#define GIF_FORMAT 1
#define RAW_FORMAT 2

/* * * * External Global Functions * * * */

#define Round(x) ( ((x) > 0.0) ? (int)((x)+0.5) : (int)((x)-0.5) )
#define READ_PALETTE(index,r,g,b){outp(P_READ,index);r=inp(P_DATA);g=inp(P_DATA);b=inp(P_DATA);}
#define SET_PALETTE(index,r,g,b) {outp(P_WRITE,index);outp(P_DATA,r);outp(P_DATA,g);outp(P_DATA,b);}


  3 Responses to “Category : C Source Code
Archive   : IMDSRC78.ZIP
Filename : IMDEF.H

  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/