6 #define vdp_setup_addr(type, addr) \
7 (VDP_CTL32 = ((type) | (((addr) & 0x3fff) << 16) | (((addr) >> 14) & 3)))
9 #define vdp_setreg(reg, val) \
10 (VDP_CTL = 0x8000 | ((reg) << 8) | (val))
12 #define vdp_wait_vblank() \
13 while(!(VDP_STAT & VDP_ST_VBLANK))
15 #define vdp_wait_vblank_end() \
16 while((VDP_STAT & VDP_ST_VBLANK))
19 (vdp_wait_vblank_end(), vdp_wait_vblank())
23 #define VDP_TILE_FG 0x8000
24 #define VDP_TILE_PAL(x) ((x) << 13)
25 #define VDP_TILE_VFLIP 0x1000
26 #define VDP_TILE_HFLIP 0x0800
27 #define VDP_TILE_HVFLIP (VDP_TILE_HFLIP | VDP_TILE_VFLIP)
28 #define VDP_TILENAME(tile, pal, flags) \
29 ((tile) | VDP_TILE_PAL(pal) | (flags))
31 #define VDP_ADDR2TILE(x) ((x) >> 5)
34 void vdp_setcolor(int pal, int cidx, int r, int g, int b);