diff --git a/Src/Model3/Model3.cpp b/Src/Model3/Model3.cpp index ca2e7ce..bff690e 100644 --- a/Src/Model3/Model3.cpp +++ b/Src/Model3/Model3.cpp @@ -2041,10 +2041,9 @@ void CModel3::RunMainBoardFrame(void) // Compute display and VBlank timings unsigned ppcCycles = m_config["PowerPCFrequency"].ValueAs() * 1000000; unsigned frameCycles = (unsigned)((float)ppcCycles / 57.524160f); - unsigned gapCycles = (unsigned)((float)frameCycles * 2.5f / 100.0f); // we need a gap between asserting irq2 & irq 0x40 - unsigned offsetCycles = (unsigned)((float)frameCycles * 33.f / 100.0f); - unsigned dispCycles = frameCycles - gapCycles - offsetCycles; - unsigned statusCycles = (unsigned)((float)frameCycles * (0.005f)); + unsigned offsetCycles = (unsigned)((float)frameCycles * 33.f / 100.0f); + unsigned dispCycles = frameCycles - offsetCycles; + unsigned statusCycles = (unsigned)((float)frameCycles * (0.005f)); // we think a frame looks like this on the model 2 // 66% of frame @@ -2069,7 +2068,13 @@ void CModel3::RunMainBoardFrame(void) ppc_execute(offsetCycles); IRQ.Assert(0x02); // start at 33% of the frame - ppc_execute(gapCycles); // need a gap between asserting irqs + + // keep running cycles until IRQ2 is acknowledged + while (IRQ.ReadIRQEnable() & 0x2 && IRQ.ReadIRQState() & 0x2 && dispCycles > 1000) + { + ppc_execute(1000); + dispCycles -= 1000; + } /* * Sound: