fixed nametab.B invalid address, and spr_submit with 0 sprites
[mdlife] / src / sprite.h
1 #ifndef SPRITE_H_
2 #define SPRITE_H_
3
4 #include <stdint.h>
5
6 struct hwsprite {
7         uint16_t y;
8         uint8_t sz;
9         uint8_t next;
10         uint16_t tile;
11         uint16_t x;
12 } __attribute__((packed, aligned(2)));
13
14 #define SPR_SIZE(x, y)  ((((x) - 1) << 2) | ((y) - 1))
15
16 #define MAX_HWSPRITES   64
17 extern struct hwsprite spr_shadow[MAX_HWSPRITES];
18 extern short spr_count;
19
20 void spr_begin(void);
21 void spr_add(int x, int y, unsigned int tile, int sprsz);
22 void spr_submit(void);
23
24 #endif  /* SPRITE_H_ */