SimCoupe for Raspberry Pi (SDL 2.0)

Previous versions of SimCoupe used SDL 1.2 on the Pi. SDL 1.2 video surfaces are fully implemented in software, typically giving a fixed-size output window without any fancy features such as alpha transparency (well, not at a reasonable speed).

SimCoupe also supported OpenGL though a thin SDL wrapper to give hardware acceleration on many platforms (including Linux and Mac). Unfortunately, the Pi only supports OpenGL ES 2.0 in hardware, so the plain OpenGL implementation fell back on a slow Mesa software implementation. This was slower than the plain SDL 1.2 video surfaces due to SimCoupe’s use of alpha blending for OpenGL scanlines.

I recently added SDL 2.0 support to SimCoupe, to give hardware acceleration support on most platforms, including the Pi. I was hoping to provide updated build instructions for you to make your own, but Rasbian doesn’t yet come with a binary libsdl2 package. You can build that yourself but it has a few extra package dependencies and the build process takes around an hour.

To save time I’m just releasing a pre-built binary package for now. Matching source is available at SourceForge, and if you really want to build it yourself I can help with build instructions. Things should be a lot simpler once Raspbian includes SDL 2.0.

Here’s how to get it:

wget http://simcoupe.org/files/simcoupi-20140202.zip
unzip simcoupi-20140202.zip

./simcoupe

This version has experimental support for vsync, so connecting your Pi to a modern PAL TV with picture processing should give nice smooth scrolling like the original SAM. Most PC monitors are generally fixed at 60Hz, even if you force a 50Hz mode using the hdmi_mode mode setting in config.txt on the Pi, so you probably won’t see any smoothness benefit.

You can run it from the console or under X, but OpenGL ES 2.0 support on the Pi only works in fullscreen mode. If you want to run in a window you’ll need to build with SDL 1.2 instead, which will be used if SDL 2.0 isn’t found. F5 toggles 5:4 mode, F6 toggles smoothing (bilinear filtering), and F7 toggles hi-res scanlines. Those key bindings may change in future versions, but they provide easy access to some of the newer video features.

This is still very much a development version, so there are some known issues:

  • The video options haven’t yet been updated for the new features.
  • Manual speed control supports only 50% and 100%.
  • Minor sound glitches on some setups due to vsync.
  • Higher than expected sound latency (needs investigation).

I’ve only tried it on the current Rasbian release so far, so it may or may not work on other Pi distributions. Please also make sure your system is up-to-date as newer firmware releases can make all the difference. You can do that using:

sudo apt-get update ; sudo apt-get upgrade

If keyboard input stops working or you’re experiencing random hangs, please ensure you’re using a compatible Pi power source. Cheap PSUs and USB ports may appear supply enough for basic use, but SimCoupe pushes the Pi harder than most apps and that can expose any weaknesses. A typical sign of this is that you’ll lose network access, which leaves only the red LED lit on the Pi board. Of course, if you don’t have your Pi connected to a network it’s normal to only have just the red LED 😉

I’d welcome any feedback on how well it works (or doesn’t) for you.