diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-08-21 23:49:56 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-08-21 23:49:56 -0700 |
commit | f46eaaf8651d2c763de76ce82999d9d7e1230719 (patch) | |
tree | cbb44577daa640f72a82546526ae3651cbab632d | |
parent | 9ba7165752489a5aafaa9d6896bd865ab8a0e593 (diff) |
Fix external v counter when normal resolution interlace mode is active
-rw-r--r-- | vdp.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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; } |