Withthat said, in my quest to get the most accurate, console-like experience out of the emulator and the monitor I came across an issue that probably doesn't bother a lot of people, but I felt it was worth mentioning anyhow.
I don't really know what the proper place to post this finding is, but I'll put it here for now. Also, I'm by no means an expert on any of the things I'm about to show, so I'd appreciate it if someone more knowledgeable could correct me.
By taking a screenshot, I figured out that the native resolution of the game is 584x480, so I tried the "Force 4:3" and "Stretch To Window" modes and the poor scaling went away on the stretched image:
I took a screenshot of Mario Sunshine and found out its resolution is 640x476, which means that a couple of lines of pixels are cut from the top and bottom part of the screen. This doesn't sound like a big deal at first. However, with how Dolphin's video modes work, this ends up messing up the entire image.
I'm guessing all of this could probably be fixed by implementing a Pixel Perfect / Integer Scaling mode. This way, all the pixels that aren't used would simply be black, and all the active pixels would line up with the scanlines or the pixel grid of the display. This wouldn't just benefit CRT users, but also owners of 480p LCDs and people who use HD TVs / monitors who don't mind having black bars around the image.
First, a real console simply doesn't output perfect pixel like you are expecting from dolphin. In-fact dolphin outputs significantly "cleaner" pixels, as it skips several steps of blur. The clean image quality you are striving for simply never existed. By default, games always do both vertical and horizontal bluring, and most games do horizontal scaling. All PAL games apply a vertical scaling.
Even in the games that go out of their way to offer a mode that minimise this (like Melee's disable AA filter mode), the vertical blurring incurred from the YUVU framebuffer is impossible to disable on real hardware.
Second, The video used by the GameCube and Wii (REC.601) has non-square pixels. 0.91:1 in NTSC and 1.09:1 in PAL. It's simply impossible to accurately portray this on a video mode with 1:1 square pixels, like 640x480 @ 60HZ VGA. Either you need to do some form of scaling (like dolphin currently does) or you end up with an incorrect aspect ratio.
However, I admit the experience could be better for this kind of usecase. At the very least, it should be easy to configure dolphin to a mode that actually showed the correct number of vertical lines with overscan/padding. Such a video mode would still need scaling along the horizontal for the majority of games, but at least you would only have scaling along one axis, and it happens to same axis that composite video really struggles with (and that a real console always has some amount of forced blur).
To be clear, my goal isn't to get hard pixel edges like in a 2D game (I apologize if there was a misunderstanding), I just want the scanlines to line up properly with the game resolution and the pixels to be horizontally even like real hardware displayed on a CRT (with whatever blur might be applied by the console). In short, no post-scaling artifacts.
My proposal here (as much as it's worth) would be to implement something along the lines of what Nintendo did with the SNES mini, which (iirc) offered a 1:1 pixel perfect mode with no shimmering (albeit with an incorrect aspect ratio), and a 4:3 mode with pixel interpolation (which minimized shimmering). I seem to remember the SNES also had non-square pixels.
The reason I'm saying this is that CRT displays could do without any form of horizontal scaling, since they can adjust the image after it has been sent to the screen, due to them not having a fixed pixel structure. So the correct aspect ratio could be achieved without the emulator doing any scaling (when set in 1:1 PAR). To my knowledge, LG OLEDs also have this "resizing" feature, and while they do have a fixed pixel structure, the pixel density is so high that you wouldn't notice any scaling.
As far as 480p LCDs are concerned, a 1:1 pixel mapping would definitely have an incorrect aspect ratio, however it would arguably be more "CRT-like", meaning that the vertical lines in excess would be vertically cropped and there wouldn't be any horizontal scaling since the pixels would be square (as opposed to having a forced aspect ratio where there would be scaling all over the place).
In a dream scenario, this would also apply to higher rendering resolutions, meaning we could have an EFB of 1280x1056 show up without cropping in a 1:1 pixel mapping on a 1080p screen without any horizontal scaling and so on.
The reason I'm saying this is that CRT displays could do without any form of horizontal scaling, since they can adjust the image after it has been sent to the screen, due to them not having a fixed pixel structure
But as far as I'm aware, there has never been a sane OS API that actually lets you output non-square pixels over VGA, or even composite. If there was (and if the install-base of CRT monitors was a bit higher) then it would be interesting for dolphin to support.
You could probably hack it together with custom screen modes and manually telling dolphin what the current pixel aspect ratio is, but then you run into problems that different games use different pixel aspect ratios, and some games will probably switch on the fly. It really needs to be dolphin directly controlling the display mode to make any sense.
IMO, it's simply not worth investing any development, code-complexity and support effort in this direction.
In the future, dolphin will support high-quality custom upscaling/downscaling algorithms as post-processing shaders. You could choose between a high quality bicubic (or AMD's FSR) for smooth resampling that looks a lot better than bilinear's blurry mess. Or choose an upsampling algorithm that tries to preserve the a more pixelated feel without resorting to full nearest neighbour.
Here I used the emulator's options and set the aspect ratio to "corrected", and it's a big mess, with some pixels being square and others being rectangular, and in motion it's even worse because they switch sizes basically every frame, creating shimmering. But the aspect ratio is actually correct.
Here, the pixels are all square, which makes scrolling smooth as butter, but at the cost of having an incorrect aspect ratio. Some people wouldn't want to play like this, and I understand that point of view. However, I would argue that the trade off is worth it because you get the even pixels you would get on a CRT (if narrower ones), which gets you less shimmering.
Thankfully, I'm lucky enough to have a CRT VGA monitor, so I don't have to make that choice. I can pick the square pixels option and then go into the monitor's OSD and stretch the image horizontally to get my correct aspect ratio:
So yeah, no need to output non-square pixels. And like I said, it's not just CRT users that benefit from this, but also owners of screens with "resizing" features (with results varying in quality depending on the resolution of the display).
But then again, even without resizing some users could just prefer having a slightly narrower or wider image if it means having no scaling blur. All I'm saying is that it would be nice to have the option.
EDIT: Did some further testing and found out Dolphin's render window is not to be trusted when trying to pixel count... So yeah, ignore the numbers I gave about games running at certain resolutions (next time I'll learn not to take shortcuts when pixel counting). The point still stands though, whatever the native game resolution might be.
UPDATE: If anyone wants to know, I did some manual pixel counting and Sonic Riders outputs 640x480 pixels, which explains how I was able to get no scaling when displaying it in a 640x480 window, whereas Mario Sunshine outputs 640x448, which is why, in a 640x480 frame, it only produces vertical scaling.
I've read of this technique but I've had no luck with it so far. Set Window to Auto-adjust and tried auto, 4:3, and stretch to window aspect ratios. All these options always give me an incorrect internal resolution no matter what I do.
The thing is that as of now Dolphin always stretches the image to either a certain aspect ratio or to a window/fullscreen size. This means you will get scaling to sizes that are not integer (for ex. 1.25x or 1.5x) and that will cause the blur filtering to kick in to hide the fact that the pixels are of different sizes (for ex. two 1.5x pixels become a 1x pixel and a 2x pixel, distorting the image).
I used a program called Sizer and dolphin set to Stretch to set the window to the correct size, but the window border was included in the size, so I used an xfb image to help resize the window manually. I was then able to take a dolphin-screenshot and it came out to the correct 640,448 dimensions. The sizer size was 642,480. It sounds close to 640,480 but it is counting the bulky top of the rendering window.
3a8082e126