I guess instead of making my own thread about this, I'll simply post my question here. I am almost done with MMC3, all of blargg's test pass (except revision A, because I haven't tried yet

). Yet in at least 3 games there are some issues.
- Mega Man 5
- Boss 'intro' screen shakes on the bottom half of the bar (The part with their name on it).
- Mega Man 6
- Knight Man's stage, the floor shakes at the part with the spikes that move down on top of you
- Centaur Man's stage, the floor shakes at the trippy part where the water is suspended above you
- Rad Racer 2
- There are sometimes small glitches on the left side of the road
I can't figure out where this is coming from, the PPU passes all the VBL Timing (Doesn't pass sprite overflow timing tests which /may/ be connected, but highly unlikely since A12 only depends on fetches made), and the MMC3 IRQ Timing tests. So whence cometh the shake? It's making me want to pull out my hair, because aside from these small bugs, every game that uses MMC3 looks perfect.. Here is my code for clocking the IRQ Counter, which also may be wrong:
Code:
private void PPU_AddressLineUpdating(int addr)
{
oldA12 = newA12;
newA12 = addr & 0x1000;
if (oldA12 < newA12)
{
if (timer > 16)
{
if (irqCounter == 0 || irqReload)
{
irqReload = false;
irqCounter = irqRefresh;
}
else
{
irqCounter--;
}
if (irqCounter == 0 && irqEnabled)
{
cpu.IrqRequest = true;
}
}
timer = 0;
}
}
the variable names should be obvious, but just in-case they aren't:
- timer: this is increased along with each dot on the PPU
- irqCounter: the value that is decreased on each rising edge of A12
- irqRefresh: the value written into $C000
- irqReload: set on writes to $C001
- irqEnabled: set on writes to $E001, cleared on writes to $E000
CPU Timing passes all test, PPU timing passes all relevant tests, MMC3 passes all tests. So yeah, I don't get why I'm having /ANY/ problems, but I am. Any suggestions?