Turning the Raspberry Pi into a Game Console


Almost a year ago, I bought a Raspberry Pi which is a credit-card-sized computer with an ARM processor. I picked RetroPie as its operating system. RetroPie is a Linux distribution based on Raspbian (optimized Debian for the Raspberry Pi) which turns the Pi into a retro-gaming console. My USB game pads worked out of the box with RetroPie. On boot-up, RetroPie starts a game selection interface named EmulationStation. When EmulationStation launches for the first time, it allows you to configure your controllers.

However, the initial configuration is just pretty basic. Button combinations for, e.g., exiting a game and returning to the EmulationScreen have to be set manually in /home/pi/RetroPie/configs/all/retroarch.cfg. The following configuration exits games by pressing select + start on an SNES controller:

input_enable_hotkey_btn = 8
input_exit_emulator_btn = 9

To save the state of a game by pressing select + right and to load the saved state by pressing select + left, add the following lines to the same file:

savefile_directory = /home/pi/RetroPie/savestate
savestate_directory = /home/pi/RetroPie/savestate
input_save_state_btn = 5
input_load_state_btn = 4

An issue that I encountered was that the Pi froze after exiting games, requiring a restart. User alexbleks suggests setting BLANK_TIME=0 and POWERDOWN_TIME=0 in the file /etc/kbd/config which fixed the issue.