# HG changeset patch # User Michael Pavone # Date 1482874738 28800 # Node ID e4deab85f9ac2cf3b030817fb97a610dba91b89c # Parent d5412f76accc58d6c595f35bbb5ec87020b52017 The function of the HVC Latch enable bit in mode register 1 is different when not in mode 5 diff -r d5412f76accc -r e4deab85f9ac vdp.c --- a/vdp.c Tue Dec 27 13:26:14 2016 -0800 +++ b/vdp.c Tue Dec 27 13:38:58 2016 -0800 @@ -2377,7 +2377,7 @@ uint16_t vdp_hv_counter_read(vdp_context * context) { - if (context->regs[REG_MODE_1] & BIT_HVC_LATCH) { + if ((context->regs[REG_MODE_2] & BIT_MODE_5) && (context->regs[REG_MODE_1] & BIT_HVC_LATCH)) { return context->hv_latch; } uint32_t line= context->vcounter & 0xFF;