FIX94 / Nintendont

A Wii Homebrew Project to play GC Games on Wii and vWii on Wii U
1.84k stars 316 forks source link

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

Open cutrus opened 5 months ago

cutrus commented 5 months ago

I found a bug in Nintendont on vWii. When the console is set to a 480p resolution with a 4:3 aspect ratio (either through the Wii U system settings or forced by the WiiVCLaunch plugin in Aroma), Nintendont always unnecessarily scales the game horizontally, and there is no way to disable this through Nintendont settings.

Unfortunately, this results in a horizontally shrunken image on the TV every time I try to launch GameCube games in true 480p 4:3. Additionally, because this uses an external framebuffer to shrink the image horizontally, it breaks some of the image quality.

The solution would be to check whether the aspect ratio is set to 4:3 or 16:9 in vWii and scale accordingly. Below is the code responsible for the problem and photos explaining what's going on:


        // Set the Wii U widescreen setting.
        u32 ori_widesetting = 0;
        if (IsWiiU())
        {
                ori_widesetting = read32(0xd8006a0);
                if( ConfigGetConfig(NIN_CFG_WIIU_WIDE) )
                        write32(0xd8006a0, 0x30000004);
                else
                        write32(0xd8006a0, 0x30000002); //
                mask32(0xd8006a8, 0, 2); // This code always set external framebuffer to scale game horizontaly
        }

1 2

grandosegood commented 4 months ago

can you try plugin wiivclaunch and set to 480p to see if it fixes it?

cutrus commented 4 months ago

Can you try the WiiVCLaunch plugin and set it to 480p to see if it fixes it?

Yes, my bad. In my post, I meant the WiiVCLaunch plugin, not evWii. I mixed up the names. The pictures in the post indeed show the effect from the WiiVCLaunch.

And it's not an issue with the plugin itself; it works perfectly. Nintendont has a forced condition that, if it detects it's running on Wii U, it always launches in an anamorphic widescreen mode and artificially corrects the external framebuffer, adding black bars to maintain a 4:3 aspect ratio on widescreen. This results in a blurry image in normal cases or, as in my case, when it enforces a 480p 4:3 image output, a shrunken image on the sides.

I don't see consistency here. The condition I mentioned in the post only applies to the Wii U. I even checked on a regular Wii that Nintendont doesn't interfere with the framebuffer's operation and doesn't artificially correct the aspect ratio when the anamorphic widescreen option is enabled in the Wii settings. After commenting out the mentioned condition in Nintendont and recompiling the code, everything works on Wii U as it should in 4:3 and just like on the Wii in 16:9.

grandosegood commented 4 months ago

Thanks for the detailed reply. Just to confirm, you compiled the latest version of Nintendont yourself? Was it any different than the latest release? (Guessing so since it worked). Also, doesn’t the “Wii U widescreen “ setting account for that, and should fix the issue?

cutrus commented 4 months ago

@grandosegood

Yes, I compiled on the latest version because I made a few minor changes for myself.

commit 8b140805db8882adcc9af5d293288b3aa77da457 (HEAD -> master, origin/master, origin/HEAD)
Author: pedro702 <pedroaxel15@hotmail.com>
Date:   Thu Aug 24 19:40:52 2023 +0100

Besides, I described above exactly where the problem lies and how to work around it. When you check when the code with the widescreen correction condition was written, you'll find that this code is several years old; even very old builds have it.

I have plans to fix this widescreen bug, but I'm just trying to understand at which memory address in the Wii I can find information about whether widescreen is enabled.

Was it any different than the latest release? (Guessing so since it worked).

This option in Nintendont doesn't have any impact at all. Its only function is to inform a GameCube game to scale 3D objects horizontally (anamorphic widescreen). As I described above, Nintendont greedily manipulates the external buffer, assuming that anyone using a Wii U must have widescreen mode set on the console. This code is quite old, and during its design phase, no one anticipated the possibility of independently choosing resolutions and image ratio for the vWii mode.

mikesk8 commented 3 months ago

Very interesting topic. Is this fix going to be part of the main release? or how can I get it without full recompilation? ;-)

@cutrus - Are you able to share your compiled version to test it?

mikesk8 commented 3 months ago

@cutrus - All my GC games are injects with 4:3 forced (done by TeconMoon Injector) and my WiiU is set to 1080p.

I have a feeling that even in this setup the games are slightly horizontally squeezed, at least this is how the circles in the games look. I am not sure if this is somehow related?

What I am looking for is a true correct aspect in games as intended.

There is also another piece of code below the first condition:

    if (IsWiiU())
    {
        write32(0xd8006a0, ori_widesetting);
        mask32(0xd8006a8, 0, 2);
    }

Not sure what this one does?

cutrus commented 3 months ago

Very interesting topic. Is this fix going to be part of the main release? or how can I get it without full recompilation? ;-)

@cutrus - Are you able to share your compiled version to test it?

Sure, but as I described earlier, this is only a workaround and only makes sense if you used Aroma with the WiiVC plugin and set it to force 4:3 480p in WiiVC mode. Without that, you will get a stretch image horizontally.

boot.dol.zip

And if you're wondering why I'm using the 480p mode for Wii games, it's because the image quality is the best in that mode. It's still not perfect, but the TV scaler works much better than the internal scaler scaling the Wii to 1080p.

Not sure what this one does?

It restores the original value for the external framebuffer in WiiVC. Without this, in widescreen mode, the Wii would have a horizontally squeezed image after exiting Nintendont.

mikesk8 commented 3 months ago

Very interesting topic. Is this fix going to be part of the main release? or how can I get it without full recompilation? ;-) @cutrus - Are you able to share your compiled version to test it?

Sure, but as I described earlier, this is only a workaround and only makes sense if you used Aroma with the WiiVC plugin and set it to force 4:3 480p in WiiVC mode. Without that, you will get a stretch image horizontally.

boot.dol.zip

And if you're wondering why I'm using the 480p mode for Wii games, it's because the image quality is the best in that mode. It's still not perfect, but the TV scaler works much better than the internal scaler scaling the Wii to 1080p.

Not sure what this one does?

It restores the original value for the external framebuffer in WiiVC. Without this, in widescreen mode, the Wii would have a horizontally squeezed image after exiting Nintendont.

Thanks for your answer. Indeed, if WiiU is set (via console settings as I don't have Aroma) to 1080p it gives stretched image horizontally. However, once console is set to 480p 4:3 (via WiiU settings again) the image looks better and the aspect ratio is ok. This is cool ;)

btw. I managed to compile it too, 2 days back, and I just removed both WiiIU conditions ;-)