libretro / mupen64plus-libretro

Mupen64 Plus libretro core that stays compatible with upstream.
GNU General Public License v2.0
35 stars 35 forks source link

Feature Request: Run games in 1920x1080 in 4:3, without stretching the actual image #12

Closed Gagert closed 6 years ago

Gagert commented 7 years ago

I have just recently began to migrate from Project 64 to RetroArch using libreto cores for my Nintendo 64 gaming needs.

This libretro core seems to do a decent job maintaining the correct scaling while bumping up the resolution in games, making the square pixels in the in-game 2d-sprites appear as sharp and rectangular as it's supposed to (something graphic plugins from the past had a hard time calculating).

Even though there's an option of choosing both a 4:3 resolution and a 16:9 resolution, I still haven't found a way to play games that's 4:3 (like most of the N64 games) in a 16:9 resolution, without stretching out the image to fill the entire screens width. It would be nice having the ability to run N64 games on 1080p/4k monitors while filling the screens actual height, and inserting black bars at both the corners of the screen for maintaining the game's actual display ratio.

While playing games that's not sprite based but uses polygons for it's graphics and only 2d sprites for menu icons/text and such, I'm personally willing to sacrifice the perfect screen alignment pixel-wise to actually fill most of the screen with a tad higher resolution (in 4:3).

While playing sprite based games however I prefer a resolution that's the multiple of 320x240, that in my case is 1280x960.

Edit: In the GlideN64 gfx plugin, running in an emulator such as Project 64, there is the option for running the N64 games at 1920x1080 with 4:3 aspect ratio (not stretching the image to fit the screens width), as seen in this image.

For some comparison images, here are Mario 64 screenshots from both Project 64 and the mupen64plus libretro core:

Project 64 with GlideN64 Public Release 2.0

mupen64plus libretro core

In Project 64 I'm able to fill most of the screens height in 1920x1080, while the mupen64plus libretro core can only offer me 4:3 resolutions if I want the correct width, in this case maximum 1280x960 (1600x1200 is too large for my 1920x1080 screen).

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/43700654-feature-request-run-games-in-1920x1080-in-4-3-without-stretching-the-actual-image?utm_campaign=plugin&utm_content=tracker%2F53677400&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F53677400&utm_medium=issues&utm_source=github).
Gagert commented 7 years ago

A late update regarding a workaround I found:

I can create custom resolutions in the Nvidia Control Panel, so I made a non-standard 4:3 resolution equivalent to the 16:9 resolution 1920x1080. In other words, using aspect ratio calculators online I found that the resolution of 1440x1080 is the 4:3 counterpart to the full-hd 16:9 resolution of 1920x1080.

After I made the non-standard resolution of 1440x1080 in Nvidia Control Panel, I got the ability to choose that particular resolution in the mupen64plus-core itself in RetroArch. Finally I can utilize the full height of my screen while playing N64 in RetroArch, while not making all the characters in-game stretched sideways / fat.

Now I got what I was looking for, but still I have to admit that this may not be an optimal solution to this issue (too much hassle). I would personally define this as a current workaround.

I hope that some day there will be an option of choosing 16:9 resolutions in this core, while also keeping the 4:3 aspect ratio in the games that doesn't support widescreen. In other words, having the ability of having black borders at both the left and right side of the screen, while keeping the games image at the center, filling the entire height of the 16:9 resolution.

Update: I was dead tired when I wrote this; I somehow misread the libretro cores resolution of 1920x1440 as 1440x1080, and thought that I magically through making a custom resolution of 1440x1080 in Nvidia Control Panel made it available in the libretro core.

Gagert commented 7 years ago

This is a copy-paste from a response I got from the user hizzlekizzle regarding my duplicate-thread regarding the very same issue in the Parallel libretro-core:

"Those internal resolution numbers shouldn't have any effect on whether the image fills your screen. They just scale the framebuffer and then that framebuffer is handed off to RetroArch for final scaling to the monitor output. You can go greater than 1080p and it will just scale it down to 1080p. Or at least, it should. Has that not been your experience?"

As long as I set Aspect Ratio in the Video menu in RetroArch to "4:3" instead of "Core Provided" as I did before, and select a resolution higher than my display can provide in the mupen64plus Options menu, I end up with a down-scaled image that actually does not look bad at all. So the suggestion works as intended.

However, this is in my opinion somewhat confusing compared to how it's done in Project64 with the GlideN64 video plugin. There you can select your native resolution as fullscreen resolution, followed by selecting your chosen Aspect Ratio, and you're good to go.

Edit: I must have been very tired tonight; I thought that adding a custom resolution in Nvidia Control Panel of 1440x1080 made it visible in the libretro-core. Instead, I only saw that resolution of 1920x1440 and somehow read it as 1440x1080 in my tired mind.

Edit 2: In earlier versions of RetroArch (1.5.0), down-scaling the image from a higher resolution actually made some bad scaling-artifacts in-game (uneven angles), thereby doing the suggested solution with RetroArch 1.5.0 made the angles very ugly. This seems to be improved quite a lot now since the games now use anti-aliasing with this core while using a newer version of RetroArch. However it still seems like a down-scaled image still is less preferred than a image that is not down-scaled in both this core and the Parallel core.

Gagert commented 6 years ago

Since writing this thread, I've been able to set up MSYS2 on my Windows 10 PC (adding all the required dependencies and compiling cores with my setup).

I added the resolution of 1440x1080 (the 4:3 aspect ratio resolution filling the height of a 1080p screen) by going into the mupen64plus source folder, then the libretro folder and opening libretro.c with CodeBlocks. The code in libretro.c was surprisingly easy to read; I found the lines containing all the different resolutions and added the resolution of 1440x1080 there. After that I compiled mupen64plus with MSYS2, moved the freshly build mupen64plus core to my RetroArch cores folder and now I got the resolution I always wanted for my 1080p screens.