Skip to content

Conversation

Wohlstand
Copy link

@Wohlstand Wohlstand commented Jul 7, 2025

This bug happens just when V-Sync is off and attempting to open and close the home menu. To fix the black/frozen screen it's just enough to call the GX2SetSwapInterval(0); right after entering the foreground back.

P.S. I checked on the WUT side, and seems, such workaround is required since it's a bug of the Wii U firmware itself.

Description

Demo of buggy behaviour at my project:

2025-07-08_00-47-13.mp4

Demo of the fixed behaviour at my project:

2025-07-08_00-53-01-rekod-discord.mp4

Unexpectedly, this bug affects the EasyRPG (ping @Ghabry to use the newer SDL2 for Wii U after this fix arrive) too when disabling V-Sync, and re-enabling V-Sync restores back the screen:

2025-07-08_00-58-03-rekod-discord.mp4

@Wohlstand
Copy link
Author

@GaryOderNichts, can you remind me what's left to test/ensure until merge this?

@GaryOderNichts
Copy link

Were there any issues with doing it like this ad29a9f? Since this is a workaround only necessary for swap intervals of 0, it might be the simpler solution. I would prefer moving it into WIIU_ForegroundReleased though.

@Wohlstand
Copy link
Author

Were there any issues with doing it like this ad29a9f? Since this is a workaround only necessary for swap intervals of 0, it might be the simpler solution. I would prefer moving it into WIIU_ForegroundReleased though.

My workaround that I did, is supposed to perform save/restore, and it just worked. I could try the thing you suggested, and if it will work, then flawless, but if it fails, then just keep my initial workaround.

@Wohlstand
Copy link
Author

I'll try to test after some hours (I'll be busy), or tomorrow if I forget or I will be too sleepy.

This bug happens just when V-Sync is off and attempting to open and close the home menu. To fix the black/frozen screen it's just enough to call the `GX2SetSwapInterval(0);` right after entering the foreground back.
@Wohlstand Wohlstand force-pushed the wiiu-sdl2-2.28-home-menu-close-fix branch from 01094c2 to 7df48f1 Compare September 23, 2025 20:28
@Wohlstand
Copy link
Author

Wohlstand commented Sep 23, 2025

Were there any issues with doing it like this ad29a9f? Since this is a workaround only necessary for swap intervals of 0, it might be the simpler solution. I would prefer moving it into WIIU_ForegroundReleased though.

Okay, I done the test, and the small thing seems just fine! I applied it to the pull-request right now.

The test of the tweak that you sent to me:

2025-09-23_23-14-21-rekod-discord.mp4

The control test over clear wiiu-sdl2-2.28 branch without this change (the bug is here):

2025-09-23_23-09-45-rekod-discord.mp4

@GaryOderNichts
Copy link

Can you move the workaround into WIIU_ForegroundReleased and out of the handle ProcUI check? Also replace the comment with something like Workaround for leaving foreground with a swap interval 0.

@Wohlstand
Copy link
Author

Can you move the workaround into WIIU_ForegroundReleased and out of the handle ProcUI check? Also replace the comment with something like Workaround for leaving foreground with a swap interval 0.

Uno momento...

@Wohlstand
Copy link
Author

And also, I should test the thing after all to ensure it WORKS.

@Wohlstand
Copy link
Author

Wohlstand commented Sep 23, 2025

Can you move the workaround into WIIU_ForegroundReleased and out of the handle ProcUI check? Also replace the comment with something like Workaround for leaving foreground with a swap interval 0.

I tested, if I move to WIIU_ForegroundReleased, it stops to work at all, it just does not works. I checked at multiple places:

  • Before GX2DrawDone()
  • After GX2DrawDone()
  • Before while (window)
  • After while (window)

All the cases just failed. But once I place this gall at WIIU_ForegroundAcquired, it just works!

But, now I moved it out of handleProcUI condition.

Just few evidences for WIIU_ForegroundReleased work:

2025-09-24_01-05-19.mp4
2025-09-24_01-08-15.mp4
2025-09-24_01-09-46.mp4
2025-09-24_01-13-51-rekod-discord.mp4

And the test result of my latest change at WIIU_ForegroundAcquired, it works:

2025-09-24_01-15-27-rekod-discord.mp4

strejf79 added a commit to strejf79/crispy-doom-u-aroma that referenced this pull request Sep 27, 2025
Implement workaround for SDL bug where GX2SetSwapInterval(0) causes
black screen after returning from HOME menu. When leaving foreground,
GX2 silently restores swap interval to 1, but SDL doesn't reapply
zero-interval mode after regaining foreground, causing render thread
to stop presenting frames.

Changes:
- Force VSYNC enabled on Wii U in SetVideoMode() renderer creation
- Prevent VSYNC toggle from disabling VSYNC on Wii U in all games
- Add detailed comments explaining the SDL bug and workaround
- Only affects Wii U builds via __WIIU__ preprocessor guards

This workaround keeps GX2SetSwapInterval(1) active so the system's
reset matches what SDL expects, preventing the black screen hang.

Long-term solution: Rebuild SDL with PR devkitPro/SDL#107 which
adds proper GX2SetSwapInterval(0) reapplication in WIIU_ForegroundAcquired().
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