Turn the Raspberry Pi into a retro gaming console

Having received the treasured box with the "Raspberry Pie" , each plays with her in her own way, my first thought was to play it for real, namely to arrange on its basis a kind of universal emulator of old games. Most of us played in Dandy, many in Sega or SuperNintendo, and even despite the presence of new consoles of the current generation, the memory of them lives on, for such "touched" nostalgia this article is intended.


There is a RetroArch port for Raspberry , in short, RetroArch, thanks to the libretro library, allows you to use emulators through a common API, that is, something like a frontend for various emulators. There is also a GUI for RetroArch - EmulationStation , well, do not forget about the emulators themselves from various developers. Thus, we have 3 levels, the emulators themselves, the wrapper from RetroArch and the graphical interface of EmulationStation. Fortunately, a good person petrockblog wrote a script that automates the installation of these programs. I will say right away I tested it only on Raspbian (Debian Wheezy), something will be different on other systems, but the essence should remain the same.
The current version includes emulators for the following consoles: Atari 2600, NES (Dendy), SNES, Sega Mega Drive / Genesis, MAME (arcade machines), Gameboy Advanced, and the great and terrible Doom.

So, first install the dependencies.

sudo apt-get install git dialog


Then download the script itself from the github.

mkdir ~/git_dir
cd ~/git_dir
git clone github.com/petrockblog/RetroPie-Setup.git


Finally, run the script with sudo privileges.

sudo ./retropie_setup.sh


During the launch process, the script will ask about the type of installation, “binary” - that is, already compiled files, or “source” - installation from the sources, the latter assumes the most current versions of the programs, but it lasts 2-3 hours, you decide.

After installation, you will find the RetroPie folder in your home directory, and a few more

pi@raspberrypi ~/RetroPie $ ls
EmulationStation emulatorcores RetroArch-Rpi roms SNESDev-Rpi


emulatorcore ->
RetroArch-Rpi emulators themselves
-> Our RetroArch settings file is located in /etc/retroarch.cfg.
EmulationStation -> GUI for RetroArch, settings files are located in ~ / .emulationstation
roms -> as the name implies, you need to copy the corresponding ROMs here.
SNESDev-Rpi > utilities for connecting a joystick from SNES, more details here
To start this whole thing, we enter “emulationstation” in the console
pi@raspberrypi ~$ emulationstation


To exit emulationstation press F4.

For ease of launch, create a shortcut. To do this, create a file with your favorite text editor (in the vim example) with the following contents.

vim ~/Desktop/emustation.desktop


[Desktop Entry]
Version=1.0
Type=Application
Name=EmuStation
Comment=EmulateStation, GUI for Retro Game Emulators
Categories=Game
Exec=§usr§bin§emulationstation
Icon=§home§pi§.joypad.svg
Terminal=false
StartupNotify=false

Разумеется параметр «Icon» следует заменить на собственный.

The next thing we connect the gamepad, because playing from the keyboard is not comme il faut (and it doesn’t work for me in RetroArch). I used the usual Chinese clone of the PlayStation controller, which sells for 10 € per pair on ebay, in fact, there should not be any problems with the definition in the system. After connecting, enter the following command in the console

sudo ~/RetroPie/RetroArch-Rpi/tools/retroarch-joyconfig | sudo tee -a /etc/retroarch.cfg


The screen will show the names of the various button positions (up, down, right, etc.) that should be pressed accordingly on the controller, these values ​​will automatically be added to the RetroArch configuration file. But that’s not all, to exit RetroArch using a gamepad, you need to add another line there, for this, open "/etc/retroarch.cfg" and add the following line to the end,

input_exit_emulator_btn = "11″


where "11" is the value for your button on the gamepad, for example, my "11" corresponds to R3 (right stick).

We start the emulationstation again, the program should recognize that we are using a gamepad, and also ask to enter the positions of the various buttons. Actually everything, from this moment it is already possible to play, but finally a few tips.

If you don’t see your games, although you copied them to the roms folder, check if their extension matches the one specified in the configuration file, the register is IMPORTANT!

less ~/.emulationstation/es_systems.cfg


For example, for Sega, the default is ".smd", that is, a ROM named Sonic.SMD (unlike Sonic.smd) will not be detected!

Well and most importantly, emulators are still developing, many of them are still not working at full strength, almost everyone has problems with sound, but for a start, I think that this is not bad either.

P.S. Если есть какие то замечания по стилистике изложения или орфографии, сообщите, пожалуйста, об этом в ЛС.