Im counting cpu cycles and in $4017 mode 0 when i reach 14914 * 2 or 14914.5 * 2 or 14915 * 2 CPU cc i set an IrqCollector = 0 flag if irq_inhibit is clear (as the wiki says) signaling that the next time my RunCpu() function find irqCollector == 0 IRQ needs to be served.
The thing that when RunCpu() fires the IRQ Double Dragon, 3D Battles of World Runner, Mario Is Missing, and Mario time machine behaves bad. They don't load propertly. 3D Battles is executing a CLI and thus allowing IRQs. But when it allows them stays in an infinite loop with a JMP Absolute to that same address as if it will be waiting for an interrupt, but never set $2001 to allow an NMI.
When i don't set the IrqCollector = 0 when i reach the cc mentioned above the games runs fine.
Any idea what could be happenning?
The thing that when RunCpu() fires the IRQ Double Dragon, 3D Battles of World Runner, Mario Is Missing, and Mario time machine behaves bad. They don't load propertly. 3D Battles is executing a CLI and thus allowing IRQs. But when it allows them stays in an infinite loop with a JMP Absolute to that same address as if it will be waiting for an interrupt, but never set $2001 to allow an NMI.
When i don't set the IrqCollector = 0 when i reach the cc mentioned above the games runs fine.
Any idea what could be happenning?