This post is about getting RetroArch working on the Banana Pi running Arch Linux. I’m going to tell you, how to achieve a satisfying SNES emulation experience.
The first attempt installing the retroarch package and trying to emulate the good old Super Mario World was disappointing. It was completely messed up as I had less than one frame per second caused by the lack of hardware acceleration.
So I needed to build RetroArch for myself with OpenGLES hardware acceleration enabled. This way, the BPi is able to run most SNES roms quite well. Unfortunately the header files provided by the sunxi-mali Git Repository lack of GLchar definitions required when building RetroArch (see also this issue on Github). But its possible to use current header files from another machine to build successful (see below).
Building and installing
Clone the original RetroArch repository and run configure with appropriate arguments:
cd $HOME git clone https://github.com/libretro/RetroArch.git cd $HOME/RetroArch ./configure --enable-gles --disable-oss --disable-sdl --disable-netplay
If we would build right now, we’d get following errors soon:
CC frontend/frontend.c In file included from frontend/menu/../../gfx/glsym/glsym.h:8:0, nbsp; from frontend/menu/../../gfx/gl_common.h:38, from frontend/menu/../../gfx/shader_common.h:26, from frontend/menu/menu_common.h:34, from frontend/frontend.c:27: frontend/menu/../../gfx/glsym/glsym_es2.h:7:1: error: unknown type name 'GLchar'
… and so forth…
This is because of the outdated gl2.h and gl2ext.h header files provided by sunxi-mali. We just going to use those from another machine. Just backup the existing files and copy the new ones from your desktop PC from/to the location /usr/include/GLES2.
I put them on Pastebin in case, some of you don’t have these header files: gl2.h and gl2ext.h.
So when you have the correct header files in /usr/include/GLES2 then we can continue building and installing:
make sudo make install
Furthermore, you need a libretro implementation. There are plenty of implementations available at the AUR. To get a satisfying SNES experience, I suggest installing libretro-pocketsnes from AUR (keep in mind to add “armv7h” to the arch list in the PKGBUILD):
yaourt -S libretro-pocketsnes-git
When it’s done, you can test your RetroArch setup:
retroarch -L /usr/lib/libretro/libretro-pocketsnes.so [ROM_FILE]
Congratulations, you just gained nicely SNES emulation with RetroArch on your Banana Pi!
Zelda – A Link To The Past
Super Mario Kart
Super Mario World
As you see in the Mario Kart screenshot, glitches caused by libretro-pocketsnes are to be expected (the transparent placement is missing and the lifes are somehow messed). But all these games were definitely playable with appropriate frame rates.