Data is provided in two files:
- buttonmap.xml
- topology.xml
A button map has the following properties:
- Button map schema version
- List of controllers
A controller has the following properties:
- Controller ID (equal to Kodi add-on ID)
- Libretro device type (from the libretro API)
- Libretro subclass index (defined by the core)
- List of features
The purpose of the properties is to assign the libretro device type and subclass to the specified add-on ID.
A <feature>
tag maps a feature name to a libretro constant. It has the following properties:
- Feature name (from the kodi-game-controllers repo)
- Libretro constant (from the libretro API)
The controller topology defines the possible ways that input devices can be connected. The root tag is <logicaltopology>
because this describes the topology that the emulator's logic is capable of.
The topology has the following properties:
- Player limit (max number of players handled by the core, needed for FCEUmm)
The topology of the emulator is a tree structure, with hubs and daisy-chainable controllers as nodes. The root of the topology is a list of ports on the virtual game console.
Ports have the following properties:
- Port type
- Port ID (optional for keyboard and mouse)
- List of accepted controllers
The port type is one of the following:
keyboard
mouse
controller
The port ID is derived from the port's physical connector or the 1-indexed player number on the virtual console.
Accepted controllers have the following properties:
- Add-on ID
- List of ports
Ports accept controllers and controllers have ports, so data can be operated on recursively.