1 #ifndef _SPRITE_H_
2 #define _SPRITE_H_
3 
4 #include "pce.h"
5 #include "cleantyp.h"
6 #include "mix.h"
7 
8 typedef	struct {
9 	short y,x,no,atr;
10 } SPR;
11 /* Sprite structure
12  * y,x = pos
13  * no = address of the pattern in the Video ram
14  * atr = attributes
15  * bit 0-4 : number of the palette to be used
16  * bit 7 : background sprite
17  *          0 -> must be drawn behind tiles
18  *          1 -> must be drawn in front of tiles
19  * bit 8 : width
20  *          0 -> 16 pixels
21  *          1 -> 32 pixels
22  * bit 11 : horizontal flip
23  *          0 -> normal shape
24  *          1 -> must be draw horizontaly flipped
25  * bit 13-12 : heigth
26  *          00 -> 16 pixels
27  *          01 -> 32 pixels
28  *          10 -> 48 pixels
29  *          11 -> 64 pixels
30  * bit 15 : vertical flip
31  *          0 -> normal shape
32  *          1 -> must be drawn verticaly flipped
33  */
34 
35 extern UChar BGONSwitch;
36 /* do we have to draw background ? */
37 
38 extern UChar SPONSwitch;
39 /* Do we have to draw sprites ? */
40 
41 #define	PAL(c)	R[c]
42 #define	SPal	(Pal+256)
43 
44 #define	MinLine	io.minline
45 #define	MaxLine	io.maxline
46 
47 //#define ScrollX	io.scroll_x
48 //#define ScrollY io.scroll_y
49 #define	ScrollX	io.VDC[BXR].W
50 #define	ScrollY	io.VDC[BYR].W
51 extern int	ScrollYDiff;
52 
53 extern int	oldScrollX;
54 extern int	oldScrollY;
55 extern int	oldScrollYDiff;
56 
57 extern UInt32 spr_init_pos[1024];
58 // cooked initial position of sprite
59 
60 #if !defined(NEW_GFX_ENGINE)
61 extern UChar SPM[WIDTH*HEIGHT];
62 #endif
63 
64 /*
65 ####################################
66 ####################################
67 ####################################
68 ####################################
69 2KILL :: BEGIN
70 ####################################
71 ####################################
72 ####################################
73 ####################################
74 */
75 #ifdef ALLEGRO
76 
77 extern BITMAP* dirty_spr[0x20000/32];
78 // Used for precalculation of sprites, VRAMSIZE/32 is for # of sprite
79 
80 #endif
81 /*
82 ####################################
83 ####################################
84 ####################################
85 ####################################
86 2KILL :: END
87 ####################################
88 ####################################
89 ####################################
90 ####################################
91 */
92 
93 extern char exact_putspritem;
94 // do we use a slow but precise function to draw certain sprites
95 
96 extern int frame;
97 // number of frame displayed
98 
99 //extern void (*PutSpriteMaskedFunction)(byte *P,byte *C,unsigned	long *C2,byte *R,int h,int inc,byte *M,byte pr);
100 // the general function for *masked
101 
102 //extern void (*PutSpriteMakeMaskedFunction)(byte *P,byte *C,unsigned	long *C2,byte *R,int h,int inc,byte *M,byte pr);
103 // the general function for *makemasked*
104 
105 //extern void PutSpriteM(byte *P,byte *C,unsigned	long *C2,byte *R,int h,int inc,byte *M,byte pr);
106 // the exact function
107 
108 //extern void PutSpriteMakeMask(byte *P,byte *C,unsigned	long *C2,byte *R,int h,int inc,byte *M,byte pr);
109 // the exact function
110 
111 //extern void PutSprite(byte *P,byte *C,unsigned	long *C2,byte *R,int h,int inc);
112 // the simplified function
113 
114 extern void RefreshSpriteExact(int,int,unsigned char);
115 // The true refreshing function
116 
117 extern void (*RefreshSprite)(int Y1,int Y2,unsigned char bg);
118 // The pointer toward the used function
119 
120 #endif
121