Quite a while back, I set out to squeeze a Raspberry Pi into my Retrode, aiming to combine both into what I believe is the "World’s Smallest Multi-Cartridge Console"… (feel free to convince me otherwise)
Lots of things happened in the meantime, so it was only last week that I finally managed to wrap everything up. And, you know what? Assuming you are kind enough to ignore my non-existent Linux chops, everything worked out quite nicely. I will provide the exact wiring of the USB connection as soon as I find the time for it (which, as you know all too well by now, doesn’t mean that it is ever going to happen ;))
On the software side, I prepared an SD card with RetroPie/Emulation Station as detailed in this excellent tutorial. Note that I used my other, still intact RasPi for this task, since the hacked one lacks the ethernet connection and hence cannot connect to package managers etc. Once I had plugged the SD card over into my FrankenPi, I found the configuration files for RetroArch (for SNES emulation) and DGEN (for Mega Drive emulation) and filled in the controller axes and buttons as the retroarch-joyconfig tool told me to. I also had to remove some controller bindings that caused RetroArch to save and retrieve freeze states on button presses. As for SRAM (savegames) RetroArch apparently looks for an SRM file in the same directory as the ROM file (ideal for our purpose); DGEN expects a weird and undocumented completely extensionless file in ~/.dgen/ram or so (I’m writing this up from memory; will have to check). My current proof-of-concept solution is based on an udev rule that watches for Retrode connection activity, and a bash script containing an endless loop that watches out for news from udev, mounts the Retrode, does some SRAM-file copying if needed, and starts up either the SNES or Sega emulator.
Needless to say, the software side is no different if you connect the Retrode to a Raspberry Pi as an external device. However, I am convinced that anyone with the slightest bit of Linux knowledge will easily do a much better job at tying everything together.
And now, here is the video: