Turns out the problem was I wasn't accounting for which page of the name table I was on and that was causing it to bug out. Mario 2/Lost Levels adjusts the code for scrolling to account for that, but I wasn't understanding what the extra code in its IRQ routine was or how to implement it properly.
The disassembly of 2 is based on the FDS version so it was based on the FDS's IRQ routine and the numbers I needed to set for things were different.
I tried looking at the edited disassembly for the MMC3 conversion of 2/LL, but the code isn't commented and I'm a bit too inexperienced to know what's going on.
I'm having a new problem now where the whole screen shakes up and down when I load the game in some emulators, hopefully the link you've provided will give me enough to go on to figure that out. It hadn't occurred to me to look on documentation for scrolling in general since the game already has a scrolling system built.
It seems like whenever I ask for help here, the problem isn't what I think it is so I don't give people enough information to actually help me. Ooops!
January 07, 2021, 06:59:24 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Seems to have been a timing issue, changing the amount of delay around has removed the earthquakes.
Hopefully, last problem I'm having in relation to this:
When Mario passes through the boundary between the scroll areas, there seems to be a dead scanline on certain emulators, but not others. Lost Levels MMC3 doesn't have the same problem, so presumably it's something that can be dealt with.
EDIT: Turns out I'd disabled rendering at the beginning of the IRQ because I'd been testing something else, oops