Skip to content

NES: Fix MMC5 to work with AT->NT fetch change.#36

Merged
Fiskbit merged 1 commit intomasterfrom
fiskbit-mmc5-fix
Apr 14, 2026
Merged

NES: Fix MMC5 to work with AT->NT fetch change.#36
Fiskbit merged 1 commit intomasterfrom
fiskbit-mmc5-fix

Conversation

@Fiskbit
Copy link
Copy Markdown
Member

@Fiskbit Fiskbit commented Apr 14, 2026

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.

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.
@Fiskbit Fiskbit changed the title NES: Fix MMC5 to work with NT->AT fetch change. NES: Fix MMC5 to work with AT->NT fetch change. Apr 14, 2026
@TakuikaNinja
Copy link
Copy Markdown

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?

@zeta0134
Copy link
Copy Markdown
Collaborator

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. 👍

@Fiskbit Fiskbit merged commit 4602651 into master Apr 14, 2026
15 checks passed
@Fiskbit Fiskbit deleted the fiskbit-mmc5-fix branch April 15, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants