Skip to content

hw/mappers: fix MMC1 in 32KB prgmode#79

Merged
arl merged 2 commits intomainfrom
fix/mmc1-32kb-prgrom
Dec 22, 2025
Merged

hw/mappers: fix MMC1 in 32KB prgmode#79
arl merged 2 commits intomainfrom
fix/mmc1-32kb-prgrom

Conversation

@arl
Copy link
Copy Markdown
Owner

@arl arl commented Dec 20, 2025

Fix MMC1 32KB PRG-ROM bank switching

selectPRGPage32KB was copying PRG-ROM data directly without proper bank wrapping, causing incorrect memory mapping in MMC1's 32KB mode. The fix reimplements it to call selectPRGPage16KB twice, reusing the existing bank-wrapping logic.
The bank wrapping in selectPRGPage16KB is also corrected to always count 16KB banks from the actual ROM size, rather than relying on the mapper's native bank size.
For MMC1, the 32KB mode now properly converts the 16KB-based prgbank value to a 32KB bank index.

@arl arl merged commit c783875 into main Dec 22, 2025
2 checks passed
@arl arl deleted the fix/mmc1-32kb-prgrom branch December 22, 2025 08:35
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.

1 participant