HiDPI vs SDL aspect ratio?

A forum about the Hatari ST/STE/Falcon emulator - the current version is v2.2.0

Moderators: simonsunnyboy, thothy, Moderator Team

Opaque
Atarian
Atarian
Posts: 4
Joined: Sun Jun 02, 2019 5:05 pm

HiDPI vs SDL aspect ratio?

Postby Opaque » Sun Jun 02, 2019 5:31 pm

Recently I've been lucky enough to aquire a 5k 27" monitor, and finding two alternate problems when running Hatari on in:

1) In "Keep desktop resolution in fullscreen" mode the ST screen is in right ration/size, but I get a lot of slowdown. I guess SDL is at some point trying to copy 5120x2880 each frame.

2) If I disable "Keep desktop resolution in fullscreen" mode SDL picks a 640x480 screen mode, which is the wrong aspect ratio for the monitor and is not full screen using the monitors scaler. It is fast though.

Is there any existing set of options I could tweak to do something like either:

a) "force full screen resultion to specific res? I could then pass in the mode I want fullscreen to use, e.g. 1280x720 or 2560x1440.

OR

b) "Disable desktop resultion in full screen but keep desktop aspect ratio": With zoom enabled Hatari requests 640x400 from SDL, at the moment SDL picks 640x480, but ideally would picks first resolution satisfying that size at 16:9, which I think would be 1280x720, if that is not available then does 1920x1080 and so on.

If a or b not already possible any clues on what would need to change in screen.c to add similar logic? Maybe there is an SDL hint for aspect ratio? I'm running on Ubuntu and can build from the git sources if that helps ( but I assume this isn't Linux specific ).

I can of course manually change my desktop resolution down to 1280x720 before launching Hatari in "Keep desktop resolution in fullscreen" mode, but that's quite a fiddlyt be a workaround - would like to make Hatari "do the right thing" when I launch it on the normal 5k desktop and then press F11.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1996
Joined: Sun Jul 31, 2011 1:11 pm

Re: HiDPI vs SDL aspect ratio?

Postby Eero Tamminen » Tue Jun 04, 2019 9:52 pm

I assume its SDL2 build.

I would assume SDL2 to upscale from Hatari framebuffer with Atari resolution to display resolution, which should still be fairly OK with reasonable GFX card / GL(ES) driver. Problem could be that your desktop is doing compositing even for fullscreen windows, which can be a perf problem when Hatari is doing screen updates at 60Hz. Have you tried a desktop which allows disabling compositing completely?

As to patching Hatari sources, try hard-coding the resolution in resolution.c::Resolution_GetDesktopSize().

Opaque
Atarian
Atarian
Posts: 4
Joined: Sun Jun 02, 2019 5:05 pm

Re: HiDPI vs SDL aspect ratio?

Postby Opaque » Sat Jun 22, 2019 11:04 am

Thanks. Looks like Budgie doesn't have an option to totally disable compositing. It does have the double negative laden "Disable unredirection of windows" as an option. But doesn't seem to help as I would like "unredirection", but somehow the hatari SDL2 full screen hints aren''t triggering it, or maybe it is and that wasn't the performance issue.

Very simple hard code of desktop res in GetDesktopSize didn't work, perhaps right approach is to add concept of min resolution as well as max resolution in the config which constrains appropriate screen size to switch to for full screen.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1996
Joined: Sun Jul 31, 2011 1:11 pm

Re: HiDPI vs SDL aspect ratio?

Postby Eero Tamminen » Sun Jun 23, 2019 10:07 pm

If you enable borders, do you get any better resolution with option 2)?


Social Media

     

Return to “Hatari”

Who is online

Users browsing this forum: No registered users and 3 guests