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++
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.
SetRes - companion app to launch scummvm at lower screen resolution
Moderator: ScummVM Team
Re: SetRes - companion app to launch scummvm at lower screen resolution
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
- Raziel
- ScummVM Porter
- Posts: 1538
- Joined: Tue Oct 25, 2005 8:27 am
- Location: a dying planet
- Contact:
Re: SetRes - companion app to launch scummvm at lower screen resolution
Tell ChatGPT to make it portable and add endian awareness/support and I'll be impressed
Re: SetRes - companion app to launch scummvm at lower screen resolution
Well, I guess you're joking but I asked and it spat out some new code with this summary:
.. though I've no idea what endian awareness is myself so I can't really verify that it has done what it saysSure, 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
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!
Re: SetRes - companion app to launch scummvm at lower screen resolution
I guess ChatGPT does not have the same definition for portability as we do.It uses the Windows API
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.
- rootfather
- ScummVM Lead
- Posts: 182
- Joined: Tue Mar 31, 2015 11:59 am
- Location: Germany
- Contact:
Re: SetRes - companion app to launch scummvm at lower screen resolution
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?
- Raziel
- ScummVM Porter
- Posts: 1538
- Joined: Tue Oct 25, 2005 8:27 am
- Location: a dying planet
- Contact:
Re: SetRes - companion app to launch scummvm at lower screen resolution
Yeah sorry, I didn't want to waste anybodies time...it was meant as a joke
Re: SetRes - companion app to launch scummvm at lower screen resolution
Just the default/free version on chat.openai.com.rootfather wrote: ↑Fri Mar 17, 2023 8:19 pmJust 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?
It's been fun throwing random changes to the spec (thanks Raziel ), 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:
.. 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 zoneLet'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
Re: SetRes - companion app to launch scummvm at lower screen resolution
FYI, GPT-4 is also available for free by using Bing Chat instead of ChatGPT. As of a few days ago, it doesn't even require registration, just using Windows' built-in Edge browser (in non InPrivate mode) through Bing Chat's website or just through the browser itself by clicking the "Discovery" button.AndyHazz wrote: ↑Fri Mar 17, 2023 11:08 pmJust the default/free version on chat.openai.com.rootfather wrote: ↑Fri Mar 17, 2023 8:19 pmJust 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?
If you know some programming and like to be able to tweak the auto code and compile it to an actual EXE program (which you can put as a GitHub release), I recommend try the freeware AutoIt instead of C++. It can also be used to generate a GUIs (including dual GUI/non GUI programs). Last but not least, everything it does is portable by nature (including, if you choose so, the editor/compiler itself), unless of course you use it to install a driver, etc.
I've used it for for various like minded programs, such as launching another program at a lower volume (for programs that lack volume control), clean up leftovers left by other programs after they terminate, generating GUI frontends for console programs, etc.
Re: SetRes - companion app to launch scummvm at lower screen resolution
AutoIt looks fun, I might have a play with that, but simulating keystrokes to automate changing screen resolution sounds a bit fragile? I expect I could get something that worked for me but anybody with a different os version would probably find it fails ...lwc wrote: ↑Sat May 06, 2023 4:02 pm FYI, GPT-4 is also available for free by using Bing Chat instead of ChatGPT. As of a few days ago, it doesn't even require registration, just using Windows' built-in Edge browser (in non InPrivate mode) through Bing Chat's website or just through the browser itself by clicking the "Discovery" button.
If you know some programming and like to be able to tweak the auto code and compile it to an actual EXE program (which you can put as a GitHub release), I recommend try the freeware AutoIt instead of C++. It can also be used to generate a GUIs (including dual GUI/non GUI programs). Last but not least, everything it does is portable by nature (including, if you choose so, the editor/compiler itself), unless of course you use it to install a driver, etc.
I've used it for for various like minded programs, such as launching another program at a lower volume (for programs that lack volume control), clean up leftovers left by other programs after they terminate, generating GUI frontends for console programs, etc.
I did compile the c++ code into an exe, it even has an icon It's inside the zip you can download from the release page in github: https://github.com/AndyHazz/SetRes/releases/latest - I think it works really well for this limited use case. Instructions are on the repo landing page: https://github.com/AndyHazz/SetRes
I did try asking GPT-4 but the results were pretty similar, it was just faster at responding. I also tried asking Bard (since they recently enabled code generation) and had less success, it would just ignore some of the spec and didn't handle everything properly, maybe I could get it to work if I spent more time on prompt engineering.