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

Purple screen rendering in Dolphin #32

Open
Adamillo opened this issue Jun 29, 2023 · 8 comments
Open

Purple screen rendering in Dolphin #32

Adamillo opened this issue Jun 29, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@Adamillo
Copy link

Adamillo commented Jun 29, 2023

For some reason, Sonic Mania has a problem where the XFB Copies aren't rendered properly on Dolphin with the "XFB Copies to Texture Only" option turned on. The only way to fix this is to turn this option off, but it makes the game quite a lot more demanding to run. Older versions of your Wii releases don't have this issue

@Mefiresu
Copy link
Owner

This is a known issue, it's related to poor synchronization with the GPU.
Haven't had the time to look at it but it's low priority since it only happens in Dolphin (real hardware works fine)

@Mefiresu Mefiresu added the bug Something isn't working label Jun 29, 2023
@JMC47
Copy link

JMC47 commented Jun 29, 2023

If Dolphin is running in single core, it shouldn't have (many?) GPU synchronization issues. The purple screen wouldn't happen on console anyway since it always has access to the XFB. It's possible that Dolphin's GPU timings are too fast causing some kind of issue though, I suppose.

The purple screen is Dolphin's failsafe essentially saying "hey, the XFB copy doesn't match," which is usually because the emulated CPU modified the XFB. When the XFB Copy doesn't match what's expected, Dolphin falls back to using what is in emulated memory on the CPU. When Store XFB Copies to Texture Only is on, that portion of memory is filled with values that amount to the magenta color you see there. When XFB2RAM is on, the same thing happens except now the memory is filled with the correct data, allowing it to display correctly.

Based on the screenshots I've seen, 480p mode is stitching XFB copies together, and only the hash of the last XFB copy for the frame is matching what is expected, resulting in a small portion of the screen rendering correctly. Sonic and Knuckles on WiiWare employs a similar technique, and our XFB to texture code is designed to handle stitched XFB copies because of that game. So I do not believe the stitching itself is the source of the problem.

It could be a bug in Dolphin's texture cache as well, as we've seen XFB2Tex fail for unknown reasons in some other games that use multiple XFB copies per frame. Since the game works fine on console, I probably wouldn't consider this an issue in this game, but if you did narrow down what change caused it to break Dolphin, it could allow us an easier time figuring out why this is happening.

@Mefiresu
Copy link
Owner

Thanks for the detailed info!
I'm pretty sure it started happening when @LiquifiedPizzas implemented this stitching in #21, though I could be wrong.
I'll bisect it just to be sure once I find the time.

@MilesTailsFan2005
Copy link

You Need Steam Releases Of
Sonic Mania
Sonic Origins

To Make It Work
Make Sure To Call It "Data.rsdk"

Also Theirs No Sound On These Versions

@Adamillo
Copy link
Author

Adamillo commented Jul 7, 2023

Sonic Origins is not relevant to this discussion at all. And the RSDK was grabbed from the Steam release of Sonic Mania

@MilesTailsFan2005
Copy link

But yeah I had no issues with that purple screen idk If it's a issue with the WideScreen mode idk

@Adamillo
Copy link
Author

Adamillo commented Jul 8, 2023

Try turning on "XFB Copies to Texture Only" while the game is in widescreen and you'll notice it. Also make sure to not use the old version of the Wii port

@Adamillo
Copy link
Author

Adamillo commented Jul 2, 2024

@Mefiresu Any updates about this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants