(Menu) "Maximum viewport height/width" options for integer scaling
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
Description
This is somewhat similar to #4158 in concept but I believe distinct as it relates explicitly to the viewport and integer scales rather than to arbitrary zooming on the image.
Certain platforms don't have ideal integer scaling resolutions to suit all displays. One example is the NTSC Sega Genesis/Mega Drive, which displays 224 lines of usable signal. On a 1080p screen, the Integer Scale option will scale this to 896 (4x), leaving a huge 184 unused lines, or 17% of the display's total height. Switching over to a custom aspect ratio and adjusting manually, it's possible to scale to 1120 (5x), losing 40 lines (3% of the total viewport height, or just 8 Mega Drive scanlines) off the top and bottom of the screen.
Using a custom aspect ratio does not adequately resolve this issue because cores like Genesis Plus GX cover multiple platforms, each with different resolutions and aspect ratios. I suppose you could work around these limitations using content directory overrides, but that seems like a fairly complicated and fiddly solution that requires overrides for every system you want to use this feature on.
Expected behavior
I'd like to see an option to set a maximal resolution for integer scaling, distinct from the actual screen resolution. e.g., a user with a 1920*1080 display might set things up as follows:
- Integer scaling: On
- Maximum width: 2000
- Maximum height: 1120
- Aspect ratio: (anything except Custom)
Now, integer scaling will use the nearest integer scale that fits into that range, and since 224*5 is 1120, you'll get a centered 5x integer scale on the vertical.
(Note: I do imagine "maximum width" would be almost completely useless most of the time, since users are far more likely to be constrained on the vertical, simply because there aren't many older games with widescreen aspect ratios, but there are occasional cases where it would still be nice to have.)
This feature could be hidden behind the Advanced Options toggle to avoid cluttering the Video configuration tab if desired.
Actual behavior
With integer scaling enabled (and without using a custom aspect ratio), RetroArch currently rounds down to the nearest integer scale that fits into the screen's resolution, with no option to round up in edge cases where that might be more desirable, sometimes resulting in a heavily windowboxed image.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named in the issue. Start by locating RetroArch's integer-scaling and Video configuration implementation, then trace how the current screen resolution determines the scale. Done means maximum width and height settings select the nearest fitting integer scale, preserve non-custom aspect-ratio behavior, and center the result; add coverage for the 224-line, 1080p example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100