comparison vdp.c @ 24:30ae73f96267

Partially fix BG plane B
author Mike Pavone <pavone@retrodev.com>
date Sat, 08 Dec 2012 16:09:43 -0800
parents 3e924bb56560
children 4d0c20ad815a
comparison
equal deleted inserted replaced
23:3e924bb56560 24:30ae73f96267
127 void external_slot(vdp_context * context) 127 void external_slot(vdp_context * context)
128 { 128 {
129 //TODO: Implement me 129 //TODO: Implement me
130 } 130 }
131 131
132 void read_map_scroll(uint16_t column, uint32_t line, uint32_t scroll_reg, uint16_t hscroll_val, vdp_context * context) 132 void read_map_scroll(uint16_t column, uint32_t line, uint16_t address, uint16_t hscroll_val, vdp_context * context)
133 { 133 {
134 uint16_t address = (context->regs[scroll_reg] & 0x38) << 10;
135 uint16_t vscroll; 134 uint16_t vscroll;
136 switch(context->regs[REG_SCROLL] & 0x30) 135 switch(context->regs[REG_SCROLL] & 0x30)
137 { 136 {
138 case 0: 137 case 0:
139 vscroll = 0xFF; 138 vscroll = 0xFF;
184 context->col_2 = (context->vdpmem[offset] << 8) | context->vdpmem[offset+1]; 183 context->col_2 = (context->vdpmem[offset] << 8) | context->vdpmem[offset+1];
185 } 184 }
186 185
187 void read_map_scroll_a(uint16_t column, uint32_t line, vdp_context * context) 186 void read_map_scroll_a(uint16_t column, uint32_t line, vdp_context * context)
188 { 187 {
189 read_map_scroll(column, line, REG_SCROLL_A, context->hscroll_a, context); 188 read_map_scroll(column, line, (context->regs[REG_SCROLL_A] & 0x38) << 10, context->hscroll_a, context);
190 } 189 }
191 190
192 void read_map_scroll_b(uint16_t column, uint32_t line, vdp_context * context) 191 void read_map_scroll_b(uint16_t column, uint32_t line, vdp_context * context)
193 { 192 {
194 read_map_scroll(column, line, REG_SCROLL_B, context->hscroll_b, context); 193 read_map_scroll(column, line, (context->regs[REG_SCROLL_B] & 0x7) << 13, context->hscroll_b, context);
195 } 194 }
196 195
197 void render_map(uint16_t col, uint8_t * tmp_buf, vdp_context * context) 196 void render_map(uint16_t col, uint8_t * tmp_buf, vdp_context * context)
198 { 197 {
199 uint16_t address = ((col & 0x3FF) << 5); 198 uint16_t address = ((col & 0x3FF) << 5);