From f46eaaf8651d2c763de76ce82999d9d7e1230719 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 21 Aug 2017 23:49:56 -0700 Subject: Fix external v counter when normal resolution interlace mode is active --- vdp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index 06685be..54f2a1c 100644 --- a/vdp.c +++ b/vdp.c @@ -2957,9 +2957,13 @@ void vdp_run_dma_done(vdp_context * context, uint32_t target_cycles) 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; } -- cgit v1.2.3