Skip to content

Conversation

@nitro2k01
Copy link
Contributor

@nitro2k01 nitro2k01 commented Nov 10, 2025

Simple improvement for some GBC dual platform games that show glitches. Platforms before GBC don't have extended VRAM (bank 1) that holds attributes and extended tiles. Therefore, this fix detects writes to the VRAM bank select register, and if bank 1 is selected, writes to VRAM are blocked. This could make certain games that are meant for GBC run passably, enough to be streamed.

The scope of what this can fix is pretty narrow:

  1. The game needs to have the issue for this patch to do anything in the first place. If it writes the attribute byte first, and then the tile index, it mostly won't have an issue because the glitchy attribute byte would be overwritten with the right value.
  2. The game needs to run in single speed. (By definition, in order to work with the GBI.)
  3. The game needs to not use any extended GBC functionality, like the attribute bits/extended tiles, and it needs to look ok with only monochrome palettes. (This is a somewhat subjective judgment of what looks ok.)
  4. The game needs to set the DMG style background palettes, or you might end up with just a white screen or similar through the GBI. (This could be somewhat mitigated by setting default values for those registers.)

I think 1 is likely the most common way of doing it, so maybe many games won't be helped by this patch. 2 varies between games. 3 can vary as well, but has a good chance chance of being applicable if it's a dual platform title that has to have a support for DMG mode. 4 Might not always be true, if the game has separate code paths for monochrome and GBC.

The risks that I can see with this solution are:

  1. I don't know how much time headroom there is for extra code. Maybe the extra if is a problem in the worst case scenario?
  2. Maybe there are cases where games write incorrectly to VBK (0xff4f) while in DMG mode. This seems pretty unlikely though.

So far I've only tried it with Pokemon Gold/Silver which the original issue #36 was about.

@Staacks
Copy link
Owner

Staacks commented Nov 11, 2025

Thanks, looks great. I hope that in a few days I find some time to test it (and fix that auto-build).

About the risks:

  1. I would not expect that. If this occurs somewhere it should be easy to implement a game-specific fix for that case.
  2. This is indeed always a risk. It's been a while since I have worked on the Interceptor to be really confident about it, but I don't think that writes to VRAM are a bottle neck. Problems usually arise in sequences of short 1-cycle operations that do not translate well to 32bit CPUs where the rp2040 needs to keep track of 8bit logic.

@Staacks Staacks merged commit c5b8d63 into Staacks:main Dec 22, 2025
1 check failed
@Staacks
Copy link
Owner

Staacks commented Dec 22, 2025

Finally got around to test it. Sorry for the long wait.

Thanks a lot for figuring this out and for the simple fix!

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.

2 participants