SetRes - companion app to launch scummvm at lower screen resolution

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
AndyHazz
Posts: 8
Joined: Sat Mar 11, 2023 7:39 pm

SetRes - companion app to launch scummvm at lower screen resolution

Post by AndyHazz »

My laptop has a high DPI native resolution and potato GPU, so by default ScummVM runs with laggy cursor/low framerate and spins up the fans as soon as the GUI opens.

This app makes ScummVM run in a fullscreen potato-friendly resolution you specify (e.g. 1920x1080), and returns to your previous resolution when ScummVM is closed. Much easier than manually changing screen resolution back and forth.

It'll take the target application and screen resolution as command arguments, so it could be used for anything really, not just ScummVM.

Posted here for anyone else who might find it useful: https://github.com/AndyHazz/SetRes/releases

Disclaimer, ChatGPT wrote this for me, I can't code C++ :roll:
It took a few attempts but the end result appears to work well, and the code appears to be fairly simple for anyone who might want to check it out.
AndyHazz
Posts: 8
Joined: Sat Mar 11, 2023 7:39 pm

Re: SetRes - companion app to launch scummvm at lower screen resolution

Post by AndyHazz »

Readme updated with some better examples, and SetRes.exe updated to not require any extra/missing DLLs, and allow extra commands to be passed to ScummVM (e.g. launch fullscreen or launch into a specific game) - https://github.com/AndyHazz/SetRes
User avatar
Raziel
ScummVM Porter
Posts: 1461
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Re: SetRes - companion app to launch scummvm at lower screen resolution

Post by Raziel »

Tell ChatGPT to make it portable and add endian awareness/support and I'll be impressed ;-)
AndyHazz
Posts: 8
Joined: Sat Mar 11, 2023 7:39 pm

Re: SetRes - companion app to launch scummvm at lower screen resolution

Post by AndyHazz »

Raziel wrote: Fri Mar 17, 2023 1:14 am Tell ChatGPT to make it portable and add endian awareness/support and I'll be impressed ;-)
Well, I guess you're joking but I asked and it spat out some new code with this summary:
Sure, here is some C++ code that should meet the updated spec. It uses the Windows API to change the screen resolution, run the target app, and restore the original screen resolution when the target app exits. It also uses Unicode strings to avoid issues with non-ASCII characters, and includes endian awareness for portability
.. though I've no idea what endian awareness is myself so I can't really verify that it has done what it says :roll:
The new code has some bugs too, it doesn't properly switch the resolution back after ScummVM exits, but what I had previously works well enough for me so I'll leave it there for now!
User avatar
criezy
ScummVM Developer
Posts: 916
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: SetRes - companion app to launch scummvm at lower screen resolution

Post by criezy »

It uses the Windows API
I guess ChatGPT does not have the same definition for portability as we do. :D

Maybe it used that meaning: https://en.wikipedia.org/wiki/Portable_application
While I think Raziel meant that one: https://en.wikipedia.org/wiki/Software_portability

Regarding the "endian awareness" request from Raziel, I guess this was indeed written as a jest since it isn't relevant/needed in this case (that is mostly an issue for multi-platform applications that read or write binary files; like ScummVM). I would actually have been impressed if ChatGPT had told you that.
User avatar
rootfather
ScummVM Lead
Posts: 167
Joined: Tue Mar 31, 2015 11:59 am
Location: Germany
Contact:

Re: SetRes - companion app to launch scummvm at lower screen resolution

Post by rootfather »

AndyHazz wrote: Wed Mar 15, 2023 8:01 pm Disclaimer, ChatGPT wrote this for me, I can't code C++ :roll:
It took a few attempts but the end result appears to work well, and the code appears to be fairly simple for anyone who might want to check it out.
Just out of curiosity: Was this done with GPT-3 (e.g. the default version on chat.openai.com) or with GPT-4, which is available via the OpenAI Plus program?
User avatar
Raziel
ScummVM Porter
Posts: 1461
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Re: SetRes - companion app to launch scummvm at lower screen resolution

Post by Raziel »

Yeah sorry, I didn't want to waste anybodies time...it was meant as a joke ;-)
AndyHazz
Posts: 8
Joined: Sat Mar 11, 2023 7:39 pm

Re: SetRes - companion app to launch scummvm at lower screen resolution

Post by AndyHazz »

rootfather wrote: Fri Mar 17, 2023 8:19 pm
AndyHazz wrote: Wed Mar 15, 2023 8:01 pm Disclaimer, ChatGPT wrote this for me, I can't code C++ :roll:
It took a few attempts but the end result appears to work well, and the code appears to be fairly simple for anyone who might want to check it out.
Just out of curiosity: Was this done with GPT-3 (e.g. the default version on chat.openai.com) or with GPT-4, which is available via the OpenAI Plus program?
Just the default/free version on chat.openai.com.

It's been fun throwing random changes to the spec (thanks Raziel :lol:), and seeing all the ways it tries to adapt the code. It even took me through setting up Visual Studio and setting up the project, as I'd never done that before.

Just a prompt like this is enough to get it started:
Let's write some code - The app should be called SetRes, and made using C++. It should accept 3 command line options. The path to a target app which may include spaces and optional flags (e.g. "C:\Program Files\ScummVM\scummvm.exe -f") a target screen resolution width (e.g. 1280) and height (e.g. 720). SetRes will run the target app. Then, change to the target screen resolution. When the target app is closed, restore the original display resolution. An example command to run the app would be:
SetRes.exe "C:\Program Files\ScummVM\scummvm.exe -f" 1280 720
.. but there will be compilation errors, and bugs, so you keep giving it feedback or revising the spec until it works. I've had more luck with bits of JavaScript as I have a better sense of what's possible. C++ is way outside my comfort zone :oops:
Post Reply