# HG changeset patch # User Michael Pavone # Date 1503384596 25200 # Node ID da72344af3ffbc088a5b6075300c38e630e68f62 # Parent 40c3be9f1af70640f4a727a2ac799158526805d6 Fix external v counter when normal resolution interlace mode is active diff -r 40c3be9f1af7 -r da72344af3ff vdp.c --- a/vdp.c Mon Aug 21 23:08:36 2017 -0700 +++ b/vdp.c Mon Aug 21 23:49:56 2017 -0700 @@ -2957,9 +2957,13 @@ static uint16_t get_ext_vcounter(vdp_context *context) { - uint16_t line= context->vcounter & 0xFF; - if (context->double_res) { - line <<= 1; + uint16_t line= context->vcounter; + if (context->regs[REG_MODE_4] & BIT_INTERLACE) { + if (context->double_res) { + line <<= 1; + } else { + line &= 0x1FE; + } if (line & 0x100) { line |= 1; }