foo
[mdlife] / src / vdp.h
1 #ifndef VDP_H_
2 #define VDP_H_
3
4 #include "hwregs.h"
5
6 #define vdp_setup_addr(type, addr) \
7         (VDP_CTL32 = ((type) | (((addr) & 0x3fff) << 16) | (((addr) >> 14) & 3)))
8
9 #define vdp_setreg(reg, val) \
10         (VDP_CTL = 0x8000 | ((reg) << 8) | (val))
11
12 #define VDP_TILE_BG                     0
13 #define VDP_TILE_FG                     0x8000
14 #define VDP_TILE_PAL(x)         ((x) << 13)
15 #define VDP_TILE_VFLIP          0x1000
16 #define VDP_TILE_HFLIP          0x0800
17 #define VDP_TILENAME(tile, pal, flags)  \
18         ((tile) | VDP_TILE_PAL(pal) | (flags))
19
20 void vdp_init(void);
21 void vdp_setcolor(int pal, int cidx, int r, int g, int b);
22
23 #endif  /* VDP_H_ */