PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.56k stars 1.6k forks source link

[Feature Request]: Custom Window Size on Qt #6224

Open Accuracy-Matters opened 2 years ago

Accuracy-Matters commented 2 years ago

Description

Allow users to define a custom OSD display size, a feature present in the wxWidgets version of PCSX2 Presumably as an additional option in the On-screen Display settings, allows the OSD to be scaled to a custom size (and would be a godsend as a per-game setting)

Reason

For me, this would be easier for inputting a precise ratio while being able to factor in various edge cases As a primarily windowed mode player with a degree of OCD, the practical reason is to define a custom size and pair it with Fit to Window/Screen, allowing me to effectively adjust the OSD where the pixels are all evenly scaled by an integer so stretching doesn't produce any odd lines

It's different from Qt's Integer Scaling mode, which only scales by a factor of the framebuffer and can't cover cases such as 240p games being vertically squished (e.g 640x224, where a factor of 640x448 is much more desirable)

This is something I use pretty much every time I switch games in wxWidgets PCSX2 and the one thing that's holding me back from using Qt, and it's implementation (especially as a per-game setting) would be enough for me to switch from wxWidgets to Qt

Examples

Basically just Window for Qt

As mentioned in the reasons, this would allow 240p games to be scaled to a more presentable window size Going from 640x224 to 640x448, and then scaling it by an integer amount until the window fits comfortably within my 4k display

Internal res (640x224): Disgaea 1 Internal Desired res (2560x1792, or 640x448 x4): Disgaea 1 Custom Scale

This would also allow to adjust for cases where the framebuffer is adjusted in odd ways An example would be a game that has a constant display of 512x447, in which case it's desirable to scale 640 x4 (as it's the minimum power for 640 to be evenly divisible by 512) while simply scaling 447 x4

Desired res (2560x1788): Spongebob Movie Game Custom Resolution

In these cases you might ask "why not just stick with 4:3 stretch?" and it's simply because finding a multiple of 640x480 that's evenly divisible by a resolution of for example 512x448 results in something like 17920x13440, which definitely doesn't fit in a 4k screen, and the goal is to have pixels scaled and stretched by integer amounts and thus ratios that are/or around 10:7 fit my screen just right

refractionpcsx2 commented 2 years ago

Is unticking this (or ticking it) not the one you want?

image

Accuracy-Matters commented 2 years ago

That's for screenshots, not for regular play

refractionpcsx2 commented 2 years ago

reading back over your question, it sounds like basically you want integer scaling fixed, because the height should be doubled in "Double Strike" (non-interlaced) mode, so it isn't squashed like you show, which would be a better solution than stretch to fit and custom window sizes.

Accuracy-Matters commented 2 years ago

That would definitely be a good idea

refractionpcsx2 commented 2 years ago

I don't understand, it's working fine for me? This is integer scaling, before I've done anything to it. Am I missing something? Is there a specific setting I need?

image

image

Accuracy-Matters commented 2 years ago

Auto Standard fits to a 4:3 or 3:2 ratio specifically, which is not what I'm looking for as it creates uneven pixels Fit to Window does integer-scale to the actual framebuffer size, but since it isn't double-striked it looks squished

refractionpcsx2 commented 2 years ago

Okay I think I now what you want, you want it to display in the framebuffer size (Though with Screen Offsets it is stretched to the resolution it should be displayed in, which is usually 4:3), but we would need another aspect option to maintain framebuffer aspect ratio.

You do realise however this will be very wrong on a lot of games?

Accuracy-Matters commented 2 years ago

Most games can display even pixels on at least 2560x1792, since it can be evenly divided 640 and 512 horizontally and 224 and 448 vertically, and again can fit on my screen in a window The problem is defining Qt to use this specific size for the OSD, and many games have cases where the framebuffer is slightly different (e.g 512x447) or can dynamically change, that without a way to specify a specific size makes this harder to account for

I do think it'd be a good idea to have a double-strike option at least for games using a 240p (224 pixel) vertical ratio, since I personally prefer 10:7 over 4:3 due to it being what the PS2 internally displays most of the time

Ocatopuss commented 2 years ago

Here is another concurrence. Because of the "accurate" aspect ratio (like sth that should be square/circle is not displayed as oblong) of some games is neither 4:3 nor pixel ratio; f.e. the "accurate" aspect ratio of Metal Slug 3 is 19:14 (same as its Arcade i.e. original version), however the pixel ratio of the PS2 version is 20:14. Having said that, the "accurate" aspect ratio only applicable to its level/stage scene, some parts in the menu UI are still distorted. In some games there is not even a "accurate" aspect ratio even just in the level/stage scene: no matter how player adjust it, there will always be distorted things displayed; f.e. Castlevania - Symphony of the Night. The coordination problem is commonly seen in games that (mainly) use CRT as output devices (including some ported game that had their original release in the period when CRTs were the dominant display device). So in case like this some players have to adjust window size (maybe many times) to find a suitable ratio (relatively) for themselves.

Even in simple case, like pixel ratio is X:Y, but "accurate" aspect ratio is 4:3, some players may prefer to adjust based on horizontal resolution, while others prefer to adjust based on vertical resolution, especially if upscaling is used.

No offense and I thank the PCSX2 team for your efforts on QT version, but the lack of this feature is one of the main reasons I'm still using wxWidgets version. If any team member(s) could take their precious time off schedule to port the "custom window size" feature to Qt version it will be grateful. Thanks for your time to read this post.

refractionpcsx2 commented 2 years ago

Enabling screen offsets does also affect the aspect ratio and can correct it somewhat.

yes nothing is perfect, but everybody has different opinions on what's "right" and there never seems to be pleasing everybody.

Ocatopuss commented 2 years ago

Tried enabling "Screen Offsets" both on wxWidgets and Qt version, tested with Metal Slug 3, none of the results give the 19:14 ratio in level/stage scene (I even combined with some options on Qt version).

Yes nothing is perfect, but with this existing feature (well, at least on wxWidgets version) it can actually alleviate even solve some of the ratio coordination problems. May I venture to ask: is there something difficult or troublesome about porting "Custom Window Size" to Qt version? Or the port of this feature is already planned, it just takes time to implementation? If it is the latter, sorry for the bother.

refractionpcsx2 commented 2 years ago

Tried enabling "Screen Offsets" both on wxWidgets and Qt version, tested with Metal Slug 3, none of the results give the 19:14 ratio in level/stage scene (I even combined with some options on Qt version).

of course it won't. I just said it's probably closer.

Ocatopuss commented 2 years ago

I tested again with 1.7.2924 with a fresh generated PCSX2.ini, all other settings including window size use the default, only set BIOS and redefined some necessary keys.

With "Screen Offsets" off, in stage scenes it gave 796×597 the 4:3 ratio, with "Screen Offsets" on, it gave 795×597 – though only one pixel less but make the ratio more deviated from the "correct"(to get closest to 19:14, the size should be 810×597 without vertical resolution changed). Then I checked "Integer Upscaling" with "Screen Offsets" off, it gave 640×480, with on it gave 639×480. With "Screen Offsets" + "Show Overscan" on, it gave 807×551 (approximate 20.5:14, even more incorrect than pixel ratio 20:14); same setting plus "Integer Upscaling" on, it gave 641×437 – a ratio approximate 807×551.

Set "Window Size" to "Intelnal Resolution", other Graphics options revert to default, it gaves 597×448; btw the original resolution of Metal Slug 3 is 304×224, so the "accurate" size should be 608×448. With "Screen Offsets" on, it gave 596×448; plus "Show Overscan" on, it gave 538×367 – another ratio approximate 20.5:14.

So it looks like set "Screen Offsets" on cannot make the ratio "closer"; however maybe it will be suitable in some other cases...

But with "Custom Window Size", players who want to play the game with the accurate ratio in stages just need enter the multiples of 304 & 224 or whatever equal/approximate 19:14 and set "Aspect Ratio" to "Fit to Window/Screen" then ta-da, ratio is right; don't have to test on/off various options to get "somewhat". Everybody has different opinions on what's "right"? Then how about let them choose what's "right" for themselves by custom.

Anyway, if this feature cannot get implemented to Qt version (in a certain period?) because it is difficult or time consuming and there are other higher priorities, I understand and accept. But maybe, just maybe, players who need "Custom Window Size" could expect adjust the size in PCSX2.ini, or at least add a function let players see the changing resolution value in the status bar while resizing the window by dragging its border? Thank you for the continuous improvement of the PCSX2.

rigopoui commented 1 year ago

Okay I think I now what you want, you want it to display in the framebuffer size (Though with Screen Offsets it is stretched to the resolution it should be displayed in, which is usually 4:3), but we would need another aspect option to maintain framebuffer aspect ratio.

You do realise however this will be very wrong on a lot of games?

I was searching for something like this and stumbled upon this issue. Having a "Framebuffer" aspect ratio setting, together with "Integer Scaling" should produce pixel accurate output. Would this be easy to implement?

I guess that many games back then were made to be output at 4:3, even though they render at 10:7. However I think this it's still worth it to implement, as it would satisfy the OCD need for perfect pixel scaling :)