# HG changeset patch # User Michael Pavone # Date 1478407283 25200 # Node ID 653558f6fa7aa045bf02bac173a91d1096984bc7 # Parent 9c62edafcf7454a4237df29b181ec87c551f8806 Fix Jaguar video interrupt cycle calculation diff -r 9c62edafcf74 -r 653558f6fa7a jag_video.c --- 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]; diff -r 9c62edafcf74 -r 653558f6fa7a jaguar.c --- a/jaguar.c Sat Nov 05 21:19:18 2016 -0700 +++ b/jaguar.c Sat Nov 05 21:41:23 2016 -0700 @@ -145,9 +145,10 @@ system->memcon2 = value; break; case 0xE0: - printf("INT1 write: %X\n", value); system->cpu_int_control = value & 0x1F; system->video->cpu_int_pending &= ~(value >> 8); + printf("INT1 write: %X @ %d - int_pending: %X, int_control: %X\n", value, system->m68k->current_cycle, system->video->cpu_int_pending, system->cpu_int_control); + jag_update_m68k_int(system); //TODO: apply mask to int pending fields on other components once they are implemented break; case 0xE2: