comparison vdp.h @ 652:f822d9216968

Merge
author Michael Pavone <pavone@retrodev.com>
date Tue, 30 Dec 2014 19:11:34 -0800
parents 66cc60215e5c
children 4996369f1463
comparison
equal deleted inserted replaced
620:9d6fed6501ba 652:f822d9216968
47 47
48 #define FLAG2_VINT_PENDING 0x01 48 #define FLAG2_VINT_PENDING 0x01
49 #define FLAG2_HINT_PENDING 0x02 49 #define FLAG2_HINT_PENDING 0x02
50 #define FLAG2_READ_PENDING 0x04 50 #define FLAG2_READ_PENDING 0x04
51 #define FLAG2_SPRITE_COLLIDE 0x08 51 #define FLAG2_SPRITE_COLLIDE 0x08
52 #define FLAG2_REGION_PAL 0x10
52 53
53 #define DISPLAY_ENABLE 0x40 54 #define DISPLAY_ENABLE 0x40
54 55
55 enum { 56 enum {
56 REG_MODE_1=0, 57 REG_MODE_1=0,
140 void *evenbuf; 141 void *evenbuf;
141 uint16_t cram[CRAM_SIZE]; 142 uint16_t cram[CRAM_SIZE];
142 uint32_t colors[CRAM_SIZE*3]; 143 uint32_t colors[CRAM_SIZE*3];
143 uint32_t debugcolors[1 << (3 + 1 + 1 + 1)];//3 bits for source, 1 bit for priority, 1 bit for shadow, 1 bit for hilight 144 uint32_t debugcolors[1 << (3 + 1 + 1 + 1)];//3 bits for source, 1 bit for priority, 1 bit for shadow, 1 bit for hilight
144 uint16_t vsram[VSRAM_SIZE]; 145 uint16_t vsram[VSRAM_SIZE];
145 uint8_t latched_mode; 146 uint16_t vcounter;
147 uint16_t hslot; //hcounter/2
146 uint16_t hscroll_a; 148 uint16_t hscroll_a;
147 uint16_t hscroll_b; 149 uint16_t hscroll_b;
150 uint8_t latched_mode;
148 uint8_t sprite_index; 151 uint8_t sprite_index;
149 uint8_t sprite_draws; 152 uint8_t sprite_draws;
150 int8_t slot_counter; 153 int8_t slot_counter;
151 int8_t cur_slot; 154 int8_t cur_slot;
152 sprite_draw sprite_draw_list[MAX_DRAWS]; 155 sprite_draw sprite_draw_list[MAX_DRAWS];
165 uint8_t debug; 168 uint8_t debug;
166 uint8_t *tmp_buf_a; 169 uint8_t *tmp_buf_a;
167 uint8_t *tmp_buf_b; 170 uint8_t *tmp_buf_b;
168 } vdp_context; 171 } vdp_context;
169 172
170 void init_vdp_context(vdp_context * context); 173 void init_vdp_context(vdp_context * context, uint8_t region_pal);
171 void vdp_run_context(vdp_context * context, uint32_t target_cycles); 174 void vdp_run_context(vdp_context * context, uint32_t target_cycles);
172 //runs from current cycle count to VBLANK for the current mode, returns ending cycle count 175 //runs from current cycle count to VBLANK for the current mode, returns ending cycle count
173 uint32_t vdp_run_to_vblank(vdp_context * context); 176 uint32_t vdp_run_to_vblank(vdp_context * context);
174 //runs until the target cycle is reached or the current DMA operation has completed, whicever comes first 177 //runs until the target cycle is reached or the current DMA operation has completed, whicever comes first
175 void vdp_run_dma_done(vdp_context * context, uint32_t target_cycles); 178 void vdp_run_dma_done(vdp_context * context, uint32_t target_cycles);
188 uint32_t vdp_next_vint_z80(vdp_context * context); 191 uint32_t vdp_next_vint_z80(vdp_context * context);
189 void vdp_int_ack(vdp_context * context, uint16_t int_num); 192 void vdp_int_ack(vdp_context * context, uint16_t int_num);
190 void vdp_print_sprite_table(vdp_context * context); 193 void vdp_print_sprite_table(vdp_context * context);
191 void vdp_print_reg_explain(vdp_context * context); 194 void vdp_print_reg_explain(vdp_context * context);
192 void latch_mode(vdp_context * context); 195 void latch_mode(vdp_context * context);
196 uint32_t vdp_cycles_to_frame_end(vdp_context * context);
193 197
194 extern int32_t color_map[1 << 12]; 198 extern int32_t color_map[1 << 12];
195 199
196 #endif //VDP_H_ 200 #endif //VDP_H_