Power User Guide: Creating Custom Systems and Overriding Cores - spruceUI/spruceOS GitHub Wiki

Is there a system that can already be emulated on spruce, but it doesn't have its own Roms folder that spruce will recognize, and you kinda wish it did? Or maybe one of your favorite systems to emulate isn't supported by spruce at all? Here's how you can fix that!

In the Emu/ folder of your spruce SD card is a folder labeled -CUSTOM-SYSTEM-/. By modifying a copy of this folder's contents, you can add your own platform to the system selection screen in MainUI.

NOTE: Please back up any custom systems you configure for spruce, as the spruceBackup and spruceRestore apps cannot and will not handle these files for you. The spruce team is not responsible for lost custom system configurations resulting from your failure to back up your custom system's Emu folder.

Naming your system

The first step to creating your own system in spruce is to rename (a copy of) -CUSTOM-SYSTEM-/ to (an abbreviated version of) the name of your target system. It is recommended to follow the example of the existing platforms in Emu/: all capital letters, with no spaces. The files themselves inside this folder should not be renamed.

Adding Libretro cores

The A30 is an ARM device that runs a 32-bit version of RetroArch - as such, any Libretro cores that you wish to add to your setup should be compiled for a 32-bit armhf platform. Spruce ships with a large selection of Libretro cores, but you may sometimes wish to add one that is missing - or use a different version of an included core than the version that we bundle. In either case, adding a Libretro core to a given system's Emu folder (provided the name of this core matches what is in the corresponding system.opt file - more info on that later) will tell spruce to load that core before it looks in RetroArch's cores directory. Therefore, the next step in creating your custom system is to decide whether you will be using a core that already came with spruce, or adding your own. You can see which cores are included with spruce by navigating to RetroArch/.retroarch/cores/. If you wish to use your own core, you can add it either to that cores/ folder or to your custom system's Emu/ folder itself. The latter is recommended because it makes it easier to back up your custom system.

default.opt

Spruce handles the launch settings - the core to be used, the cpu mode, and the minimum cpu frequency - for a given system (or game) using .opt files. The default.opt file included in your -CUSTOM-SYSTEM-/ folder is where you can define these necessary variables for your system. Further documentation on how to modify this file is available inside default.opt itself, but at minimum, you need to modify line 10, which has export CORE="mgba" to have the name of the core you wish to use.

config.json

This file tells the A30's MainUI everything it needs to know about an emulated system, so it can add it to your systems list and display the correct ROMs. Below are the fields you will want to edit; it is strongly advised that you leave all other fields alone.

  • label - this is what the system will appear as in MainUI. It is best to keep this brief to prevent it overflowing into other systems' names.
  • icon - this is the filepath to the icon to use while your cursor is not currently hovering over this system. It needs to start with /mnt/SDCARD/.
  • iconsel - this is the filepath to the icon to use while your cursor is currently hovering over this system. It needs to start with /mnt/SDCARD/.
  • rompath - this is the filepath to the associated Roms/ folder for your system. It needs to be ../../Roms/ followed by the same exact name as the Emu/ subfolder you are working in. For example, if your custom system lives in /Emu/NAOMI, then this field should be ../../Roms/NAOMI. You will need to also manually create this subfolder of Roms/ yourself.
  • imgpath - this is the filepath to the folder you wish to keep your box art in for your custom system.
  • gamelist - this is the filepath to a miyoogamelist.xml should you wish to use one.
  • extlist - this very important field tells MainUI to only show files ending in the file extensions you list here. You can use a pipe | to separate multiple file extensions you wish to show. Do not include the . of the file extension. If you wish for all files in your Roms folder to appear here, delete this entire line, so there is no "extlist" field whatsoever.

config.json.simple

This file is optional, and will only go into effect if you have enabled Simple Mode from the Advanced Settings app. You can safely ignore it or delete it if you do not plan to use Simple Mode. Otherwise, you will want to set up the fields listed above in the exact same manner as you did for your primary config.json.