Skip to content

Wii U/vWii: Improve how widescreen is handled#1295

Merged
carnage702 merged 1 commit intoFIX94:masterfrom
GABO1423:vwii-widescreen-fix
Apr 9, 2026
Merged

Wii U/vWii: Improve how widescreen is handled#1295
carnage702 merged 1 commit intoFIX94:masterfrom
GABO1423:vwii-widescreen-fix

Conversation

@GABO1423
Copy link
Copy Markdown

@GABO1423 GABO1423 commented Aug 15, 2025

Nintendont was originally coded with the reasonable assumption every Wii U user was going to run in 16:9. To use 4:3 you had to manually set the Wii U to 480p anyway, so when we are running on the vWii and the Wii U Widescreen setting is disabled, Nintendont has to manually squish the image to keep the 4:3 look of most of the GameCube's library. However, one edge case was ignored: what if the user did use 480p 4:3? This results in a squished image inside an already smaller 4:3 canvas.

To fix this, the loader saves the console's widescreen setting into a memory address, which the kernel then can use to determine if the console is on 16:9 or 4:3, and scale accordingly. Combined with the existing Wii U Widescreen setting you get the following combinations:

  • vWii is on 16:9 and Wii U Widescreen is disabled = Image is scaled to 4:3.
  • vWii is on 16:9 and Wii U Widescreen is enabled = Do nothing, we already have the 16:9 stretched image we want.
  • vWii is on 4:3 and Wii U Widescreen is disabled = Do nothing, we already have a correct 4:3 image.
  • vWii is on 4:3 and Wii U Widescreen is enabled = Image is scaled to 16:9, looking like it would on a Wii under similar conditions.

For the last two cases, you would need to change your TV's aspect ratio setting to get the look you want, while on the first two the Wii U does this step for you.

Credit goes to @wiidev for improving my original, more "hacky" approach.

Fixes #1177

@GABO1423 GABO1423 force-pushed the vwii-widescreen-fix branch 2 times, most recently from 1a6a588 to 3c3d471 Compare August 15, 2025 05:50
@GABO1423
Copy link
Copy Markdown
Author

GABO1423 commented Aug 15, 2025

Here's a test build if you want to try these changes out:

Test Build.zip

@GABO1423 GABO1423 force-pushed the vwii-widescreen-fix branch from 3c3d471 to 10d0b6e Compare August 15, 2025 09:01
Comment thread kernel/main.c Outdated
@GABO1423
Copy link
Copy Markdown
Author

New Test Build with the fixed value:

Test Build.zip

Comment thread loader/source/global.c Outdated
@GABO1423 GABO1423 force-pushed the vwii-widescreen-fix branch from 35787b2 to 862c474 Compare August 26, 2025 03:36
@GABO1423
Copy link
Copy Markdown
Author

Now that I think about it, do we need to do this check more than once?

		// NIN_CFG with version 10 may have loaded
		// garbage bytes into WiiUGamepadSlot so sanitize
		// the slot if necessary.
		if (ncfg->WiiUGamepadSlot > NIN_CFG_MAXPAD)
		{
			ncfg->WiiUGamepadSlot = 0;
		}

Otherwise I'm thinking this could work just the same:

	if (ncfg->Version == 10)
	{
		// NIN_CFG with version 10 may have loaded
		// garbage bytes into WiiUGamepadSlot so sanitize
		// the slot if necessary.
		if (ncfg->WiiUGamepadSlot > NIN_CFG_MAXPAD)
		{
			ncfg->WiiUGamepadSlot = 0;
		}
		ncfg->Version = 11;
	}
	if (ncfg->Version >= 11)
	{
		// Set this invisible setting only on Wii U/vWii
		// If the vWii is set to 4:3, set to false
		// Otherwise set to true
		if (IsWiiU())
		{
			if (CONF_GetAspectRatio() == CONF_ASPECT_16_9) ncfg->Config |= NIN_CFG_VWII_WIDE;
			else ncfg->Config &= ~NIN_CFG_VWII_WIDE;
		}
		// Always disabled on Wii since it's useless there
		else ncfg->Config &= ~NIN_CFG_VWII_WIDE;
	}

@wiidev
Copy link
Copy Markdown

wiidev commented Aug 26, 2025

I think it's better to keep it the way I wrote it, since that makes it clear you're supposed to target the previous version and bump it up to the current one, just like in all the earlier commits by nastys, FIX94, and sailormoon.

If you do it the way you wrote it above, then ncfg->WiiUGamepadSlot won’t be sanitized anymore, and someone might forget to bump the config version in the future, exactly like you did.

@GABO1423
Copy link
Copy Markdown
Author

Cool, I'll keep it as-is then.

@GABO1423
Copy link
Copy Markdown
Author

A quirk I noticed, for brand new configs, this new setting does not appear to do anything. But next time Nintendont boots up, the setting works as expected.

The solution would be to move this setting update code to another place where it will always run, but I'm not sure which place would be best (probably somewhere near the UpdateNinCFG() call in the loader's main.c file), or if this is that big of a deal to move, although it wouldn't be hard to do anyway.

@wiidev
Copy link
Copy Markdown

wiidev commented Aug 26, 2025

I had a little free time, so I looked into this more.

wiidev@23ab36e

My version requires no config edits, so it maintains compatibility with USB loaders too. And I kept the old logic when exiting a game, since that's cleaner.

@GABO1423
Copy link
Copy Markdown
Author

That's way better than what I came up with, cool. You want to make your own PR?

@wiidev
Copy link
Copy Markdown

wiidev commented Aug 26, 2025

I could do that with reference to this PR, since I wouldn't have bothered looking into this issue if you hadn't put in the initial effort.

I also haven't tested my version much yet, but I assume it's working correctly.

@GABO1423
Copy link
Copy Markdown
Author

In a few hours I'll be home and I can try this out, but looking at the code, the only oddity I think I could find is that sometimes with the old exit code, the vWii image remained pillarboxed (specifically if the vWii is set to 4:3 and I think with Wii U Widescreen off).

Other than that this looks good.

@wiidev
Copy link
Copy Markdown

wiidev commented Aug 26, 2025

the only oddity I think I could find is that sometimes with the old exit code, the vWii image remained pillarboxed (specifically if the vWii is set to 4:3 and I think with Wii U Widescreen off).

I can't replicate that, since no matter how I launch a game through Nintendont it always disables pillarboxing correctly when I exit.

Unless someone has created a bad launcher that forces 4:3 by enabling vWii pillarboxing, it should be impossible for ori_widesetting to be assigned a bad value.

@GABO1423
Copy link
Copy Markdown
Author

GABO1423 commented Aug 28, 2025

Finally was able to sit down and test. Everything works correctly including restoring the aspect ratio, so I'm just confused about why I saw that error before (it was with Nintendont by itself, no loaders).

Either way let me know if you open a PR to close this one.

Credit to @wiidev for this improved fix.
@GABO1423 GABO1423 force-pushed the vwii-widescreen-fix branch from 862c474 to b294e39 Compare September 2, 2025 22:59
@GABO1423
Copy link
Copy Markdown
Author

GABO1423 commented Sep 2, 2025

New Test Build: Test Build.zip

@GABO1423 GABO1423 marked this pull request as ready for review September 14, 2025 20:30
@wiidev
Copy link
Copy Markdown

wiidev commented Sep 15, 2025

Either way let me know if you open a PR to close this one.

Sorry, I've been really busy with a few other things. But it seems a bit pointless for me to create a PR now that you've copied my commit verbatim.

The Nintendont maintainer usually waits until there are a few pull requests queued up before merging anything, so this might sit in limbo for a while. But I'm sure it'll get merged eventually.

@GABO1423
Copy link
Copy Markdown
Author

Thanks again for your help, it was truly appreciated. I'll leave this open in the meantime.

@carnage702 carnage702 merged commit b9d2297 into FIX94:master Apr 9, 2026
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.

Nintendont unnecessarily scales the game horizontally in wiiVC 4:3 480p mode on Wii U

3 participants