comparison vdp.h @ 413:36fbbced25c2

Initial work on interlace
author Mike Pavone <pavone@retrodev.com>
date Sat, 22 Jun 2013 21:19:43 -0700
parents f8c6f8684cd6
children 7e8e179116af
comparison
equal deleted inserted replaced
412:00d5a2b532f4 413:36fbbced25c2
65 REG_DMASRC_L, 65 REG_DMASRC_L,
66 REG_DMASRC_M, 66 REG_DMASRC_M,
67 REG_DMASRC_H 67 REG_DMASRC_H
68 } vdp_regs; 68 } vdp_regs;
69 69
70 //Mode reg 1
71 #define BIT_HINT_EN 0x10
72 #define BIT_PAL_SEL 0x04
73 #define BIT_HVC_LATCH 0x02
74 #define BIT_DISP_DIS 0x01
75
76 //Mode reg 2
77 #define BIT_DISP_EN 0x40
78 #define BIT_VINT_EN 0x20
79 #define BIT_DMA_ENABLE 0x10
80 #define BIT_PAL 0x08
81 #define BIT_MODE_5 0x04
82
83 //Mode reg 3
84 #define BIT_EINT_EN 0x10
85 #define BIT_VSCROLL 0x04
86
87 //Mode reg 4
88 #define BIT_H40 0x01
89 #define BIT_HILIGHT 0x8
90 #define BIT_DOUBLE_RES 0x4
91 #define BIT_INTERLACE 0x2
92
70 typedef struct { 93 typedef struct {
71 uint16_t address; 94 uint16_t address;
72 int16_t x_pos; 95 int16_t x_pos;
73 uint8_t pal_priority; 96 uint8_t pal_priority;
74 uint8_t h_flip; 97 uint8_t h_flip;
100 uint8_t *vdpmem; 123 uint8_t *vdpmem;
101 //stores 2-bit palette + 4-bit palette index + priority for current sprite line 124 //stores 2-bit palette + 4-bit palette index + priority for current sprite line
102 uint8_t *linebuf; 125 uint8_t *linebuf;
103 //stores 12-bit color + shadow/highlight bits 126 //stores 12-bit color + shadow/highlight bits
104 uint16_t *framebuf; 127 uint16_t *framebuf;
128 uint16_t *oddbuf;
129 uint16_t *evenbuf;
105 uint16_t cram[CRAM_SIZE]; 130 uint16_t cram[CRAM_SIZE];
106 uint16_t vsram[VSRAM_SIZE]; 131 uint16_t vsram[VSRAM_SIZE];
107 uint8_t latched_mode; 132 uint8_t latched_mode;
108 uint16_t hscroll_a; 133 uint16_t hscroll_a;
109 uint16_t hscroll_b; 134 uint16_t hscroll_b;
118 uint16_t dma_val; 143 uint16_t dma_val;
119 uint8_t v_offset; 144 uint8_t v_offset;
120 uint8_t dma_cd; 145 uint8_t dma_cd;
121 uint8_t hint_counter; 146 uint8_t hint_counter;
122 uint8_t flags2; 147 uint8_t flags2;
148 uint8_t double_res;
123 uint8_t *tmp_buf_a; 149 uint8_t *tmp_buf_a;
124 uint8_t *tmp_buf_b; 150 uint8_t *tmp_buf_b;
125 } vdp_context; 151 } vdp_context;
126 152
127 void init_vdp_context(vdp_context * context); 153 void init_vdp_context(vdp_context * context);