The Battletoads freezing problem

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

The Battletoads freezing problem

Post by Zepper »

btoads_2.png
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...
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: The Battletoads freezing problem

Post by Dwedit »

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)
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: The Battletoads freezing problem

Post by Fisher »

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:
User avatar
YoukaiCountry
Posts: 29
Joined: Tue Mar 07, 2017 4:25 pm
Location: Ohio, USA
Contact:

Re: The Battletoads freezing problem

Post by YoukaiCountry »

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!
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: The Battletoads freezing problem

Post by Zepper »

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-)
Post Reply