comparison vdp.c @ 1121:1913f9c28003

Less broken Mode 4 implementation
author Michael Pavone <pavone@retrodev.com>
date Tue, 27 Dec 2016 12:43:37 -0800
parents e9369d6f0101
children d4bef26d0977
comparison
equal deleted inserted replaced
1120:e9369d6f0101 1121:1913f9c28003
1244 if (col || !(context->regs[REG_MODE_1] & BIT_COL0_MASK)) { 1244 if (col || !(context->regs[REG_MODE_1] & BIT_COL0_MASK)) {
1245 uint8_t *sprite_src = context->linebuf + col * 8; 1245 uint8_t *sprite_src = context->linebuf + col * 8;
1246 if (context->regs[REG_MODE_1] & BIT_SPRITE_8PX) { 1246 if (context->regs[REG_MODE_1] & BIT_SPRITE_8PX) {
1247 sprite_src += 8; 1247 sprite_src += 8;
1248 } 1248 }
1249 uint8_t *bg_src = context->tmp_buf_a + (((col & 1) * 8 + (context->hscroll_a & 0x7)) & 0x15); 1249 for (int i = 0; i < 8; i++, sprite_src++)
1250 for (int i = 0; i < 8; i++, bg_src++, sprite_src++)
1251 { 1250 {
1251 uint8_t *bg_src = context->tmp_buf_a + ((8 + i + col * 8 - (context->hscroll_a & 0x7)) & 15);
1252 if ((*bg_src & 0x4F) > 0x40) { 1252 if ((*bg_src & 0x4F) > 0x40) {
1253 //background plane has priority and is opaque 1253 //background plane has priority and is opaque
1254 if (context->debug) { 1254 if (context->debug) {
1255 *(dst++) = context->debugcolors[DBG_SRC_A]; 1255 *(dst++) = context->debugcolors[DBG_SRC_A];
1256 } else { 1256 } else {
1893 scan_sprite_table_mode4(context->vcounter, context);//Just a guess 1893 scan_sprite_table_mode4(context->vcounter, context);//Just a guess
1894 CHECK_LIMIT 1894 CHECK_LIMIT
1895 case 253: 1895 case 253:
1896 external_slot(context); 1896 external_slot(context);
1897 scan_sprite_table_mode4(context->vcounter, context);//Just a guess 1897 scan_sprite_table_mode4(context->vcounter, context);//Just a guess
1898 context->buf_a_off = 8;
1899 memset(context->tmp_buf_a, 0, 8);
1898 //reverse context slot counter so it counts the number of sprite slots 1900 //reverse context slot counter so it counts the number of sprite slots
1899 //filled rather than the number of available slots 1901 //filled rather than the number of available slots
1900 //context->slot_counter = MAX_SPRITES_LINE - context->slot_counter; 1902 //context->slot_counter = MAX_SPRITES_LINE - context->slot_counter;
1901 context->cur_slot = MAX_SPRITES_LINE_H32-1; 1903 context->cur_slot = MAX_SPRITES_LINE_H32-1;
1902 context->sprite_draws = MAX_DRAWS_H32_MODE4; 1904 context->sprite_draws = MAX_DRAWS_H32_MODE4;