# HG changeset patch # User Michael Pavone # Date 1502690341 25200 # Node ID 5e7e6d9b79ff0b855e4dba1dae667596129d4a05 # Parent 030b40139de97028c619e48197ac2f901b149944 Move vscroll latch further forward in H40 mode. Fixes a minor graphical glitch in Skitchin. Needs a proper test ROM to verify exact latch position diff -r 030b40139de9 -r 5e7e6d9b79ff vdp.c --- a/vdp.c Fri Aug 11 18:58:03 2017 -0700 +++ b/vdp.c Sun Aug 13 22:59:01 2017 -0700 @@ -926,7 +926,7 @@ } case VSRAM_WRITE: if (((start->address/2) & 63) < VSRAM_SIZE) { - //printf("VSRAM Write: %X to %X @ vcounter: %d, hslot: %d, cycle: %d\n", start->value, context->address, context->vcounter, context->hslot, context->cycles); + //printf("VSRAM Write: %X to %X @ frame: %d, vcounter: %d, hslot: %d, cycle: %d\n", start->value, start->address, context->frame, context->vcounter, context->hslot, context->cycles); if (start->partial == 3) { if (start->address & 1) { context->vsram[(start->address/2) & 63] &= 0xFF; @@ -2069,6 +2069,14 @@ for (;;) { case 165: + if (!(context->regs[REG_MODE_3] & BIT_VSCROLL)) { + //TODO: Develop some tests on hardware to see when vscroll latch actually happens for full plane mode + //See note in vdp_h32 for why this was originally moved out of read_map_scroll + //Skitchin' has a similar problem, but uses H40 mode. It seems to be able to hit the extern slot at 232 + //pretty consistently + context->vscroll_latch[0] = context->vsram[0]; + context->vscroll_latch[1] = context->vsram[1]; + } if (context->state == PREPARING) { uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F]; uint32_t *dst = context->output + (context->hslot - BG_START_SLOT) * 2; @@ -2162,12 +2170,6 @@ SPRITE_RENDER_H40(242) SPRITE_RENDER_H40(243) //provides "garbage" for border when plane A selected case 244: - if (!(context->regs[REG_MODE_3] & BIT_VSCROLL)) { - //TODO: Develop some tests on hardware to see when vscroll latch actually happens for full plane mode - //See note in vdp_h32 for why this was moved out of read_map_scroll - context->vscroll_latch[0] = context->vsram[0]; - context->vscroll_latch[1] = context->vsram[1]; - } address = (context->regs[REG_HSCROLL] & 0x3F) << 10; mask = 0; if (context->regs[REG_MODE_3] & 0x2) {