After RetroArch v1.1 – RetroBox

I was meaning to make this announcement after RetroArch v1.1 was released and this idea has been a bit long in the works. However, due to some sudden unexpected Kickstarters that have taken similar concepts and tried to create some kind of questionable monetization scheme around it, I felt compelled to make a pre-announcement about what we’re going to do post-RetroArch v1.1

RetroBox and why it’s needed

So the concept of RetroBox is based on a couple of problems:

  • There’s no real game console that is ‘open’ and which allows RetroArch to be on there without a jailbreak or a hack of some kind.
  • The ‘consoles’ that are open have an OS (Android) that is absolutely unsuitable for real-time performance oriented apps, such as (I don’t know) games. I’ve talked about this incessantly since 2012, but finally even the commercial games press seems to be becoming aware that there are definite performance bottlenecks associated to Android that prevents games from running at a stable deterministic framerate (read about all the problems here for instance – hardware that should be more than powerful enough with any other OS that do the job properly – http://www.eurogamer.net/articles/digitalfoundry-2014-nvidia-shield-tablet-review)
  • SteamBox/SteamOS seemed like the perfect vehicle at first for a true ‘open source’ gaming console that gives us a little bit more freedom than the typical Sony/Nintendo/Microsoft offerings. However, plenty of problems there as well. First of all, the fact that it’s limited to Intel. Second, the high prices these SteamBoxes are going for. Third, the unconventional gamepad which seems just totally ill-suited for the kind of ‘retro games’ that are commonly played in RetroArch. Fourth, the fact that it’s still by a commercial company like Valve, which operates its own DRM app store, and therefore at any time (no matter how well-intentioned) can change what is allowed and what isn’t on the platform to suit its business model. Fifth, SteamOS is a bit less ambitious than I initially thought it would. Still being dependent on X11 means we still don’t escape the X11 performance tax when ideally they should have just made their Steam launcher run on top of DRM/KMS inside a console for optimal latency. A bloated Debian distribution might make for a ‘safe’ OS but not sure if Debian is the right way to go for a gaming OS and it’s going to cause a lot of maintenance issues in the future.
  • All of these ‘alternatives’ that exist so far, either fall into the Android camp and are therefore no good (Ouya and the usual suspects), and/or they are being run by entrepreneurs who put their bottom line first before any passion for the project in general. Trying to base your operations around such a thing is like trading one evil (the big silo’ed off console platform holders) for another one, and in the end I’m not sure if the newer evil is going to be all that better to begin with.

RetroBox

So what is the RetroBox project going to amount to?

  • Figure out a way to turn ARM/x86 small form factor boxes (from Intel NUCs all the way into XBMC boxes) into plug-and-play game consoles powered by RetroArch.
  • Have a free open source distribution that is very lightweight.
  • Strive for the most optimal conditions possible – ie. DRM/KMS mode, no X11, minimal packages installed in this distro other than what libretro ports/RA actually needs.
  • Make this a ‘Proof of Concept’ for what a game console centred around the libretro API can be.
  • Plug-and-play – can be operated with a gamepad entirely, keyboard and mouse are entirely optional.

RetroBox will be an open-spec game console. It’s not owned by any particular company, and it will operate much like the 3DO/VCR model where any manufacturer could make his own box. Because RetroArch is so impressively multi-platform and portable, you don’t even have to limit yourself to a specific processor architecture like ARM – most libretro ports are available for most microarchitectures available, so you can pick and choose your own hardware.

The aim here is to create an ecosystem that is more open, more optimal and definitely more interesting than what is provided so far by the Androids, iOSes, and Steams of this world. And to have a POC game console platform of our own that illustrates this best.

Why is RetroArch a good fit for this?

  • From its inception, RetroArch has featured a gamepad-controlled UI that has thrown many PC users for a loop that were used to traditional WIMP point-and-click UIs. We have sticked to our guns for a long time and maintained this was the right road to travel, because we always envisioned RetroArch as this ‘game console platform’ all unto itself. RetroBox will see that high-level concept come into reality and made even more convenient.
  • Our API perfectly allows for the kind of plug-and-play portability we want and need through this game controller abstraction called the RetroPad.
  • RetroArch is second to none when it comes to optimal audio/video. Despite the so-far pretty lacklustre eyecandy found in its UI, there is basically nothing out there it plays second fiddle to when it comes to this department. And it’s also one of the few projects that aims for certain best practices on Linux like ensuring that everything can be ran from DRM/KMS instead of just solely depending on X11.  Latency, audio/video performance, and the impeccable shader subsystem all make for a great platform for a game console.
  • People are already doing this right now anyway. There’s an obvious demand for this and there’s an obvious need among all those ARM boxes to introduce some sanity to them and to make sure that things run right out of the box. It’s a lot of work having to fiddle around with these boxes and to even get semi decent/passable performance out of them. Might as well focus on this and make it part of the overall plan

So what is this project NOT going to be?

Every effort will be undertaken to ensure this will not be your typical sleaze-ridden entrepreneurial ‘scam’ where the main incentive is ‘get-rich-quick’. There will be NO Kickstarters, no Indiegogos, no crap like that going on. I would find it morally unconscionable raking in thousands of bucks for an undertaking like this off something that is typically going to be used by most people as a way to play emulated videogames run on copyrighted trademarked video game consoles made by commercial companies. If other people want to sell out and try to make themselves a buck off this ‘retro game stuff’, they can go ahead and do it. We will try to maintain a clean nose and keep ourselves out of this potential legal quagmire. The ramifications will be huge in the long run and we refuse to have any part in it.

So, crowdfunding is not an option. So far we are going to run the RetroBox project with our own personal finances and with the hardware we already have. Which is why it’s essential that we have your support in this endeavor. Hardware gifts will be of the utmost importance in ensuring this project will become better. However, hardware gifts will only be necessary for stuff we necessarily need – so that this doesn’t become another way of profiteering altogether.

Not just about emulation

Also, RetroBox will NOT be only about emulation. I keep stressing that RetroArch is NOT a multi-system emulator frontend, and I mean it. I want to ultimately see this evolve into its own game platform, with indie games, emulators, games, virtual reality applications and rich multimedia applications all competing for the user’s same attention. So you will be also seeing a lot of additional stuff not related to emulators at all, but which will be just as exciting.

Of course, because this is an open-spec console, emulators don’t get relegated to the sidelines like they would on a traditional videogame console. This is what will make RetroBox different – the freedom is in the hands of the user, and the platform holder doesn’t dictate to the user what he/she can’t do with this box.

What about features that people want to see?

We will try to make sure that this has as many of the bells and whistles that these sleaze-ridden KIckstarter-founded projects have such as Ignition and Gamertopia. The whole NES Remix-idea for a kind of retro game console is a good idea, as is netplay, leaderboards and that kind of thing. We think we can do all of this better anyway because of RetroArch’s impeccable cross-platform nature. I think we can do this netplay in a way that every RetroArch port out so far on any platform can play together with the RetroBoxes all the same.

What about standardization?

  •  There will be a Retro Performance Level (going from 0 to 15 and beyond) introduced that will range from very low-tier hardware to top-tier hardware (such as, say, SteamBox specs). Libretro cores will be able to look at this level at runtime, compare it to the performance level of the box in question and thereby evaluate whether or not the machine it’s running on will be able to run the core at fullspeed. If it can’t, it will display a warning.
  • This console will be about libretro ports using the libretro API. Therefore, we can gut any part of the Linux distribution that we don’t need.
  • I strongly believe in zero dependencies and keeping everything as lightweight as possible. Cores are also designed with this ‘zero-dependency’ ideal in mind. Everything that a libretro core should need should already be baked into the core from the start, so that it isn’t necessary for us to ship a truckload of packages (all of which can be potential dependencies and maintenance hazards) into the main distribution. So that means that if a core requires libusb, libusb gets baked in. If a core requires SDL, either the SDL specific code gets entirely removed or SDL gets baked in. Zero dependencies and making sure as much as possible is contained within the same dynamic library as the core itself will make this game console model sustainable.
  • By keeping this limited to the libretro API, it will basically be no different from any other RetroArch port to any platform we have done before in the past, like the PS3, 360, and whatnot. It is the same concept, except this time we’re going to make it happen for all this commodity hardware that is around.

So what will all this take?

  • Time
  • Community support. More hands on decks for this project, the better – since we will need to cover a lot of hardware
  • Dedication and the will to see this through to completion. Not going the obvious sleaze-ridden entrepreneur route obviously puts us at a large commercial disadvantage to play on an even playing field but then having risks is all part of the fun and we think users can see behind the promises of most of these other projects anyway. We have had a consistent track record so far and we are not going to compromise on our core values now either.

So when will all this start?

So yeah, this announcement is a bit of a ‘jumping the gun’ type of affair, but I felt I had to say something. I felt compelled to make this post because I see a lot of Johny-came-latelys trying to make a buck for themselves by filling an obvious gap in the market, and I just want them to know about our plans and that there’s something coming up that will put all their ‘accomplishments’ to crap. Hopefully people have gotten wise at this point and they don’t buy into another Ouya. Then again, given the obvious sleaze associated to these Kickstarter-led ‘game consoles’ and the empty hollow platitudes and ‘dumbspeak’ (and most importantly the amount of money they can accrue), you never know.

This project will start being kicked into high gear after RetroArch v1.1 is released. If you are interested in helping out in any way possible, drop us a mail at [email protected].  This project is being started because most importantly we feel like doing it and not out of any sleazy attempt to ‘get rich quick’ or whatever the incentive is by most of these entrepreneurs. Hopefully our attempt to keep this ‘real’ and not branch off into entrepreneurial la-la land will be appreciated by endusers, developers and platform holders alike.

RetroArch v1.1 – What to expect

Here’s a rundown on what you can expect from RetroArch v1.1, the next version of RetroArch to be released. Please bear with us that it has taken us so long since v1.0.0.2 to come up with a new official release. This v1.1 version has been long in the making to ensure that this new version will be a big major milestone for RetroArch in general.

So, here’s what the release will comprise of –

Going all PSP – PPSSPP core

RetroArch-0803-070141RetroArch-0803-095319

We have ported the popular PlayStation Portable emulator, PPSSPP, over to the libretro API. This marks the second big libretro implementation to be using libretro GL after Mupen64 Plus.

It is shaping up to be a very stunning release.  Linux users will especially appreciate the changes we’ve made which makes it possible to run PPSSPP in DRM/KMS mode (something which wasn’t possible in standalone since glew has X11 dependencies).

We’re aiming for two modes of operation. One mode will be in which the PPSSPP core functions much like standalone – where it saves everything inside a main PPSSPP assets directory and you install games from PPSSPP’s GUI. The other mode is more like a headless mode – the way every libretro core has functioned up until now. Saves will be saved in .srm form and it will be possible to directly boot ISOs/PBPs/.BINs without having to install them first from a GUI. There’s something to be said for both modes of operation.

We of course take no credit for any of the real emulation work in PPSSPP – the only thing we take credit for is porting it to the libretro API. We take nothing away of the accomplishments made by this team and we hope that the libretro port can be pushed upstream once it’s done. Please pay them a visit at http://www.ppsspp.org/ and support their efforts to improve PSP emulation – they’ve already come a long way in the two years it has been public.

We’ve made some screenshots of the core in action which you can check out here and on Twitter. We’re striving to expose as many of PPSSPP’s features as possible through core options for headless mode operation.

Needless to be said, we think this will be one of the main standout features of RetroArch v1.1. Hopefully it will open up people’s minds about how RetroArch and libretro doesn’t necessarily mean retro-grade graphics – some of these games  like Tekken 6 and Soul Calibur Broken Destiny don’t look far removed from their PS3 versions when upscaled to 2x or 3x. And to see it running as fluidly as it does in RetroArch without any audio breakup whatsoever or any frames dropped is a sight to behold.

The PPSSPP core will be available for PC (we’re aiming for Linux/OSX and Windows), and mobile (iOS/Android/Blackberry). After version 1.1 is released, we will research an Xbox 360 port.

Going all PSP – RetroArch PSP

BtwRRGxIUAAc91s

Just having a PSP core would be one thing, but RetroArch v1.1 is going to go one extra mile by also simultaneously appearing on the PSP itself.

Nearly all of the credit for this port should go towards aliaspider- I played only a minor but crucial part in the proceedings. He has really done a bang-up job porting over a great many new cores over that are useful for the PSP, as well as improving the performance of existing cores so that they run well on the PSP.

Right now we have greatly improved the performance of FCEUmm, NXEngine, Gambatte, Mednafen PC Engine (and others) so that they run fullspeed at PSP. Please keep in mind that a PSP for general purpose code is about two times as slow as a Raspberry Pi. So you’re dealing with a very weak CPU here, and so it necessitates specific PSP-specific code to really get the most out of its performance. And thankfully the libretro API allows for this – the libretro API doesn’t prevent you from taking advantage of PSP-specific hardware features in order to speed up performance inside a core.

Aliaspider also made a port of TempGBA over to the PSP. This is a Game Boy Advance emulator based on gpSP Kai (itself based on gpSP – a now defunct emulator by Exophase). There’s also a preliminary port of the popular CPS2/Neogeo emulator, but it isn’t yet done. No idea yet if this core will make it for the v1.1 release.

Like hunterk’s previous blog post indicated, the portability of RetroArch is really coming into its own now. With the PPSSPP core, it will be possible to run RetroArch PSP itself. So essentially what you have is that RetroArch PSP can be made to run inside a PSP emulator which itself is being run inside a native platform version of RetroArch. How much farther can we go from here? The future only knows.

New cores

Several new cores will be appearing. We made a port of fMSX and BlueMSX to the libretro API. This was a home computer released in the mid-1980s that was backed up by a consortium of companies (among them a little company called Microsoft and another small fish called Sony). Oddly enough, while it couldn’t really be considered a major worldwide success, it was relatively popular in Japan and (of all countries) The Netherlands. This home computer is also noteworthy for receiving some of the first games Hideo Kojima made in his career, such as Penguin Adventure (one of the first games I ever played BTW) and Metal Gear 1/2.

There will be RetroKeyboard support for these cores to sweeten the deal, but we will also try to have some sane default configs for the RetroPad per-game for some of the more popular games.

There will also be a Vectrex core, Vecx. This was another ’80s game console, and the main notability of this game console is that it wasn’t using sprite rasterization but rather vector-based. For all practical purposes it could be considered the first real home console capable of ‘3D graphics’.

BrYY54qIMAAmYEr

Lakka – a new GUI beginning

thumb

Lakka will appear inside RetroArch starting as of version 1.1. So far, users have been using a very low-fi menu called RGUI. It is perfectly scalable from low-resolution displays to high-definition TVs, but there’s no denying it looks very much like something you would expect from a DOS program.

Lakka will be a more full-featured eyecandy UI. It will require OpenGL support inside the RetroArch version, so expect this to be usable on RetroArch PC and Android/iOS/Blackberry (PS3 maybe if it makes it for v1.1).

In terms of features and appearance, Lakka looks a lot like the PSP’s XMB frontend.

In the future, more menu drivers can be added, each being tailored towards a specific enduser preference. We have made the menu code far more generic to allow for different implementations which doesn’t require the coder to rewrite all the settings logic again and again.

You can watch a video of a prototype in action here – keep in mind that this is still a prototype and that the final version will look a lot more refined. In case you wonder, the guy showcasing it here is one of the authors responsible for the Lakka GUI –  Jean-Andre Santoni (known also as kivutar).

Audio DSPs / Software Video Filters

We already touched upon this in the previous blog post about RetroArch v1.0.0.3 (which has now morphed into version 1.1). This feature has been implemented and it makes it possible to apply audio DSP filters and video software fitlters to RetroArch’s audio/video output.

Blackberry 10

We received a Blackberry Z10 phone from Blackberry sometime ago. In return, we will fully support Blackberry 10 starting as of v1.1. A new audio driver has been written, ALSA QNX, which should be far more optimal than the OpenAL driver we had before. We also intend on writing a nice Qt UI which wraps around RetroArch itself.

I know there has been a lot of discontent among Blackberry users that there have been so few releases, but rest be assured, we’re working on it.

Revamped iOS / OSX ports

I finally bought a Macbook Pro, and so I’ve been spending a lot of work on the OSX / iOS ports of RetroArch as of late. We’ve revamped nearly all of the settings so that it is possible for settings to be exposed to WIMP menus. This will be put to good use in the OSX / iOS ports of RetroArch.

The iOS version will be totally revamped as well. Cjori was working with me sometime ago on Controllers For All support. Hopefully I will be able to approach him a week before release time or so that we can do some final beta testing before we put the final polished version out.

X-Arcade Tankstick support

xarcade

I received an X-Arcade Tankstick courtesy of Xgaming, and in return this device will be fully supported. Android support will be added, and I will also look into making it possible to bind it in RetroArch as two separate game controllers instead of it being recognized as a keyboard.

After v1.1, I will look into adding USB input drivers for the PlayStation3, Wii and Xbox 360 ports so that we will be able to use the X-Arcade Tankstick on thosee consoles as well without using their proprietary gamepad converter (which costs an additional $30).

Revamped Android port

Lots of work still remaining on the Android Port. The input code has been totally revamped and it should be possible to map a new gamepad directly from the menu. New input overlays have also been made (such as a a default RetroPad overlay) which works quite well.

Maybe if we make it in time we can revamp a lot of the UI code as well using our new generalized settings code which should prevent code duplication issues in the future.

Improvements to existing cores

Lots of improvements have been made to Mupen64Plus since the last new release, as well as a lot of other cores. We will also try to bring over the MAME/MESS 2014 cor e to Android – this might not appear on the Google Play Store since this will increase the APK size by about 150MB or so – instead a more fully featured version might be available on our new website.

New server

Starting with the release of v1.1, there will be another big change – a new server (Virtual Private Server), and with it will come a buildbot. We will finally have the ability to do continuous integration tests and have daily builds for the cores and the RetroArch platform versions. The existing website will soon be moved over to the new host – the transition will be as seamless as possible to the user, so hopefully you guys won’t notice when we finally make the switch.

So when will it come?

The rest of this month will be spent by me and others feverishly working to get all of this stuff in a presentable state. We also want to do a fair bit of Quality Assurance so that this next big version will be very solid. The estimated release is somewhere in early September. A new release is contingent on all these different factors all coming together. In case some parts might take longer than expected, we might just drop a version of v1.1 with some of these features being added later. In any case, you shouldn’t have to wait longer than early September.  Again, we’re sorry for some of the delays and announcements from before but we’re really trying to ensure here that this next RetroArch release will be a real big gamechanger and so the delays are justified from that perspective. Hopefully you’ll agree once it is dropped.

Also, I’m sure I neglected to mention a fair few new features as well in this writeup. In any case, there have been far too many changes since February of this year to sum up in one blog post. When v1.1 hits I will put up a more comprehensive overview of everything that has been added ,changed and improved.

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.

Libretro Client Introduction, Arcan

A key quality aspect of any API such as libretro is that there are multiple, independent, actors on both sides of the imaginary fence that the API represents; Multiple applications using an API (what we typically mean with “client” or “frontend”), and multiple implementations (what we mean when we say “core”). In a perfect world, you can mix and match clients and cores to your hearts desire and adapt things to fit your own specific needs.

In the emulation world, this is one aspect that sets the libretro project apart from many others in that it is not, as some critics may cry “a bunch of emulators bundled together like some weird game of katamari damacy” but rather an attempt to retrofit emulators (and nostalgic game engines) with an API so that they may be used on more hardware and software platforms and for additional purposes (validation, automated test suites, …).

Those of you reading this already know about RetroArch, the reference client with the primary goal of being clean, fast and extremely portable. There are others, and this post is to tell you of one of those, namely Arcan (http://arcan-fe.com).

One of the primary goals for Arcan is balancing versatility (being used for fun, weird and odd things), security, speed and portability. In the software world, it sits there quietly in a corner somewhere (and rather alone) between being a windowing system (like X or Weston), a game and graphics programming framework (like Love2D, Cocos2D, VisualTK, …), a hacking and reverse engineering framework and, indeed, a libretro client. The rest of the post will be dedicated to the libretro- related parts.

The first thing to cover is that Arcan is entirely script driven. You select some scripts to run (‘theme’) and that defines what Arcan will actually do. There are two major such themes, Gridle (that tries to mix and match styles from arcade frontends like Hyperspin, Wah!Cade and AdvanceMenu) and AWB that behaves more like a desktop environment but with some unexpected features that can be used to rather extreme ends. The screenshot below, for instance, shows one instance of Arcan with AWB running two instances of Arcan, one of them also running a libretro core. The display is simultaneously mapped to a 3D model.

The sets of pictures here (Gridle Examples) and here (AWB Examples) try to show a little more in-depth of what these two themes are up to. For those that prefer videos, this slightly dated youtube playlist shows a bit more on how things work. To work properly, the initial configuration in Arcan is slightly more difficult in the sense that you don’t just pick a game and a core and off you go, there’s an additional step involved in order to prevent nasty written scripts to do bad things to your computer.

Arcan expects all file operations to happen inside two folders, “resources” and “themes”. Resources are for save-states, additional artwork, data files (roms) and cores. An additional tool (“arcan_romman.rb” on Linux/BSD and arcan launcher on Windows) performs the job of scanning through the resource folder and to download extra artwork, metadata (like title, genre) and so on. This is done by scanning two subfolders, resources\targets and resources\games. You stuff your cores (like snes9x.dll) in the targets folder, create a corresponding subfolder like (resources\games\snes9x) where you put your roms and tell the tool to start building a database. Enough with the boring stuff, look on the Arcan wiki for more details.

To round this brief introduction off, lets demo a short script that launches two random games side by side, forwarding some input to both of them. To use / run, create a folder in your themes subdirectory called retrodemo and a file named retrodemo.lua inside the new folder. Type in the codeblocks below (or use the pastebin link).


function retrodemo()
-- load a translation table to get decent names for keypresses
symtable = system_load("scripts/symtable.lua")();

— query the database and return a table of all entries for a target called ‘snes’
games = list_games({target = “snes”});

— give up if nothing was found
if (#games == 0) then
shutdown(“empty database, can’t proceed.”);
return;
end

— launch two randomly selected games and save the handles for later
— game_callback is a function reference that will be called every time
— something happens in the core that we want to be alerted about
game_1 = launch_target(
games[math.random(#games)].gameid,
LAUNCH_INTERNAL,
game_callback
);

game_2 = launch_target(
games[math.random(#games)].gameid,
LAUNCH_INTERNAL,
game_callback
);

— place the two games side by side
move_image(game_2, VRESW * 0.5, 0);
show_image({game_1, game_2});
end

This function will be called when the engine is ready to run, all subsystems have been created and are up and running. We immediately launch two cores, but this still misses a callback and an function to handle input.


function game_callback(source, status)
if (status.kind == "resized") then
resize_image(source, VRESW * 0.5, VRESH);
end
end

This function will be called a lot, when the core has a frame ready, information about save state and other capabilities, if the emulation dies for any reason and so on. The first event is almost always “resize”, so we use that to force it to take up half the display.

Lastly, some input handling:

-- create a global input table that translates wasd,1 and ctrl/alt to special inputs
-- the libretro frameserver can handle.
keymap = {};
keymap["w"] = "PLAYER1_UP";
keymap["s"] = "PLAYER1_DOWN";
keymap["d"] = "PLAYER1_LEFT";
keymap["a"] = "PLAYER1_LEFT";
keymap["d"] = "PLAYER1_RIGHT";
keymap["1"] = "PLAYER1_START";
keymap["LCTRL"] = "PLAYER1_BUTTON1";
keymap["LALT"] = "PLAYER1_BUTTON2";

— this function will be called on any input received (including mouse, gamepads, etc.)
— for now, just check if its a translated device (aka keyboard)
function retrodemo_input(input)
if (not input.translated) then
return;
end

— translate the input using the table above
local key = keymap[ symtable[input.keysym] ];

— if it was a valid key, forward it to the two running cores.
if (key ~= nil) then
input.label = key;
target_input(game_1, input);
target_input(game_2, input);
end
end

In closing, there is a ton of stuff to explore and play around with in Arcan (humorously called ‘the emacs of frontends’ by some, though it should of course be vim..) — both for power users and for those of you with an interest for the lighter sides of programming.

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.