Mefiresu / RSDKv5-Decompilation

A complete decompilation of Retro Engine (v5) ported to the Wii
Other
49 stars 6 forks source link

Purple screen rendering in Dolphin #32

Open Adamillo opened 1 year ago

Adamillo commented 1 year ago

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 commented 1 year ago

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)

JMC47 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

MilesTailsFan2005 commented 1 year ago

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

Adamillo commented 1 year ago

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 commented 3 weeks ago

@Mefiresu Any updates about this issue?