comparison vdp.c @ 710:4cd8823f79e3

First pass at emulating a vscroll latch. Titan's Overdrive demo seems to depend on the scroll value being latched early in the line before the HINT gets a chance to change it
author Michael Pavone <pavone@retrodev.com>
date Sat, 16 May 2015 23:04:57 -0700
parents 61faa298af07
children 3342548de036
comparison
equal deleted inserted replaced
709:3f065c20423c 710:4cd8823f79e3
655 } 655 }
656 if (context->double_res) { 656 if (context->double_res) {
657 vscroll <<= 1; 657 vscroll <<= 1;
658 vscroll |= 1; 658 vscroll |= 1;
659 } 659 }
660 vscroll &= (context->vsram[(context->regs[REG_MODE_3] & BIT_VSCROLL ? (column-2)&63 : 0) + vsram_off] + line); 660 //TODO: Further research on vscroll latch behavior and the "first column bug" seen in Gynoug
661 //this should be close, but won't match the exact behavior Eke-Eke has written about
662 if (column == 2 || (column && (context->regs[REG_MODE_3] & BIT_VSCROLL))) {
663 context->vscroll_latch[vsram_off] = context->vsram[column - 2 + vsram_off];
664 }
665 vscroll &= context->vscroll_latch[vsram_off] + line;
661 context->v_offset = vscroll & v_offset_mask; 666 context->v_offset = vscroll & v_offset_mask;
662 //printf("%s | line %d, vsram: %d, vscroll: %d, v_offset: %d\n",(vsram_off ? "B" : "A"), line, context->vsram[context->regs[REG_MODE_3] & 0x4 ? column : 0], vscroll, context->v_offset); 667 //printf("%s | line %d, vsram: %d, vscroll: %d, v_offset: %d\n",(vsram_off ? "B" : "A"), line, context->vsram[context->regs[REG_MODE_3] & 0x4 ? column : 0], vscroll, context->v_offset);
663 vscroll >>= vscroll_shift; 668 vscroll >>= vscroll_shift;
664 uint16_t hscroll_mask; 669 uint16_t hscroll_mask;
665 uint16_t v_mul; 670 uint16_t v_mul;