What is Emulation Station, and what does it do?
Emulation Station is essentially a launcher for emulators; when RetroPie has been installed, it loads automatically when the Pi is booted, and allows user to select a game from the library, which is loaded into the required emulator.
Please note: the following assumes some familiarity with Linux, the terminal / console, and commands for basic navigation and file editing.
A future post will cover core information which may be useful when getting to grips with the Pi at a lower level. Whilst the command line can be daunting if you’re only ever used to GUI systems, you really only need a smattering of commands to manipulate the files necessary for customising a RetroPie installation*
A couple of important questions to address regarding the emulators shown in the Emulation Station User Interface, before looking at the main configuration file:
Q. Why isn’t the Megadrive (Genesis/SNES/PlayStation etc) emulator showing in the list?
A. Emulation Station shows the emulators included in RetroPie in a gallery-style list which the user can scroll left or right, however a large number of the supported emulators are not shown by default. It is necessary to place at least one game ROM/image file in the emulator’s corresponding ROM folder for the emulator entry to appear in the UI.
Q. Why is there more than one entry for the SNES (Megadrive/Genesis/N64 etc) in the UI?
A. RetroPie includes multiple different emulators for several systems, including the SNES, Megadrive, and N64. In RetroPie prior to version 3, it is necessary to place game ROM/image files in the corresponding ROM folder of each emulator you wish to use. If, for instance, you want to use the Dgen emulator for some standard Megadrive games, and the Picodrive emulator for the others (and/or 32x ROMs), you need to place the appropriate ROMs in the appropriate folder – if you want to run the same game under both emulators, you need to copy the ROM file into both folders.
The important item to note is that there is only one image representing a given video game system within the Emulation Station UI, which can lead to confusion as you cannot visually or textually distinguish which emulator is being selected (e.g. the logo graphic for the Megadrive emulator would appear twice in the scenario listed above). Increasing the confusion, generally the entries are not grouped together as you scroll the gallery of game system entries in the UI.
Emulation Station‘s main configuration file is es_systems.cfg and resides in the following folder:
The file follows a very simple standard XML format, consisting of a single systemList element, within which multiple system elements appear – there is one entry per emulator.
Q. What are the sub-elements in a system entry, and what do they control?
A. Each entry specifies elements for:
- fullname – ‘friendly’ name as it appears in the UI
- name – emulator’s shortname
- path – location of ROM files for the emulator
- extension – file extension(s) for ROM/images used by the emulator. Emulation Station will only display files having the specified extension(s)
- command – executable file (script or emulator) and parameters to launch the emulator with the selected game image, along with any system-specific parameters
- platform – specifies which video game / computer system the emulator is emulating
- theme – controls appearance of entry in the UI
If you’re using the RetroPie SD card image, the config file is already set up with entries for each emulator included, paths to ROM images correctly set etc.
You don’t have to change anything, but may decide to edit the config to change the order the items appear in the UI, the names shown, to hide specific emulators (such as the Apple 2 entry), or to alter which file extensions are included when the ROMs for a given emulator are shown (see below).
The config file is also the place you’ll need to make changes if you want to customise controller/keyboard support for the Emulation Station UI itself.
Q. How do I change the order of the emulators in the Emulation Station UI?
A. The order in which game system emulators are displayed in the user interface is determined by the order in which the corresponding entries appear in the configuration file.
An example for one of the Sega Megadrive / Genesis emulators, ‘Dgen’, is as follows:
<fullname>Sega Mega Drive / Genesis</fullname>
<extension>.smd .SMD .bin .BIN .gen .GEN .md .MD .zip .ZIP</extension>
<command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 "/opt/retropie/emulators/dgen/bin/dgen -f -r /opt/retropie/configs/all/dgenrc %ROM%" "dgen"</command>
The ‘Command’ entry, for RetroArch Emulator Cores**, calls a script named ‘runcommand.sh’, which specifies the emulator’s executable file name to launch the emulator, along with arguments to control various aspects of the emulation. The arguments will include the name of the game image to load, along with any emulator-specific settings (such as screen resolution)
** for information on RetroArch, see RetroPie system overview – software and hardware
Emulation Station can launch emulators which are not part of RetroArch, as seen in the following entry which loads the Nintendo 64 emulator ‘Mupen64Plus’:
<extension>.z64 .Z64 .n64 .N64 .v64 .V64 .zip .ZIP</extension>
<command>/opt/retropie/supplementary/runcommand/runcommand.sh 1 "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/mupen64plus-libretro/mupen64plus_libretro.so --config /opt/retropie/configs/all/retroarch.cfg --appendconfig /opt/retropie/configs/n64/retroarch.cfg %ROM%" "mupen64plus-libretro"</command>
Note that the Mupen64Plus emulator also exists as a RetroArch compatible build, which appears in the configuration file in the following entry:
<extension>.z64 .Z64 .n64 .N64 .v64 .V64</extension>
<command>/opt/retropie/supplementary/runcommand/runcommand.sh 1 "/opt/retropie/emulators/mupen64plus/bin/mupen64plus --configdir /opt/retropie/configs/n64 --datadir /opt/retropie/configs/n64 %ROM%" "mupen64plus"</command>
Q. How can I change which file formats an emulator can use?
A. The file formats which a given emulator can use cannot be changed, but it is possible that not all the supported file extensions are listed in the config entry for the system.
For example, when configuring the non-RetroArch-core Atari800 emulator for the Atari 8-bit range (400/800/XL/XE), I found that by default only files with the ‘.xex’ extension were listed in the Emulation Station UI.
Looking at the PetRockBlock blog entry for the emulator, the files supported are .xex, .bin, .a52.
Checking the development support pages for Atari800 emulator it was clear that the emulator can support several more file types, including the commonly used formats atr xfd and dcm:
Updating the entry allows access to the other rom file formats:
<extension>.xex .XEX .atr .ATR .xfd .XFD .dcm .DCM</extension>
In a later post I’ll cover how Emulation Station can be configured to allow navigation of the UI with multiple controllers
* As an aside, although I spend most of my time working on various versions of Microsoft Windows, I evaluated Linux as a desktop replacement for a company I was working at in 1999/2000, and more recently worked with hosted Linux servers when working on web development projects based on variants of the LAMP stack
Links: Raspberry Pi and Gaming Emulation via RetroPie