Ah, thanks SuperrSonic. If this and the below could be fixed I'd say this would be back on top as far as Game Boy emulators on Wii go.
Has anyone else noticed a sound issue with GB/GBC games in this fork? Over the course of about 2 and a half minutes, the sound gradually falls further and further behind the video (good place to test is somewhere like a game menu that beeps when you navigate it; try Pokemon Pinball for example). After a while, there's a jump in the sound as it "catches up" with the video and the sound is responsive again. I don't remember this in the mainline VBA GX, but it's a while since I've used it as I've been running GB/C games in RetroArch's Gambatte core, which doesn't seem to share this problem.
EDIT:
Ah, OK. For now, the 3x GBA rendering is cut off on a 4:3 TV.
I might separate the options out into:
- GB/GBC
- Off
- 1x
- 1x (with widescreen correction)
- 2x
- 2x (with widescreen correction)
- 3x
- 3x (with widescreen correction)
- GBA
- Off
- 1x
- 1x (with widescreen correction)
- 2x
- 2x (with widescreen correction)
Even on my widescreen TV, I prefer to have it render as if to a 4:3 TV and just change the TV's setting to letterbox the HDMI signal. That way the pixels don't get stretched horizontally.
At the very least, the current 3x GBA resolution should be removed. It's just plain bigger than the Wii's maximum framebuffer size. Wii (and GameCube) max out at 640*528 (50Hz) or 640*480 (60Hz). It doesn't matter whether the TV or Wii is in widescreen mode, 720 is more than 640. As SuperrSonic described, the best way to do a 3* scale on Wii/GameCube is to do 3* vertically but only 2* horizontally and recover the extra third by fudging with framebuffer/viWidth and setting the TV to widescreen. This third magnification won't be a true integer scale, but the Wii's viWidth is high quality and most TVs should do a decent job of the 16:9 scale, so the pixels should maintain most of their sharpness and won't look uneven.
But that's getting ahead of ourselves, so let's go from the start. If we assume 4:3, 640*480 framebuffer and 640 viWidth for a moment, we're starting out with the Wii's 10:11 pixels, and then we're throwing 2:3 pixels at those, so we've got 0.6060...:1 pixels now, while the Game Boy Advance uses square pixels. The first thing we can do to improve this is switch our TVs to widescreen mode . This stretches the image by a factor of 4/3 (I know that sounds confusing, but 16:9 is quite literally four thirds the width of 4:3), so now we 've got a pixel aspect ratio of 0.8080...:1.
We're almost there, now we need to make our pixels about 24% wider. We do this by adjusting the combination of framebuffer width and viWidth. Right now we have 640/640, or a 0% increase. The highest we can go with viWidth alone is 720/640, which is only a 12.5% increase. So we need to drop the framebuffer or both to a point where the viWidth is about 24% wider than the framebuffer. So our formula looks like this:
The viWidth will define the constraints for how large we need the framebuffer to be, since it's hard-limited to between 640 and 720 pixels. So our constraints are as follows:
Minimum framebuffer width:
Code:
640 / 1.2375 = 517.171717172
Maximum framebuffer width:
Code:
720 / 1.2375 = 581.8181...
So to get an ideal image, our framebuffer must be somewhere between 518 and 582. How should we decide? Frankly, it doesn't matter much, the game will look about the same anywhere along this sliding scale--sometimes a fraction of a percent wider or slimmer but nothing noticeable. The game itself will only be displaying in 480 of those columns; anything outside will be empty and how much we leave empty is fairly irrelevant.
In theory, the truest square pixels should be found at a framebuffer width of 522 and a viWidth of 646. The full formula for square pixels thus ends up looking this this:
Code:
(10/11) * (2/3) * (4/3) * (646/522) = 1.000038701188126475483
Presumably this is the absolute best choice for achieving true square pixels, so probably the best option for VBA GX if you were to include a 3* GBA mode for widescreen users.