tokumaru wrote:
When you say "on the original NES", do you mean using actual MMC3 chips or using FPGA flash carts? If the latter, you still can't be sure the code is 100% right. Once you can get it to work correctly across different revisions of the actual MMC3 chip, then this is really a problem for whoever is maintaining the flash cart and AVS implementations of the mapper.
I know things aren't as simple as this, as have creators we want to provide players with the best experience across all devices, so sorry if I can't give much technical advice on this.
What I can say is that MMC3 IRQs fire to late in the scanline for you to do any real hblank work in that same scanline, so you normally have to wait nearly a full scanline worth of CPU time in order to get a clean split. The other relevant thing I can say is that although changing the scroll takes a complex sequence of $2006/5/5/6 writes, only the last two wires have to happen during hblank for you to get a clean split, so that's just 5 cycles (the last cycle of the second $2005 write, plus e 4 cycles of the second $2006 write) you need to for in hblank, which leaves a lot of wiggle room for you to work with.
I just learned how to use Mesen to confirm I'm in hblank. It shows me the ppu cycle if I set a breakpoint, so I set a breakpoint at the first of those last two writes to 2005 and 2006, and if it is between 256 and 341 I should be okay, right? it kept landing around 280 or so.
So here's the thing, works perfect on Mesen, Nestopia, Nintendulator, original NES, but on AVS, the second split bounces by 1 scanline.
It's a train, and looks kinda cool, so I might just have to live with it. But it made my OCD go off pretty bad. I don't know if I can make it work the same on all. Sure wish I could.
Wondering if I fine tune it further to more reliably land closer to 256 in that range if there'd be less chance of the writes bleeding outside of hblank.
It's weird that it bumps a whole scanline though it makes me think something odd is happening with respect to reloading the mmc3 scanline counter that's making it off by 1 sometimes and not others though. Yet it IS only AVS with this issue.