So I've been making some improvements to the SDL2 port, and one of the things I added back was support for sdl_flags. Now using command line options, you can choose between SDL's accelerated renderer (which works better on newer computers, and can still run at faster than 100% emulation speed on a 2.0 GHz Core 2), and SDL's software renderer (which works better on really old or slow computers). I also added a command line option to allow you to disable the SDL_RENDERER_PRESENTVSYNC flag, in case you want to run without that to make performance testing easier, as you can just pass the options "-vn" and the emulator will run as fast as it can.
Both the accelerated rendering and the software rendering modes allow you to resize the window to an arbitrary size.
I also made the "-f" command line flag switch the resolution of the monitor again, because on older computers that makes it much faster than having to scale up to the full resolution of your monitor if you don't have a decent GPU. Fullscreen mode is back to being fast again for both accelerated and software rendering modes, even on the 2.0 GHz Core 2.
I fixed the screenshotting function so the screenshot it saves is always 630x448, no matter what your window size is, rather than it being fixed at 720x224. And I also added a feature so if you're holding down shift when you press printscreen, the screenshot will be 240x224. (320x224 had too many artifacts). Unfortunately on Linux, GNOME traps the print screen key, which means unless I remap it at the OS level, I can't take screenshots at all.
- Could we remap the screenshot key to something else so everyone on Linux can use the screenshotting function?
- Which rendering option should be the default?
My 9 year old 2.0 GHz Core 2 can run both the accelerated mode and the software mode faster than 100% emulation speed, but the software rendering mode can't use the default SDL_RENDER_PRESENTVSYNC flag, so if we want the default to be a buttery-smooth 60fps
, then I think it should be accelerated, and people with older computers can just pass the -w flag to switch over to software rendering. Thoughts?
Edit: Uze, if you want to check it out before I issue a pull request to you, the code is here: https://github.com/artcfox/uzebox/tree/uzem140-fast
Can you test that compiling my uzem140-fast branch which includes the "-Ofast -flto -fwhole-program" in both
the CFLAGS and LDFLAGS of the Makefile works on Windows? That gave the emulator a whopping 35 MHz speed boost on my desktop, so if it works on Windows too, that will be a great thing to have.