📜 ⬆️ ⬇️

Turn the Raspberry Pi into a retro gaming console

Having received a treasured box with a “Raspberry Pie” , everyone plays with it in their own way, my first thought was to play it for real, namely to arrange on its base a kind of universal emulator of old games. Most of us played in the Dandy, many in Segou or SuperNintendo, and even despite the presence of new consoles of the current generation, they live in memory, this article is intended for those "touched" by nostalgia.


For Raspberry, there is a RetroArch port, if briefly, thanks to the libretro library, RetroArch 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, and you should 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 EmulationStation. Fortunately, a good petrockblog man wrote a script that automates the installation of these programs. I will say right away I tested it only on Raspbian (Debian Wheezy), in other systems something will be different, 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 we download the script itself from the githab.

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


Finally, run the script with sudo rights.

sudo ./retropie_setup.sh


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

After installation, you will find the RetroPie folder in your home directory, and there are several more

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


emulatorcore -> emulators themselves
RetroArch-Rpi -> Our RetroArch, configuration file located in /etc/retroarch.cfg.
EmulationStation -> GUI for RetroArch, configuration files are located in ~ / .emulationstation
roms -> as the name implies here you need to copy the corresponding ROMs.
SNESDev-Rpi > utilities for connecting the joystick from SNES, more here

To run the whole thing, enter in the console "emulationstation"
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 content.

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

Of course, the “Icon” parameter should be replaced with our own.

The next thing we connect the gamepad, because from the keyboard to play not comme il faut (and it does not work for me in RetroArch). I used the usual Chinese clone of the PlayStation controller, which sells for 10 € per pair on ebay, 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 displays the names of the various positions of the buttons (up, down, right, etc.) that should be pressed accordingly on the gamepad, 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 one more line there, to do 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, I have “11” corresponding to R3 (right stick).

We start the emulationtation 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 point you can already play, but finally a few tips.

If you do not 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 Segui, by default this is ".smd", that is, a ROM with the name Sonic.SMD (Unlike Sonic.smd) will not be determined!

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

PS If you have any comments on the style of presentation or spelling, please inform about it in the LAN.

Source: https://habr.com/ru/post/149914/


All Articles