comparison vdp.c @ 1273:6dedaa645843

Fix graphical corruption and sprite flickering introduced into some games by the last change for horizontal border support
author Michael Pavone <pavone@retrodev.com>
date Thu, 09 Mar 2017 19:23:24 -0800
parents be509813b2f2
children 34d3cb05014d
comparison
equal deleted inserted replaced
1272:be509813b2f2 1273:6dedaa645843
1495 context->vcounter = 0x1E5; 1495 context->vcounter = 0x1E5;
1496 } 1496 }
1497 } else if (context->vcounter == 0xDB) { 1497 } else if (context->vcounter == 0xDB) {
1498 context->vcounter = 0x1D5; 1498 context->vcounter = 0x1D5;
1499 } 1499 }
1500 context->vcounter &= 0x1FF;
1500 1501
1501 if (context->vcounter > context->inactive_start) { 1502 if (context->vcounter > context->inactive_start) {
1502 context->hint_counter = context->regs[REG_HINT]; 1503 context->hint_counter = context->regs[REG_HINT];
1503 } else if (context->hint_counter) { 1504 } else if (context->hint_counter) {
1504 context->hint_counter--; 1505 context->hint_counter--;
1515 if (context->vcounter == context->inactive_start) { 1516 if (context->vcounter == context->inactive_start) {
1516 context->frame++; 1517 context->frame++;
1517 } 1518 }
1518 context->vcounter &= 0x1FF; 1519 context->vcounter &= 0x1FF;
1519 } else { 1520 } else {
1520 if (context->vcounter == context->inactive_start) { 1521 if (context->vcounter == (context->inactive_start & 0x1FF)) {
1521 render_framebuffer_updated(context->flags2 & FLAG2_EVEN_FIELD ? FRAMEBUFFER_EVEN: FRAMEBUFFER_ODD, context->h40_lines > (context->inactive_start + context->border_top) / 2 ? LINEBUF_SIZE : (256+HORIZ_BORDER)); 1522 render_framebuffer_updated(context->flags2 & FLAG2_EVEN_FIELD ? FRAMEBUFFER_EVEN: FRAMEBUFFER_ODD, context->h40_lines > (context->inactive_start + context->border_top) / 2 ? LINEBUF_SIZE : (256+HORIZ_BORDER));
1522 if (context->double_res) { 1523 if (context->double_res) {
1523 context->flags2 ^= FLAG2_EVEN_FIELD; 1524 context->flags2 ^= FLAG2_EVEN_FIELD;
1524 } 1525 }
1525 context->fb = render_get_framebuffer(context->flags2 & FLAG2_EVEN_FIELD ? FRAMEBUFFER_EVEN : FRAMEBUFFER_ODD, &context->output_pitch); 1526 context->fb = render_get_framebuffer(context->flags2 & FLAG2_EVEN_FIELD ? FRAMEBUFFER_EVEN : FRAMEBUFFER_ODD, &context->output_pitch);
1526 context->h40_lines = 0; 1527 context->h40_lines = 0;
1527 context->frame++; 1528 context->frame++;
1528 } 1529 }
1529 context->vcounter &= 0x1FF;
1530 uint32_t output_line; 1530 uint32_t output_line;
1531 if (context->vcounter < context->inactive_start + context->border_bot) { 1531 if (context->vcounter < context->inactive_start + context->border_bot) {
1532 output_line = context->border_top + context->vcounter; 1532 output_line = context->border_top + context->vcounter;
1533 } else if (context->vcounter > 0x200 - context->border_top) { 1533 } else if (context->vcounter > 0x200 - context->border_top) {
1534 output_line = context->vcounter - (0x200 - context->border_top); 1534 output_line = context->vcounter - (0x200 - context->border_top);