comparison src/vdp.h @ 11:04d8efe7a1f0

Initial stab at video output and background color rendering. Fixed address decoding in address port write handler.
author Michael Pavone <pavone@retrodev.com>
date Sun, 27 Mar 2016 17:36:02 -0700
parents 5176efdda5ae
children 04fc17376999
comparison
equal deleted inserted replaced
10:9f575f77a157 11:04d8efe7a1f0
1 #ifndef VDP_H_ 1 #ifndef VDP_H_
2 #define VDP_H_ 2 #define VDP_H_
3 3
4 typedef struct { 4 typedef struct {
5 uint16_t *framebuffer;
6 uint8_t *drawbuffer;
7 uint8_t *readbuffer;
5 uint32_t cycles; 8 uint32_t cycles;
6 uint32_t clock_inc; 9 uint32_t clock_inc;
10 int pitch;
7 11
8 uint16_t fifo; 12 uint16_t fifo;
9 uint16_t dest_offset; 13 uint16_t dest_offset;
10 uint16_t status; 14 uint16_t status;
11 15
14 18
15 uint16_t vscroll; 19 uint16_t vscroll;
16 uint16_t hscroll; 20 uint16_t hscroll;
17 21
18 uint16_t vram[32*512]; 22 uint16_t vram[32*512];
23 uint8_t linebuffers[320*2];
19 uint16_t sram[64*2]; 24 uint16_t sram[64*2];
20 uint16_t cram[64]; 25 uint16_t cram[64];
21 26
22 uint8_t fifo_dest; 27 uint8_t fifo_dest;
23 } vdp; 28 } vdp;
27 FIFO_DEST_VRAM, 32 FIFO_DEST_VRAM,
28 FIFO_DEST_SRAM, 33 FIFO_DEST_SRAM,
29 FIFO_DEST_CRAM 34 FIFO_DEST_CRAM
30 }; 35 };
31 36
32 #define VDP_STATUS_FIFO 1 37 #define VDP_STATUS_FIFO 1
33 #define VDP_STATUS_VRAM 2 38 #define VDP_STATUS_VRAM 2
34 #define VDP_STATUS_SRAM 4 39 #define VDP_STATUS_SRAM 4
40 #define VDP_STATUS_ENABLED 8
35 41
36 void vdp_init(vdp *context, uint32_t clock_div); 42 void vdp_init(vdp *context, uint32_t clock_div);
37 void vdp_run(vdp *context, uint32_t target); 43 void vdp_run(vdp *context, uint32_t target);
38 void vdp_write_address(vdp *context, uint16_t value); 44 void vdp_write_address(vdp *context, uint16_t value);
39 void vdp_write_data(vdp *context, uint16_t value); 45 void vdp_write_data(vdp *context, uint16_t value);