comparison 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
comparison
equal deleted inserted replaced
1099:9c62edafcf74 1100:653558f6fa7a
187 OBJ_STOP 187 OBJ_STOP
188 }; 188 };
189 189
190 uint32_t jag_cycles_to_halfline(jag_video *context, uint32_t target) 190 uint32_t jag_cycles_to_halfline(jag_video *context, uint32_t target)
191 { 191 {
192 uint32_t cycles = context->regs[VID_HPERIOD] - (context->regs[VID_HCOUNT & 0x3FF]); 192 uint32_t cycles = context->regs[VID_HPERIOD] - (context->regs[VID_HCOUNT] & 0x3FF);
193 uint32_t num_lines; 193 uint32_t num_lines;
194 if (context->regs[VID_VCOUNT] < target) { 194 if (context->regs[VID_VCOUNT] < target) {
195 num_lines = target - 1 - context->regs[VID_VCOUNT]; 195 num_lines = target - 1 - context->regs[VID_VCOUNT];
196 } else { 196 } else {
197 num_lines = target + context->regs[VID_VPERIOD] - context->regs[VID_VCOUNT]; 197 num_lines = target + context->regs[VID_VPERIOD] - context->regs[VID_VCOUNT];