Skip to content

Fix SUROM PRG bank selection - #785

Open
SaveEditors wants to merge 1 commit into
bfirsh:mainfrom
SaveEditors:fix-732-surom-prg-banking
Open

Fix SUROM PRG bank selection#785
SaveEditors wants to merge 1 commit into
bfirsh:mainfrom
SaveEditors:fix-732-surom-prg-banking

Conversation

@SaveEditors

Copy link
Copy Markdown

Summary

  • retain the selected MMC1 PRG bank and reapply it after control or CHR0 page changes
  • map both SUROM PRG windows within the selected 256 KB page
  • preserve existing power-on, 4 KB CHR-mode, non-SUROM, and legacy save-state behavior
  • add synthetic coverage for all PRG modes, both outer pages, write ordering, and state restoration

Root cause

Mapper 1 calculated upper-page banks in inconsistent units and only updated PRG mapping after register 3 writes. The fixed PRG window also remained on the global last bank instead of following the selected SUROM page.

Fixes #732

Testing

  • npm run build
  • npm test
  • cd web && npm run build
  • cd web && npm test

@SaveEditors
SaveEditors marked this pull request as ready for review July 27, 2026 11:24
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.

MMC1 (mapper 1): SUROM 512KB games crash — fixed bank at $C000 doesn’t follow the 256KB page-select bit

1 participant