diff jag_video.c @ 1100:653558f6fa7a

Fix Jaguar video interrupt cycle calculation
author Michael Pavone <pavone@retrodev.com>
date Sat, 05 Nov 2016 21:41:23 -0700
parents 9c62edafcf74
children
line wrap: on
line diff
--- a/jag_video.c	Sat Nov 05 21:19:18 2016 -0700
+++ b/jag_video.c	Sat Nov 05 21:41:23 2016 -0700
@@ -189,7 +189,7 @@
 
 uint32_t jag_cycles_to_halfline(jag_video *context, uint32_t target)
 {
-	uint32_t cycles = context->regs[VID_HPERIOD] - (context->regs[VID_HCOUNT & 0x3FF]);
+	uint32_t cycles = context->regs[VID_HPERIOD] - (context->regs[VID_HCOUNT] & 0x3FF);
 	uint32_t num_lines;
 	if (context->regs[VID_VCOUNT] < target) {
 		num_lines = target - 1 - context->regs[VID_VCOUNT];