changeset 1124:e4deab85f9ac

The function of the HVC Latch enable bit in mode register 1 is different when not in mode 5
author Michael Pavone <pavone@retrodev.com>
date Tue, 27 Dec 2016 13:38:58 -0800
parents d5412f76accc
children fba485949723
files vdp.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;