RetroArch in Your RetroArch

RetroArch-PSP running inside of libretro-PPSSPP via RetroArch

ToadKing unveiled what he’s been working on lately: a libretro port of PPSSPP! Meanwhile, aliaspider and Squarepusher have been working on porting RetroArch to Sony’s PSP. Put these two works-in-progress together and you have the first instance of RetroArch-ception.

Hopefully, one or both of these projects will be ready for the upcoming 1.1 release (formerly planned to be called 1.0.0.3, but there are enough major changes even without these to warrant a more significant version bump). Even if they don’t make it, though, savvy users can always checkout and build the code from their respective repositories on github.

RetroArch and 240p

I got my hands on an old CRT computer monitor (VGA, 31 kHz) this past weekend and wanted to play around with pushing out native-res, “240p” signals from RetroArch.

RetroArch doesn’t have any built-in resolution switching capabilities, but we can use the operating system’s built-in tools to handle the task. In Windows, that means using CRT_EmuDriver and a compatible GPU, while in Linux we can use xrandr from the desktop environment. You can also theoretically force resolutions via KMS, but I haven’t had any luck getting it going.

Since I’m running Ubuntu 14.04 (Trusty Tahr, LTS), I could add my custom resolution modelines to my xorg.conf and then choose between them before launching a game, but instead I am using launch scripts that add and set the desired mode at runtime. So, on my desktop, I have a little bash script that reads like this for SNES (EDIT: forgot a couple of things):

#!/bin/bash
xrandr –newmode “snes” 5.979 320 332 368 380 240 242 246 263 +CSync
xrandr –addmode DVI-0 snes // replace DVI-0 with your active display; you can find it from ‘xrandr -q’
xrandr –output DVI-0 –mode snes
wait 5 // this will ensure that RetroArch doesn’t launch before the screen fully switches resolution
retroarch –menu –fullscreen -c ~/.config/retroarch/snes.cfg \  // points to my pre-configured SNES controls 🙂
&& xrandr –output DVI-0 –mode 1024×768 // this will take us back to a normal resolution upon exiting RA

Notice that the last line only goes off once RetroArch closes, since it’s hooked to the launch command with ‘&&’.

RGUI automatically scales to the resolution and looks great. Oddly enough, I had to set my in-game aspect ratio to 16:15 to get everything to map up properly. Regardless, the results speak for themselves (these pictures are huge; click to check out the glorious full-res shots):

Super Mario World, native resolution, unfiltered.

 

Super Metroid looking lovely.

The only problem I have right now is that RA is detecting a refresh rate of ~47 Hz instead of ~60, for some reason, so it’s playing a bit slowly/jumpy. I can get a normal game speed by turning on the ‘threaded video’ option, but that’s suboptimal and leads to jerky scrolling. Regardless, this is a good start and I’ll be working with Squarepusher to iron out the current issues. If anyone has any experience forcing resolutions in KMS, please leave a comment or drop by IRC at Freenode – #retroarch.

You can use the same process with arcade games, you just have to replace the script’s modeline with one that corresponds to the game’s native resolution.