Mercurial > repos > simple16
comparison 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 |
comparison
equal
deleted
inserted
replaced
7:8f9a05e2e425 | 8:5176efdda5ae |
---|---|
1 #ifndef VDP_H_ | |
2 #define VDP_H_ | |
3 | |
4 typedef struct { | |
5 uint32_t cycles; | |
6 uint32_t clock_inc; | |
7 | |
8 uint16_t fifo; | |
9 uint16_t dest_offset; | |
10 uint16_t status; | |
11 | |
12 uint16_t vcounter; | |
13 uint16_t hcounter; | |
14 | |
15 uint16_t vscroll; | |
16 uint16_t hscroll; | |
17 | |
18 uint16_t vram[32*512]; | |
19 uint16_t sram[64*2]; | |
20 uint16_t cram[64]; | |
21 | |
22 uint8_t fifo_dest; | |
23 } vdp; | |
24 | |
25 enum { | |
26 FIFO_DEST_INVALID, | |
27 FIFO_DEST_VRAM, | |
28 FIFO_DEST_SRAM, | |
29 FIFO_DEST_CRAM | |
30 }; | |
31 | |
32 #define VDP_STATUS_FIFO 1 | |
33 #define VDP_STATUS_VRAM 2 | |
34 #define VDP_STATUS_SRAM 4 | |
35 | |
36 void vdp_init(vdp *context, uint32_t clock_div); | |
37 void vdp_run(vdp *context, uint32_t target); | |
38 void vdp_write_address(vdp *context, uint16_t value); | |
39 void vdp_write_data(vdp *context, uint16_t value); | |
40 | |
41 #endif //VDP_H_ |