Hello guys!
I hope I have some good news here! We finally managed to fix Battletoads level 2 and Megaman 5 issues with our emulator!
Just yesterday Foomarumota and myself got together to check a "simple" issue with Megaman 5 that was causing a shaking bar when selecting a stage, we thought it was going to be easy, but what i found out was that sometimes the screen split was being set before tick 256 (exactly at tick 255). Something important to notice is that at tick 256 there is a Y-increment for loopy_v. if the split is set after 256 the split would stay but if the split is set before 256 it would be fine-y-incremented at tick 256, resulting in a different behavior, lowering it one scanline.
Battletoads suffers the same, it enables rendering just after tick 256, but sometimes at level 2 it would enable rendering at tick 255, resulting in lowering background one scanline and this will make zero-hit miss and freeze the game.
So after spending some time thinking about how we could fix this synchronization issue, we decided to adjust only one timing, we decided to set the Y-increment at tick 255, only 1 tick before, and this fixed both issues!
We had a problem before with Bart vs space mutants and the status bar, it would shake. We fixed that before, but after making this timing adjustment Bart vs space mutants is still working OK.
With all my PPU knowledge (which is not too much) I think this adjustment is fair enough. I don't see it as a hack, since it's just one tick adjustment, this applies for all games and I don't think it would interfere with the normal PPU behavior too. I cannot see any bad consequence so far for doing this for the PPU, the CPU or the synchronization between both too. Please feel free to correct me if i'm wrong!
So my intention with this post is to return a little to this big community which has help us learn a lot of knowledge, and see if this can help somebody else, we have seen these 2 games to cause a lot of questions in the forums, so maybe this adjustment would be good enough for other emulator authors to try it.
Also I would like to see if you guys in your own experience know what games/tests could fail if someone implements hacks to fix Battletoads, so we can try them and check what happens, because so far we haven't seen any failure because of this change.
Thanks again Nesdev community for your help!
I hope I have some good news here! We finally managed to fix Battletoads level 2 and Megaman 5 issues with our emulator!
Just yesterday Foomarumota and myself got together to check a "simple" issue with Megaman 5 that was causing a shaking bar when selecting a stage, we thought it was going to be easy, but what i found out was that sometimes the screen split was being set before tick 256 (exactly at tick 255). Something important to notice is that at tick 256 there is a Y-increment for loopy_v. if the split is set after 256 the split would stay but if the split is set before 256 it would be fine-y-incremented at tick 256, resulting in a different behavior, lowering it one scanline.
Battletoads suffers the same, it enables rendering just after tick 256, but sometimes at level 2 it would enable rendering at tick 255, resulting in lowering background one scanline and this will make zero-hit miss and freeze the game.
So after spending some time thinking about how we could fix this synchronization issue, we decided to adjust only one timing, we decided to set the Y-increment at tick 255, only 1 tick before, and this fixed both issues!
We had a problem before with Bart vs space mutants and the status bar, it would shake. We fixed that before, but after making this timing adjustment Bart vs space mutants is still working OK.
With all my PPU knowledge (which is not too much) I think this adjustment is fair enough. I don't see it as a hack, since it's just one tick adjustment, this applies for all games and I don't think it would interfere with the normal PPU behavior too. I cannot see any bad consequence so far for doing this for the PPU, the CPU or the synchronization between both too. Please feel free to correct me if i'm wrong!
So my intention with this post is to return a little to this big community which has help us learn a lot of knowledge, and see if this can help somebody else, we have seen these 2 games to cause a lot of questions in the forums, so maybe this adjustment would be good enough for other emulator authors to try it.
Also I would like to see if you guys in your own experience know what games/tests could fail if someone implements hacks to fix Battletoads, so we can try them and check what happens, because so far we haven't seen any failure because of this change.
Thanks again Nesdev community for your help!