Battletoads runs at half speed (both video and audio) on my emulator and as shown below the background is not rendered on every other frame. The animated gif is slowed down to make the effect more visible. The status bar is shifted on those bad frames.
It's like the game code is outputting 2 frames when it should only output 1. Hence, it's advancing at half speed.
On the other hand, the text boxes in Marble Madness appear to be rendered correctly and it runs at the correct frame rate. So, I'm hoping that I'm close.
Has anyone seen an effect similar to this before?
Battletoads is *very* timing sensitive, it plays games with having the screen off for a few visible scanlines and such. Also, make sure that your sprite 0 handing is spot on as well.
As an experiment to see if it's a sprite 0 problem. Try this: set the sprite 0 hit flag any time you draw a sprite 0 pixel, regardless of if it overlaps with the BG pixel. If Battletoads is closer to correct, then at least you know that the problem is related to that. This obviously is just a hack, not a solution, but it's a good way to help diagnose the problem.
proxy wrote:
Battletoads is *very* timing sensitive, it plays games with having the screen off for a few visible scanlines and such. Also, make sure that your sprite 0 handing is spot on as well.
As an experiment to see if it's a sprite 0 problem. Try this: set the sprite 0 hit flag any time you draw a sprite 0 pixel, regardless of if it overlaps with the BG pixel. If Battletoads is closer to correct, then at least you know that the problem is related to that. This obviously is just a hack, not a solution, but it's a good way to help diagnose the problem.
Yeah. That helped a lot actually. The blank background frames vanished and the game plays at normal speed with that hack. The status bar is stable at the top, but the screen shakes a lot below it. There is some sort of scrolling issue, but the game is sort of playable now.
I'll investigate my sprite 0 hit logic. Thanks again.
Battletoads often enables rendering partway into the screen. This requires the scroll position to be set by manually reloading the PPU address via $2006 before enabling the rendering, because it is too late for $2005 to set the scroll (which normally gets applied in the pre-render scanline). This could be a factor causing the screen to shake, depending on how you have implemented scrolling.
Thanks everyone. I improved my sprite 0 hit tests using Blarg's test files. Unfortunately, that didn't help Battletoads to run any better.
But, I loaded up the Battletoads ROM into FCEUX 2.2.1 and was shocked to discover that it emulated the game as poorly as my emulator. So, I downloaded a different ROM file and this one works perfectly in my emulator and in FCEUX. Interestingly, both ROM versions work fine in Nestopia 1.40.
I don't really understand what this means. The working ROM was ripped in 1996. The only-working-in-Nestopia ROM was ripped in 1999. Were ROMs hacked back then to make them work better with emulators? Why can't FCEUX do what Nestopia does?
That's strange, FCEUX has supported Battletoads just fine for a LONG time. Perhaps there was a temporary regression in 2.2.1? I'm not sure, but it runs perfectly well in 2.2.2 in both Old and New PPU modes.
Are you perhaps running a PAL version of the ROM in NTSC mode?
If I open the PAL version of Battletoads in FCEUX, and then go into the menu and disable PAL mode to force NTSC, the first level looks exactly like that first animated screenshot you made.
rainwarrior wrote:
If I open the PAL version of Battletoads in FCEUX, and then go into the menu and disable PAL mode to force NTSC, the first level looks exactly like that first animated screenshot you made.
Holy crap! You're right. All this time I've been trying to run a PAL ROM. The NTSC ROM works great in my emulator and in FCEUX. That explains everything. Thank you so much.
rainwarrior wrote:
FCEUX has supported Battletoads just fine for a LONG time. Perhaps there was a temporary regression in 2.2.1?
FCEUX 2.2.1 had a bunch of regressions, one being complete loss of support for the
Action 53 mapper. It's unfortunate that 2.2.1 was the version included in Ubuntu 14.04 LTS.
And you might consider trying
FCEUX SVN (development) versions instead, as fixes/etc. tend to get added to those much sooner. I should note, however, that one of the recent SVNs crashed when reading fceux.cfg from an older version of FCEUX SVN, so I recommend writing down what all the tweaks/changes you apply to the emulator (preferences, input, etc.) before switching.
Same advice applies for Nestopia as well (site has Nestopia unofficial builds on there, though there hasn't been one in a while).
The really amazing thing about this, is that a lot of the ROMs that I was testing with were PAL ROMs. I did notice that Super Mario Bros and Super Mario Bros 3 were running faster than I remembered, but they played correctly otherwise. It's hard to believe all those PAL ROMs worked on my NTSC emulator except for Battletoads.