Mercurial > repos > simple16
diff src/vdp.h @ 8:5176efdda5ae
Initial work on VDP emulation
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 27 Mar 2016 00:24:31 -0700 |
parents | |
children | 04d8efe7a1f0 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/vdp.h Sun Mar 27 00:24:31 2016 -0700 @@ -0,0 +1,41 @@ +#ifndef VDP_H_ +#define VDP_H_ + +typedef struct { + uint32_t cycles; + uint32_t clock_inc; + + uint16_t fifo; + uint16_t dest_offset; + uint16_t status; + + uint16_t vcounter; + uint16_t hcounter; + + uint16_t vscroll; + uint16_t hscroll; + + uint16_t vram[32*512]; + uint16_t sram[64*2]; + uint16_t cram[64]; + + uint8_t fifo_dest; +} vdp; + +enum { + FIFO_DEST_INVALID, + FIFO_DEST_VRAM, + FIFO_DEST_SRAM, + FIFO_DEST_CRAM +}; + +#define VDP_STATUS_FIFO 1 +#define VDP_STATUS_VRAM 2 +#define VDP_STATUS_SRAM 4 + +void vdp_init(vdp *context, uint32_t clock_div); +void vdp_run(vdp *context, uint32_t target); +void vdp_write_address(vdp *context, uint16_t value); +void vdp_write_data(vdp *context, uint16_t value); + +#endif //VDP_H_