Mercurial > repos > blastem
diff vdp.h @ 54:3b79cbcf6846
Get Flavio's color bar demo kind of sort of working
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 18 Dec 2012 02:16:42 -0800 |
parents | 3fc57e1a2c56 |
children | a28b1dfe1af2 |
line wrap: on
line diff
--- a/vdp.h Sun Dec 16 22:25:29 2012 -0800 +++ b/vdp.h Tue Dec 18 02:16:42 2012 -0800 @@ -26,6 +26,8 @@ #define FBUF_SRC_S 0x6000 #define FBUF_SRC_BG 0x8000 +#define MCLKS_LINE 3420 + enum { REG_MODE_1=0, REG_MODE_2, @@ -58,6 +60,17 @@ } sprite_info; typedef struct { + uint32_t cycle; + uint16_t value; + uint8_t partial; +} fifo_entry; + +typedef struct { + fifo_entry *fifo_cur; + fifo_entry *fifo_end; + uint16_t address; + uint8_t cd; + uint8_t flags; //cycle count in MCLKs uint32_t cycles; uint8_t *vdpmem; @@ -80,7 +93,6 @@ uint16_t col_1; uint16_t col_2; uint8_t v_offset; - uint8_t flags; uint8_t *tmp_buf_a; uint8_t *tmp_buf_b; } vdp_context; @@ -90,5 +102,9 @@ //runs from current cycle count to VBLANK for the current mode, returns ending cycle count uint32_t vdp_run_to_vblank(vdp_context * context); void vdp_load_savestate(vdp_context * context, FILE * state_file); +void vdp_control_port_write(vdp_context * context, uint16_t value); +void vdp_data_port_write(vdp_context * context, uint16_t value); +uint16_t vdp_control_port_read(vdp_context * context); +uint16_t vdp_data_port_read(vdp_context * context); #endif //VDP_H_