As part of the Deadpool hack of Ninja Gaiden, I've converted the game from MMC1 to MMC3 and am now using IRQs to trigger the split screen effects rather than sprite 0 hit detection. For the most part, things are working fine. However, in one stage I implemented parallax scrolling, which looks perfect in FCEUX but has issues on more accurate emulators and on real hardware with an Everdrive/Powerpak. The problem is that sometimes the screen will appear to shake, shifting up and down by a single pixel. With some help from the beta testers I was able to determine that the shifting coincides with a palette change. Regarding the MMC3 IRQ counter, from Nesdev:
The counter is clocked on each rising edge of PPU A12, no matter what caused it, so it is possible to (intentionally or not) clock the counter by writing to $2006, regardless of whether PPU is/is not rendering.
It is normal for the game to write to $2006 during NMI when setting the address to update for the status bar on that frame. But sometimes I write to $2006 when manually updating specific tiles or palettes during NMI also. Will doing this always result in the IRQ triggering a scanline early? Also, is there a fix for this other than going back to a sprite 0 hit? I could also create a "hacky" fix that changes the IRQ reload counter based on whether I'm transmitting other data to the PPU on that frame. However this will probably cause the screen shaking to occur when playing on FCEUX instead. Also, I don't notice any additional screen shaking due to scrolling, despite the fact that loading new level data results in several writes to $2006.