View on GitHub

retrokit

RetroPie and ROM automation platform

Extensions

retrokit provides a number of extensions to RetroPie that help improve overall quality of life when building and running new systems. This documentation helps describe those extensions.

autostart

autostart.sh (located at /opt/retropie/configs/all/autostart.sh) is executing on system startup and is responsible for launching emulationstation. On its own this is a simple, yet effective, script. However, there are cases where retrokit ideally integrates additional hooks into the “autostart” script so that certain commands are executed before emulationstation launches and certain commands are executed after emulationstation launches.

In order to allow for various scripts to be hooked into the autostart process, autostart.sh is reimplemented so that it supports the following hooks:

When autostart.sh runs, the following will happen:

When the onlaunch script, ends the following will happen:

configscripts

In RetroPie, configscripts are responsible for configuring emulators based on new inputs being set up through EmulationStation. By default, RetroPie supports automatically configuring the following emulators:

This functionality is fantastic and makes using an emulator so much easier because, as a user, you don’t need to learn the ins and outs of each emulator’s configuration system. The challenge is that retrokit makes use of many other standalone emulators that are not natively autoconfigured by RetroPie.

The es-configscripts directory contains scripts for configuring additional emulators used by retrokit. Those systems include:

Additionally, there are custom extensions / overrides for existing emulators and the system via the following configscripts:

For usage of retrokit-overrides, see an example here.

runcommand

runcommand is the launch program used by RetroPie to run an emulator from EmulationStation. When runcommand runs, there are 3 potential hooks for users to add custom scripts into the lifecycle of the command:

These hooks can be incredibly useful for different types of integrations. However, since only a single script is supported for each hook, it means that we can’t easily manage hooks from multiple applications (and from the user!) in an effective way. We’d end up needing a way to flag sections of the script.

Ideally, these hooks behave more like EmulationStation’s – where you can define multiple scripts per hook. This is what the runcommand extension does in retrokit.

The above scripts are implemented in order to call multiple scripts:

scriptmodules

The scriptmodules extension in retrokit is used for integrating additional scriptmodules within RetroPie’s own ext/ folder. This includes emulators, libretro cores, and additional supplementary modules.

Most if the scriptmodules in retrokit are based on, or inspired by, scriptmodules built by others in the community.

emulators

The following emulator modules are included:

libretrocores

The following libretro core modules are included:

ports

The following port modules are included:

emptyports is used because retrokit adds entries to ports outside the context of a RetroPie scriptmodule. In order to avoid replicating the logic for setting up the ports system, a scriptmodule is instead used to assist with that.

supplementary

The following supplementary modules are included: