Source code for /engineering/rendsite/test/source/2XTILE/XTILE21.HOriginal file XTILE21.H
   1 /*
   2 
   3  The C language include file XTile graphics manager
   4 
   5  COPYRIGHT (C) 1993  Erich P Gatejen   All Rights Reserved
   6 
   7 
   8  File: XTILE20!.H    	Written for the Turbo C compiler
   9 
  10 
  11 */
  12 
  13 
  14 /* Modes available */
  15 enum Modes { Xmode0 = 0, Xmode1, Xmode2, Xmode3, Xmode4,
  16 	     Xmode5, Xmode6, Xmode7, Xmode8, Xmode9, Xmode10,
  17 	     Xmode11  };
  18 
  19 
  20 /* Define Values									*/
  21 #define	PAGE0		0        /* Mode 0 page values                                  */
  22 #define	PAGE1		19200
  23 #define	BACKGROUND	38400
  24 #define	STORE		57600
  25 
  26 #define	NONE		0
  27 #define	FULL_PAGE	240
  28 #define UPLOADFONT	0
  29 #define DONTUPLOADFONT  1
  30 #define DONTMASK        0
  31 #define DOMASK		1
  32 #define NORMALPAGE	0
  33 #define SPLITPAGE       1
  34 
  35 #define   MOUSEOFFSET    ( 0xffff - 80 )
  36 #define   MOUSERELOAD    ( 0xffff - 16 )
  37 
  38 /* Set event mask */
  39 #define   XMOUSE_MOVE     1
  40 #define   XLEFT_BUTTON	  2
  41 #define   XLEFT_RELEASE   4
  42 #define   XRIGHT_BUTTON   8
  43 #define   XRIGHT_RELEASE  16
  44 
  45 /* Read events masks (BX) */
  46 #define   XLEFT_STATE     1  /* left button state 1=down */
  47 #define   XRIGHT_STATE    2
  48 
  49 
  50 
  51 void	XInit_Mode( int Mode );
  52 
  53 void	XSet_Write_Page( unsigned int  PageOffset, unsigned int  XSize );
  54 
  55 void	XSet_Display_Page( unsigned int	PageOffset,
  56 			   unsigned int XSize,
  57 			   unsigned int YSize,
  58 			   unsigned int ViewX,
  59 			   unsigned int ViewY	 );
  60 
  61 void	XSet_Display_PageP( unsigned int    PageOffset,
  62 			    unsigned int    XSize,
  63 			    unsigned int    YSize,
  64 			    unsigned int    ViewX,
  65 			    unsigned int    ViewY,
  66 			    unsigned int    Start,
  67 			    unsigned int    Number,
  68 			    unsigned char   far *Pal	      );
  69 
  70 
  71 int  XSet_View ( unsigned int  XLoc,
  72 	         unsigned int  YLoc		 );
  73 
  74 void XWait_Retrace( void );
  75 
  76 void XSet_SplitScreen(  int     NumLines );
  77 
  78 void XClear ( unsigned char	Color );
  79 
  80 void XSet_Box ( unsigned int	Start_X,
  81                 unsigned int	Start_Y,
  82 		unsigned int	Delta_X,
  83 		unsigned int	Delta_Y,
  84 		unsigned char	Color	);
  85 
  86 void XPut_Tile  ( unsigned int	Start_X,
  87 		  unsigned int	Start_Y,
  88 		  unsigned int	Delta_X,
  89 		  unsigned int	Delta_Y,
  90 		  unsigned char	far	*Data );
  91 
  92 void XPut_TileA ( unsigned int	Start_X,
  93 		  unsigned int	Start_Y,
  94 		  unsigned int	Delta_X,
  95 		  unsigned int	Delta_Y,
  96 		  unsigned char	far	*Data );
  97 
  98 
  99 int  XTile_Size ( unsigned int	Delta_X,
 100                   unsigned int	Delta_Y 	);
 101 
 102 void	XUpload_Tile (  unsigned int		Offset,
 103 				 unsigned int		Size,
 104 				 unsigned char far    *Data 	);
 105 
 106 void	XUpload_Sprite ( unsigned int		Offset,
 107 				  unsigned int		Size,
 108 				  unsigned char far    *Data 	);
 109 
 110 void	XPaste_Tile    (  unsigned int	Start_X,
 111 				   unsigned int	Start_Y,
 112 				   unsigned int	Delta_X,
 113 				   unsigned int	Delta_Y,
 114 				   unsigned int	Offset	);
 115 
 116 void	XPaste_Sprite  (  unsigned int	Start_X,
 117 				   unsigned int	Start_Y,
 118 				   unsigned int	Delta_X,
 119 				   unsigned int	Delta_Y,
 120 				   unsigned int	Offset	);
 121 
 122 void	XMove_Tile     (  unsigned int	Start_X,
 123 				   unsigned int	Start_Y,
 124 				   unsigned int	Delta_X,
 125 				   unsigned int	Delta_Y,
 126 				   unsigned int	New_X,
 127 				   unsigned int	New_Y	);
 128 
 129 void XPut_Tile_M    (  unsigned int	Start_X,
 130 				   unsigned int	Start_Y,
 131 				   unsigned int	Delta_X,
 132 				   unsigned int	Delta_Y,
 133 				   unsigned char	far	*Data );
 134 
 135 void XPut_TileA_M    (  unsigned int	Start_X,
 136 				   unsigned int	Start_Y,
 137 				   unsigned int	Delta_X,
 138 				   unsigned int	Delta_Y,
 139 				   unsigned char	far	*Data );
 140 
 141 int	XRegister_Font8 (  unsigned int		Offset,
 142 				    unsigned int		NumChars,
 143 				    unsigned int		Base_Char,
 144 				    unsigned int		Upload_Flag,
 145 				    unsigned char far    *Data 	);
 146 
 147 void	XChar8		(  unsigned int		X_Loc,
 148 				   unsigned int		Y_Loc,
 149 				   unsigned int 	     Character	);
 150 
 151 void Register_Font_Masks8 ( unsigned char	  far *Masks );
 152 
 153 void	XChar8_M		(  unsigned int		X_Loc,
 154 				   unsigned int		Y_Loc,
 155 				   unsigned int 	     Character	);
 156 
 157 void	XChar8_C		(  unsigned int		X_Loc,
 158 				   unsigned int		Y_Loc,
 159 				   unsigned int 	Character,
 160 				   unsigned int		Color		);
 161 
 162 
 163 void	XString8		(  unsigned int		X_Loc,
 164 				   unsigned int		Y_Loc,
 165 				   unsigned int		Mask_Flag,
 166 				   char 	 far *String	);
 167 
 168 void	XString8_C		(  unsigned int		X_Loc,
 169 				   unsigned int		Y_Loc,
 170 				   unsigned int		Color,
 171 				   char 	 far *String	);
 172 
 173 int	XRegister_Font4 (  unsigned int		Offset,
 174 				    unsigned int		NumChars,
 175 				    unsigned int		Base_Char,
 176 				    unsigned int		Upload_Flag,
 177 				    unsigned char far    *Data 	);
 178 
 179 void	XChar4		(  unsigned int		X_Loc,
 180 				   unsigned int		Y_Loc,
 181 				   unsigned int 	     Character	);
 182 
 183 void Register_Font_Masks4 ( unsigned char	  far *Masks );
 184 
 185 void	XChar4_M		(  unsigned int		X_Loc,
 186 				   unsigned int		Y_Loc,
 187 				   unsigned int 	     Character	);
 188 
 189 
 190 void	XChar4_C		(  unsigned int		X_Loc,
 191 				   unsigned int		Y_Loc,
 192 				   unsigned int 	Character,
 193 				   unsigned int		Color	);
 194 
 195 
 196 void	XString4		(  unsigned int		X_Loc,
 197 				   unsigned int		Y_Loc,
 198 				   unsigned int		Mask_Flag,
 199 				   char 	 far *String	);
 200 
 201 
 202 void	XString4_C		(  unsigned int		X_Loc,
 203 				   unsigned int		Y_Loc,
 204 				   unsigned int		Color,
 205 				   char 	 far *String	);
 206 
 207 void	XPaste_Tile_M  (  unsigned int	Start_X,
 208 				   unsigned int	Start_Y,
 209 				   unsigned int	Delta_X,
 210 				   unsigned int	Delta_Y,
 211 				   unsigned int	Offset,
 212 				   unsigned char    far *Mask );
 213 
 214 void	XPaste_Sprite_M (  unsigned int	Start_X,
 215 			   unsigned int	Start_Y,
 216 			   unsigned int	Delta_X,
 217 			   unsigned int	Delta_Y,
 218 			   unsigned int	Offset,
 219 			   unsigned char   far *Mask );
 220 
 221 void	XSet_Pal_Color  (  unsigned int	Color,
 222 			   unsigned int	Red,
 223 			   unsigned int	Green,
 224 			   unsigned int	Blue	     );
 225 
 226 void XSet_Pal_Block	(  unsigned int	Start,
 227 			   unsigned int	Number,
 228 			   unsigned char   far *Pal	      );
 229 
 230 int	XRegister_Mouse (  unsigned char   far	*PointerData,
 231 			   unsigned char   far *PointerMask,
 232 			   void		   far	*UserHandler  );
 233 
 234 void	XMouse_Active	(  unsigned int	 EventMask,
 235 			   unsigned int	 Start_X,
 236 			   unsigned int	 Start_Y,
 237 			   unsigned int	 InSplit	      );
 238 
 239 void	XMouse_InActive ( void );
 240 
 241 void	XMouse_ActiveS	(  unsigned int	 EventMask,
 242 			   unsigned int	 Start_X,
 243 			   unsigned int	 Start_Y	      );
 244 
 245 void	XMouse_InActiveS ( void );
 246 
 247 void    XWhere_Mouse     ( unsigned int  far *X,
 248                            unsigned int  far *Y  );
 249 
 250 
 251 /* Prototype for YOUR mouse handler routine.  DO NOT CALL.	*/
 252 /* You must create the actual function					*/
 253 void	XUser_MouseHndlr ( unsigned int	Mouse_X,
 254 			   unsigned int	Mouse_Y,
 255 			   unsigned int	Event_Mask  );
 256 
 257 void XPut_Pixel ( unsigned int	X_Location,
 258 		  unsigned int	Y_Location,
 259 		  unsigned int	Color	     );
 260 
 261 void XPut_Line  (  unsigned int	Start_X,
 262 		   unsigned int	Start_Y,
 263 		   unsigned int	End_X,
 264 		   unsigned int	End_Y,
 265 		   unsigned int	Color        );
 266 
 267 void XPut_Circle ( unsigned int Center_X,
 268                    unsigned int Center_Y,
 269                    unsigned int Radius,
 270                    unsigned int Color        );
 271 
 272 
 273 void XReload_TileW  (  unsigned int	Start_X,
 274 		       unsigned int	Start_Y,
 275 		       unsigned int	Delta_X,
 276 		       unsigned int	Delta_Y,
 277 		       unsigned int	Offset      );
 278 
 279 void XDownload_TileS (  unsigned int	Offset,
 280 			unsigned int	X_Size,
 281 			unsigned int	Y_Size,
 282 			unsigned char  *far Destination );
 283 
 284 void XDownload_TileP  (  unsigned int	Start_X,
 285 			 unsigned int	Start_Y,
 286 			 unsigned int	Delta_X,
 287 			 unsigned int	Delta_Y,
 288 			 unsigned char *far Destination );
 289 
 290 
 291 void XMove_TileA     (  unsigned int	Start_X,
 292 				   unsigned int	Start_Y,
 293 				   unsigned int	Delta_X,
 294 				   unsigned int	Delta_Y,
 295 				   unsigned int	New_X,
 296 				   unsigned int	New_Y	);
 297 
 298 void	XSet_AltPage( unsigned int  PageOffset, unsigned int  XSize );
 299 
 300 void    XPut_ScaledBitmap(  unsigned int	Dest_X,
 301 			    unsigned int	Dest_Y,
 302 			    unsigned int	New_X,
 303 			    unsigned int	New_Y,
 304 			    unsigned int        BMapSize_X,
 305 			    unsigned int        BMapSize_Y,
 306 			    unsigned char *far Destination	);
 307 
 308 void    XSet_Clip( 	    unsigned int	Left,
 309 			    unsigned int	Right,
 310 			    unsigned int	Top,
 311 			    unsigned int	Bottom		);