#include "hwregs.h"
-#define VDP_VRAM 0x40000000
-#define VDP_CRAM 0xc0000000
-#define VDP_VSRAM 0x40000010
-
#define vdp_setup_addr(type, addr) \
(VDP_CTL32 = ((type) | (((addr) & 0x3fff) << 16) | (((addr) >> 14) & 3)))
#define vdp_setreg(reg, val) \
(VDP_CTL = 0x8000 | ((reg) << 8) | (val))
+#define VDP_TILE_BG 0
+#define VDP_TILE_FG 0x8000
+#define VDP_TILE_PAL(x) ((x) << 13)
+#define VDP_TILE_VFLIP 0x1000
+#define VDP_TILE_HFLIP 0x0800
+#define VDP_TILENAME(tile, pal, flags) \
+ ((tile) | VDP_TILE_PAL(pal) | (flags))
+
void vdp_init(void);
void vdp_setcolor(int pal, int cidx, int r, int g, int b);