Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Marble Madness #94

Merged
merged 4 commits into from
Dec 8, 2024
Merged

Fix Marble Madness #94

merged 4 commits into from
Dec 8, 2024

Conversation

quephird
Copy link
Owner

@quephird quephird commented Dec 8, 2024

This PR finally addresses a bug in disaffecting the display of the text boxes at the beginning of each level in Marble Madness; this is what it looked like previously:

image

After ruling out a ton of other possibilities, namely the implementations behind caching and rendering of tile data by the PPU, it turned out that it was a fairly trivial mapping issue. In the case of the Marble Madness game, it uses the singleScreen1 mirroring strategy and previously we were incorrectly computing actual nametable indices for it.

The fix was to update the mapping, this time representing it as a two-dimensional array instead of a switch/case statement. Also the mapping has been moved into the Mirroring enum, and an instance method added there to return the correct nametable index for a given mirroring strategy and inbound nametable index. And now everything renders perfectly:

image

Other fixes/updates included in this PR:

  • Subtle bug fix in the reading PPU memory in the range 0x3F00-0x3FFF; we hadn't been properly setting the buffer value previously.
  • We also changed the internal API a little bit so that readByteInternal() no longer returns a tuple.
  • The PPU dump utility also had a few bugs that resulted in the output being incorrect.

@quephird quephird merged commit 7267887 into main Dec 8, 2024
@quephird quephird deleted the fix_marble_madness branch December 8, 2024 01:44
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