About 240p mode on Wii

Isn’t possible to upscale to 768x224 using Wii GPU texture hardware (GX) and downscale to 640 with the video encoder?

The video encoder always upscale horizontally the framebuffer rendered by the Wii GPU up to the max. resolution. So, maybe it could also downscale it automatically?

Edit: I’ve read the framebuffer can only handle a max width of 640 pixels. But there are PC Engine games, like Forgotten Worlds, that use 336x224 (meaning 672 when multiplied by 2) running perfectly on Wii Mednafen.

Actually, isn’t the game picture just a texture? Aren’t we talking about different things? (Texture resolution VS screen resolution). As a texture, I guess it’s possible to render the game screen into a textured and pre-transformed quad so you can position it and scale it in any way you want.

So, rendering 768x224 to support CPS1 and CPS2 games would be possible.

Anyway, I will happily accept your decision to only change the resolutions manually. :slight_smile:

BTW, to add or remove resolutions do you only need to change the rgui.c file like it was done in the commit above?

For some reason there is a problem with PC Engine games: the vertical resolution needs to be slightly adjusted because as it is right now there are scaling artifacts when the screen is scrolling (vertically). It’s possible to fix the problem adjusting the overscan value, but since the overscan resize the picture horizontally and vertically (you cant adjust only the width or only the height), fixing the vertical resolution will also break the horizontal res.

I guess the optimum resolution for PC Engine could be 512x233 (and not 512x239) - but I would like to confirm and if it’s that simple to add new resolutions I could try to learn and find out by myself.

Face it - the kind of ‘pixel perfect graphics’ you have pretended you can get out of the Wii all depends on a big hack that isn’t even remotely scaleable. Perhaps if those Xbox 1 guys succeed at getting 240p out of the Xbox 1’s video encoders you could finally have sensible and decent 240p video on a videogame console without the crappy GX scaling or the arbitrary limits enforced on framebuffer size and VI width/height.

When properly adjusted, it looks pixel perfect, I guarantee you. I already compared the picture from a SNES game between a PC using an “ArcadeVGA” (special card that can output true low resolutions modes - like 256x224) and the Wii (using 512x224) - both using component cable connected to a video switch hooked to the same TV (Sony Wega CRT) - allowing me to rapidly alternate between the Wii and the PC video signal for a better comparison, and it looked absolutely the same (and I am overly critical about the subject).

There is actually a huge arcade scene focused on replicating the original experience, and with the release of Retroarch (and Final Burn Alpha), I think a lot of people will be interested, since using the Wii is much more cheap, simple and user friendly.

then tell one of them to submit a patch or pull request

You say component. Does that GPU support component? Does your CRT TV support component? That’s new to me. Anyway, have you compared this to the real consoles, connected through RGB SCART?

As for the rgui.c file, why don’t you just download RetroArch from git, change that file, and compile RetroArch for Wii? Then you will find out if it works.

Just tell me what extra VI resolutions you need in there and I’ll throw that in as well - might as well go overboard with it.

Regarding all of this 240p talk, my main question is how exactly did old consoles display these signals? Take for example SNES. The resolution is 256x224, but as I understand, an old NTSC CRT displays a fixed resolution of 480 vertical lines. So, even though the SNES outputs 224 lines, every other line is a scanline to make up the full 480 lines (well, 448 lines with the rest being overscan I assume). If this is the case, what happens to the 256 horizontal lines? Wouldn’t this have to be stretched by a factor of 2 to maintain the proper aspect ratio? I only ask because I tend to agree that Retroarch does look identical to the original consoles, and I wonder how this can be the case if the pixels are in fact being scaled so much. I would think there would be a loss of detail and some type of pixel distortion, but this does not seem to be the case. Could it just be the way an old CRT handles the signal? Anyhow, as far as the 240/224p resolutions, they look amazing, regardless of how its achieved. Remember, emulation is never 100% identical to the real thing, only an “illusion” I guess you could say. If it looks/plays/sounds the same, that’s all that really matters. No complaints here, merely curious how old systems really worked.

I might be wrong here, but I don’t think a CRT has a fixed resolution, it only has a max resolution. There is no “scaling”, but rather the pixels change in size so that any resolution that is not too big gets displayed natively.

My CRT TV support component. I use a transcoder to convert the VGA signal to component. I didn’t compare with the real consoles, but I also compared with the Playstation 2 running a few emulators - and the PS2 is truly capable of producing a variety of low-resolutions.

Wii and PS2 looks identical.

I think it looks identical because the vertical resolution is the same as the original console and the vertical resolution is much more important.

Also, if you double the horizontal resolution and have the emulator perform a scaling, it will look identical to the original resolution. So, 640x240 looks exactly the same as 320x240. That’s why the Wii is using horizontal doubling for this purpose.

Like sparklewind said, a CRT don’t have a fixed resolution. But the correct ratio of a SDTV is 4:3 and any other resolution that isn’t 4:3 will be “analog stretched” to fill the screen.

The SNES resolution, for example, is 256x240 (not 4:3), so the picture will be stretched. The same happens with the Wii, but the console itself stretch the screen, and not the TV. It looks identical, in either case.

Thanks. This is my preliminary list of custom resolutions. I think it’s much more practical to sort by the vertical resolution in ascending order.

{
   GX_RESOLUTIONS_320_102 = 0, // Lynx
   GX_RESOLUTIONS_320_144, // Gameboy and Gamegear
   GX_RESOLUTIONS_448_144, // WonderSwan
   GX_RESOLUTIONS_320_152, // Neo Geo Pocket Color
   GX_RESOLUTIONS_480_160, // Gameboy Advance
   GX_RESOLUTIONS_512_192, // Master System
   GX_RESOLUTIONS_640_200, // Doom, ScummVM and DOSBox
   GX_RESOLUTIONS_384_224, // CPS1 and CPS2 
   GX_RESOLUTIONS_448_224, // IGS arcade games
   GX_RESOLUTIONS_480_224, // Arcades
   GX_RESOLUTIONS_512_224, // SNES and others
   GX_RESOLUTIONS_340_232, // PC Engine
   GX_RESOLUTIONS_512_232, // PC Engine
   GX_RESOLUTIONS_512_236, // SNES Ys games
   GX_RESOLUTIONS_336_240, // Arcades
   GX_RESOLUTIONS_384_240, // Arcades
   GX_RESOLUTIONS_512_240, // NES and others
   GX_RESOLUTIONS_576_224, // Konami Arcades and others
   GX_RESOLUTIONS_608_224, // NeoGeo 
   GX_RESOLUTIONS_640_224, // MegaDrive and others
   GX_RESOLUTIONS_640_240, // Arcades and others
   GX_RESOLUTIONS_400_254, // Mortal Kombat
   GX_RESOLUTIONS_640_448, 
   GX_RESOLUTIONS_640_480,
   GX_RESOLUTIONS_LAST,
};

unsigned rgui_gx_resolutions[GX_RESOLUTIONS_LAST][2] = {
   { 320, 102 },
   { 320, 144 },
   { 448, 144 },
   { 320, 152 },
   { 480, 160 },
   { 512, 192 },
   { 640, 200 },
   { 384, 224 },
   { 448, 224 },
   { 480, 224 },
   { 512, 224 },
   { 340, 232 },
   { 512, 232 },
   { 512, 236 },
   { 336, 240 },
   { 384, 240 },
   { 512, 240 },
   { 576, 224 },
   { 608, 224 },
   { 640, 224 },
   { 640, 240 },
   { 400, 254 },
   { 640, 448 },
   { 640, 480 },
};

All tested and working (with the exception of 400x254, which is meant for Mortal Kombat for a future Mame release). Any feedback is appreciated.

The only problem is the aspect ratio of handhelds consoles. You can’t change the aspect ratio when using low resolution modes and for a very good reason, since it’s a mode only meant for 4:3 TVs. So it should be the normal behavior.

But this is problematic for handhelds systems. The vertical resolution is perfect, but the width looks wrong, because the picture is been horizontally stretched to fill the screen.

The solution is to choose a higher horizontal resolution and create borders to keep the aspect ratio.

Is it possible without hacking the video code even more?

Adjusting the overscan could solve the problem, since it creates borders - but the width and height are reduced at the same time, messing with the integer scaling.

Even so, I think it’s possible to use a specific resolution + overscan value that could solve the problem. But first, I would need to know exactly how many pixels are modified when you decrease the value by 0.01 - at first I thought -0.01 equals -1 pixel… so, creating a custom resolution of 560x240 and applying an overscan of -0.80 would reach 480x160 with borders - which is perfect for GBA, for example. But it doesn’t seem to work like that.

OK. After a lot of work, testing every possible resolution and overscan value, I have finally reached the optimum resolution + overscan for some handhelds, preserving a perfect picture without artifacts and keeping the aspect ratio at the same time. The aspect looks even more accurate than Mednafen-Wii.

Just for the record, the values are:

Game Boy Advance = 598x200 and -0.49 of overscan

Game Boy (Color) and Game Gear = 530x240 and -1.32 of overscan

These are the most popular handhelds. I won’t bother with the others, since it takes a huge amount of time to get the ideal resolution and overscan.

Gameboy and Gamegear should actually have different aspect ratios, the Gamegear screen is aprox. 4:3 I believe, I may misremember this.

I have more flexibility adjusting the aspect for GBA - but not with Game Boy and Game Gear. Increasing the vertical resolution also reduces the width - and since the main problem was how wide the picture was before, I have increased up to the max vertical resolution (x240).

While not perfect (I would prefer a bit narrow picture for GameBoy - but I couldn’t go beyond x240), the aspect ratio is not much different from the real thing.

600x194 with a -0.68 overscan seems to be a good enough approximation for Wonderswan in case people feel like trying.

Yes. It works fine.

Thanks for sharing.

Btw, I trying to access the link on your signature (FBA compatibility list), but it’s broken.

Hey there!

I love this subject! I don’t know if it will be useful, but NEOGEO has two different resolutions! It’s easy to confirm that even by checking PNG screenshots on Maws!

They are ~ 304x224 and 320x224, which gives us: GX_RESOLUTIONS_608_224, // NeoGeo GX_RESOLUTIONS_640_224, // NeoGeo

C.

Is there anyway that we could get RetroArch to automatically switch to the resolution instead of having to switch every time?

No.

Resolution changing on the Wii is a hack and doing it automatically is a bad idea.

Well, I more meant if you had a certain option on, similar to the other emulators on the Wii that have a “Classic” mode.

Thanks for the reply.

Sorry for the bump. I just wanted to express a desire for 480p versions of all resolutions where possible. A lot of HDTVs deal poorly with lower resolutions like 240p, 224p, etc. I was in the IRC a couple of days ago asking about 512480p for NES, but I was just starting up some CPS-2 games and noticed there’s no 384448p for the platform (or 384*224p either for those guys) either.

I know this sucks and everyone is always asking for more custom resolutions, but I’ve gone through all the cores tracking down the major resolutions I’d consider “missing” as of 0.9.9 (fix1).

384*448p (CPS) 480*432p (Game Gear) 512*384p (Master System, sort of Game Gear) 512*480p (NES) 608*448p (some Neo Geo)

Generally I don’t think handhelds are appropriate for custom resolutions because they tend to use square pixels and aren’t intended for 4:3 display. I think for those, the ideal is just to run them in 640*480 with a custom ratio. Game Gear is an exception because of its wider pixels.

Arcade games are a huge mess, obviously. With those I’m basically content to do what I do with handhelds, since there’s just way too many resolutions to specifically cover.

PC-Engine is another bastard case, I know there’s games that run at nonsense dimensions like 256232 (e.g. Dragon’s Curse), but frankly I feel like these “close enough” resolutions should just be handled with custom ratios: in this case, 512480p would be fine with a custom ratio dropping the vertical resolution to 464.

I think just the above (and the vertically halved equivalents for those 240p people) should cover the major platforms and standards, leaving behind weird crap that users can handle on a case-by-case basis.

EDIT: On further thought, it might also be nice to see 576p50 support in RetroArch. While no commercial software uses it, both Wii and GameCube are perfectly capable of displaying it. In the rare case that a 50Hz game is being played (e.g. Virtual Boy or the occasional PAL exclusive) it would be great to have a progressive resolution to run them in. Thanks for any consideration.

If you need code to look at, Extrems has been proactive about adding 576p to his projects, like OpenTTD and Not64.

I was wondering whether it would be possible to implement Custom Aspect Ratios for resolutions that dip below 480i, such as 240p modes.

The specific reason I ask for this is that in older versions of the emulator it was possible to obtain a very accurate “double-strike” picture for handheld systems such as the Game Boy and Game Boy Advance, through the use of the ‘overscan’ trick (just like tisurame pointed out in his posts within this thread).

On newer versions of Retroarch Wii this is completely impossible: one can indeed achieve accurate resolutions (such as 320x144 for the Game Boy), but the proportions of the screen end up being completely messed up and trying to customize the aspect ratio doesn’t produce any visible effect.

Is such a change technically feasible? It would make this software even more unique and interesting. Thanks in advance.