The Battletoads freezing problem

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
The Battletoads freezing problem
by on (#190660)
Attachment:
btoads_2.png
btoads_2.png [ 62.32 KiB | Viewed 2472 times ]

If I disable PPU left clipping, it's possible to see a square appearing at left. It causes the sprite zero hit to miss... and the game freezes. Even with clipping on, the issue is still there. Moving the toad right before the freezing (using a savestate), you can skip the problem, but I wonder why...
Re: The Battletoads freezing problem
by on (#190679)
Timing issue causes scrolling to be in the wrong place, so it misses the hit.
Do you know the exact timestamp for the scroll writes on the crashing frames? (timestamp before instruction starts to execute, and timestamp after it executes)
Re: The Battletoads freezing problem
by on (#190728)
Have you done some code modifications to try to fix Micromachines' glitches you talked on this other thread?

Alyosha_TAS wrote:
Delaying the flag does indeed fix the black line (although Battletoads wasnt crashing for me before that so not sure what's happening there exactly.) Now Micro Machines runs without glitches, although that delay definitely needs confirmation.

Looks like other people tried to fix that and had problems with Battletoads:
YoukaiCountry wrote:
After testing I discovered that I had managed to break Battletoads and hadn't noticed (probably in a recent round of timing corrections), but I managed to fix it; NMI triggering was off by a CPU cycle which was causing random mayhem.

You should take a look at these.
Sorry for not post the links, but I'm on my crappy cellphone. :-(
Corrected this!!
Hope you can figure this out!! :lol:
Re: The Battletoads freezing problem
by on (#190878)
Unfortunately, I don't think I'm quite out of the woods yet with my fix! Battletoads now runs correctly but I am failing the Blargg VBlank timing test! If I remove my fix, I pass the Blargg test but Battletoads crashes again.
I thought I had timing more or less solved until I stumbled across the Micro-Machines/Battletoads quantum entanglement!

I thought I had read that when NMI was triggered it didn't happen until AFTER the next CPU instruction, and putting this in was my fix. I currently have no idea where I got that idea, since I can't seem to find that anywhere now, but it did fix Battletoads for me... Back to the drawing board I guess.

Good luck with this issue!
Re: The Battletoads freezing problem
by on (#190883)
Hmm... NMI triggering. It always was an issue, since the early times, let's say... year 2000. A guess for NMI at scanline 243, later 1 line after the VBlank... and so on. Well, the reason for the game locking is a missing sprite zero hit (PPU status AND $40). But what on-screen (or off-screen?) sprite? What XY position? I'm a bit lazy to do a complete research. :cry: 8-)