Mercurial > repos > simple16
annotate src/vdp.h @ 59:b15187a99d6f default tip
Add a command line option for printing out label addresses on the command line. Useful for debugging purposes.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 07 Sep 2016 23:15:27 -0700 |
parents | 6e7bfe83d2b0 |
children |
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 { |
11
04d8efe7a1f0
Initial stab at video output and background color rendering. Fixed address decoding in address port write handler.
Michael Pavone <pavone@retrodev.com>
parents:
8
diff
changeset
|
5 uint16_t *framebuffer; |
8
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 uint32_t cycles; |
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 uint32_t clock_inc; |
11
04d8efe7a1f0
Initial stab at video output and background color rendering. Fixed address decoding in address port write handler.
Michael Pavone <pavone@retrodev.com>
parents:
8
diff
changeset
|
8 int pitch; |
8
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 |
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 |
43
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
16 uint8_t vram[128*1024]; |
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
17 uint16_t cram[256]; |
19
04fc17376999
Sort of working tile rendering and tile test ROM
Michael Pavone <pavone@retrodev.com>
parents:
11
diff
changeset
|
18 |
43
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
19 uint16_t start_offset; |
22
407725d9a02f
Implemented sprite drawing. Added small sprite example.
Michael Pavone <pavone@retrodev.com>
parents:
19
diff
changeset
|
20 |
43
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
21 uint8_t top_skip; |
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
22 uint8_t bottom_skip; |
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
23 uint8_t pal_select; |
8
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 |
43
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
25 uint8_t pal_write_index; |
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
26 uint8_t pal_write_count; |
8
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 } vdp; |
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 |
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 |
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 void vdp_init(vdp *context, uint32_t clock_div); |
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 void vdp_run(vdp *context, uint32_t target); |
43
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
32 void vdp_write_mode(vdp *context, uint16_t value); |
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
33 void vdp_write_cram(vdp *context, uint16_t value); |
26
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
23
diff
changeset
|
34 uint32_t vdp_next_interrupt(vdp *context); |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
23
diff
changeset
|
35 void vdp_ack_interrupt(vdp *context); |
083347ccd508
Implemented vblank interrupts and fixed a bug in exception vector address calculation
Michael Pavone <pavone@retrodev.com>
parents:
23
diff
changeset
|
36 uint8_t vdp_interrupt_pending(vdp *context); |
43
6e7bfe83d2b0
Changed the design to vastly simplify the video hardware and support a 23-bit address space on the CPU
Michael Pavone <pavone@retrodev.com>
parents:
26
diff
changeset
|
37 uint8_t *vdp_get_back_buffer(vdp *context); |
8
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 |
5176efdda5ae
Initial work on VDP emulation
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 #endif //VDP_H_ |