NES: Fix MMC5 to work with AT->NT fetch change.#36
Conversation
Mesen previously did NT and AT fetches during the sprite fetch region, but it should actually be two NT fetches. A previous commit fixed this, but some mapper implementations depend on precise numbers of NT fetches and those counts are now wrong. We previously found and fixed this in Rainbow, but MMC5 is also affected.
64b603e to
55f198b
Compare
|
Sprites look fine again in Uchuu Keibitai SDF and Just Breed after the fix. After reading the PPU rendering page, I see where the adjustment of 8 came from - one extra garbage NT fetch for each of the 8 sprites. Do we know of any mappers other than MMC5 and Rainbow which rely on counting these PPU fetches? |
|
The MMC5 vertical split implementation caught my eye as potentially incorrect. I need to do some more research on it, but the column comparison seems especially suspect. I don't think this fix makes it any more incorrect, just calling it out for future efforts. (I don't have a good way to test on hardware at the moment.) Long term, I think the NT counter should become a PPU fetch counter, as it will make this code easier to follow. Tested all the games in my library and encountered no issues. Due to MMC5's extended sprite windows, problems should shown up almost right away, and they no longer do with the patch applied. 👍 |
Mesen previously did NT and AT fetches during the sprite fetch region, but it should actually be two NT fetches. A previous commit fixed this, but some mapper implementations depend on precise numbers of NT fetches and those counts are now wrong. We previously found and fixed this in Rainbow, but MMC5 is also affected.