annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #ifndef VDP_H_
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 #define VDP_H_
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 typedef struct {
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 uint32_t cycles;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 uint32_t clock_inc;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8 uint16_t fifo;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 uint16_t dest_offset;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 uint16_t status;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 uint16_t vcounter;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 uint16_t hcounter;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15 uint16_t vscroll;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 uint16_t hscroll;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18 uint16_t vram[32*512];
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 uint16_t sram[64*2];
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
20 uint16_t cram[64];
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
21
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
22 uint8_t fifo_dest;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
23 } vdp;
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
24
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
25 enum {
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
26 FIFO_DEST_INVALID,
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
27 FIFO_DEST_VRAM,
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
28 FIFO_DEST_SRAM,
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
29 FIFO_DEST_CRAM
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
30 };
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
31
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
32 #define VDP_STATUS_FIFO 1
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
33 #define VDP_STATUS_VRAM 2
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
34 #define VDP_STATUS_SRAM 4
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
35
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
36 void vdp_init(vdp *context, uint32_t clock_div);
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
37 void vdp_run(vdp *context, uint32_t target);
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
38 void vdp_write_address(vdp *context, uint16_t value);
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
39 void vdp_write_data(vdp *context, uint16_t value);
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
40
5176efdda5ae Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
41 #endif //VDP_H_