nuclear@4: #ifndef VDP_H_ nuclear@4: #define VDP_H_ nuclear@4: nuclear@4: #include nuclear@4: nuclear@4: #define VDP_PORT_DATA (*(volatile uint16_t*)0xc00000) nuclear@4: #define VDP_PORT_DATA32 (*(volatile uint32_t*)0xc00000) nuclear@4: #define VDP_PORT_CTL (*(volatile uint16_t*)0xc00004) nuclear@4: #define VDP_PORT_CTL32 (*(volatile uint32_t*)0xc00004) nuclear@4: #define VDP_PORT_HVCOUNT (*(volatile uint16_t*)0xc00008) nuclear@4: #define VDP_PORT_PSG (*(volatile uint16_t*)0xc00010) nuclear@4: nuclear@4: /* control register read flags */ nuclear@4: #define VDP_CTL_PAL_BIT 0x0001 nuclear@4: #define VDP_CTL_HBLANK_BIT 0x0002 nuclear@4: #define VDP_CTL_VBLANK_BIT 0x0004 nuclear@4: #define VDP_CTL_DT3_BIT 0x0008 nuclear@4: #define VDP_CTL_ODD_FRAME_BIT 0x0010 nuclear@4: #define VDP_CTL_COLIDE_BIT 0x0020 nuclear@4: #define VDP_CTL_SPRITE_OVF_BIT 0x0040 nuclear@4: #define VDP_CTL_FRAME_BIT 0x0080 nuclear@4: #define VDP_CTL_FIFO_FULL_BIT 0x0100 nuclear@4: #define VDP_CTL_FIFO_EMPTY_BIT 0x0200 nuclear@4: nuclear@4: /* control register write flags (RSET) */ nuclear@4: #define VDP_CTL_REGSEL_MASK 0x1f00 nuclear@4: #define VDP_CTL_DATA_MASK 0x00ff nuclear@4: nuclear@4: #define VDP_RSET(reg, val) \ nuclear@4: (0x8000 | (VDP_CTL_REGSEL_MASK & ((uint16_t)(reg) << 8)) | \ nuclear@4: (VDP_CTL_DATA_MASK & (uint16_t)(val))) nuclear@4: nuclear@4: #define VDP_MODE_WR_BIT 1 nuclear@4: nuclear@4: #define VDP_VRAM_WR 1 nuclear@4: #define VDP_CRAM_WR 3 nuclear@4: nuclear@4: #define VDP_ADDRSET(addr, mode) /* TODO */ nuclear@4: nuclear@4: nuclear@4: #endif /* VDP_H_ */