Retro game emulation is one of the most popular uses of the Pi boards. It is a very cheap alternative to larger systems and can handle many different game emulators. There is an open source project called EmulationStation that handles many different systems.
There are a few different ways to install this and unfortunately, at the time of writing this book, there isn't a premade RetroPie image for the Banana Pi. So, we will have to install and compile the software manually.
The end result will be an easy-to-use emulation machine.
Before we get started with the installation of the software, we will need to make sure that we have everything up to date. If you are using Raspbian, you should also update the firmware by using the following command:
sudo apt-get update sudo apt-get upgrade
We can now install the EmulationStation software. We will need to edit the boot config file and add a line that will set the GPU memory to 32. We will do this so that we don't run out of memory while compiling the software.
sudo nano /boot/config.txt
We will add this line to the file, save, and exit, as follows:
gpu_mem = 32
Once we have saved and exited the file, we will immediately reboot the system, as follows:
reboot
After the system restarts, we will need to start installing the dependencies for SDL2. This is important. So, you will need each of these packages:
sudo rpi-update
The libudev-dev
package is particularly important because if you skip it, you may not have keyboard support inside the software later. We can now compile and install SDL2. First we will download SDL2 and unpack it, as follows:
wget http://libsdl.org/release/SDL2-2.0.1.tar.gz tar xvfz SDL2-2.0.1.tar.gz rm SDL2-2.0.1.tar.gz pushd SDL2-2.0.1
Now we will compile the library, as follows:
./configure --disable-video-opengl --host=arm-raspberry-linux-gnueabihf make sudo make install popd
We will get some output that looks like this:
We might as well remove the folder since the library is installed. This can be achieved by using the following command:
rm –rf SDL2-2.0.1
Now we can move on to actually compile EmulationStation. We will pull the Git repository and check out the unstable branch first, as follows:
git clone https://github.com/Aloshi/EmulationStation cd EmulationStation git checkout unstable
If you are following the instructions on the EmulationStation website, you will notice that they pass in different arguments to the cmake
command. This will produce errors. In order to properly build EmulationStation, we will need to use the following commands:
cmake . -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype/ -DCMAKE_CXX_COMPILER=g++-4.7
Now we can compile the software, as follows:
make sudo make install
You can launch EmulationStation by using the command line and typing emulationstation
. Now we will have to reverse the changes that we made to the config.txt
file under boot/
, as follows:
sudo nano /boot/config.txt # Remove the line we added earlier.
You now have a fully functional system.
18.117.236.133