Files
libretro/schemas/romfolders.schema.json
T
Abdessamad Derraz 7035da1154 feat: read libretro MAME's -rompath from ES-DE
ES-DE starts the libretro MAME core with a command line as its content
in 22 commands across 21 systems ("apple2e -rompath \"%GAMEDIRRAW%;
%ROMPATH%/apple2\" -flop1 ...", resources/systems/linux/es_systems.xml
at RetroDECK's 15e1b236 and EmuDeck's ES-DE v3.5.0), run through the
shell by popen (es-core/src/utils/PlatformUtil.cpp:231, 257).

At 5f5a0774 the core reads content that is no file as a command line
(retro_init.cpp:966-1008). Set_Path_Option passes its own -rompath
<content dir>;<system>/mame/bios;<system>/mame/roms (580-597), then
every word of the command line follows, -rompath included, only -rp
being dropped when mame_paths_enable is off (902-940, 914-919). MAME
keeps the later value of an option given twice at one priority
(src/lib/util/options.cpp:260-276, clifront.cpp:243). Those commands
read their sets in the folders they name, and mame/bios stays read by
every command that passes none.

The ES-DE parser records these commands in searched_by with their core,
the mame profile declares libretro_pools (-rompath and -rp stand for
mame/bios), and a set there also goes to each folder a command names
for a machine that reads it.

Manifests: EmuDeck gains 16 files below roms/ (apple2, apple2gs,
astrocde, crvision, gamate, gamecom, gmaster, intellivision, odyssey2,
scv, supracan, vectrex, videopac, vsmile). RetroDECK does not change:
its standalone MAME commands already put the same sets at the same
paths. No file leaves.
2026-11-11 12:30:53 +01:00

147 lines
6.7 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://abdess.github.io/retrobios/api/v1/schemas/romfolders.schema.json",
"title": "RetroBIOS rom folders of one setup",
"description": "What a frontend's own source says about its game folders, read at pinned revisions (platforms/romfolders/<setup>.yml, written by python -m scripts.scraper.romfolders). Names are the OS's own: scripts/romfolders.py resolves them to repository systems and profiles.",
"type": "object",
"additionalProperties": false,
"required": ["setup", "name", "platform", "sources", "roms_root", "case_sensitive", "folders"],
"$defs": {
"ref": {
"type": "string",
"description": "'<source key> <path>:<line>[-<line>]', several joined by '; '. The key names an entry of sources.",
"pattern": "^[a-z0-9][a-z0-9-]* \\S+(?:; [a-z0-9][a-z0-9-]* \\S+)*$"
},
"named_rule": {
"type": "object",
"additionalProperties": false,
"required": ["source_ref"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"pattern": { "type": "string", "minLength": 1 },
"reason": { "type": "string", "minLength": 1 },
"source_ref": { "$ref": "#/$defs/ref" }
},
"oneOf": [{ "required": ["name"] }, { "required": ["pattern"] }]
},
"board_default": {
"type": "object",
"additionalProperties": false,
"required": ["core", "source_ref"],
"properties": {
"core": { "type": "string", "minLength": 1 },
"emulator": { "type": "string", "minLength": 1 },
"source_ref": { "$ref": "#/$defs/ref" }
}
}
},
"properties": {
"setup": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
"name": { "type": "string", "minLength": 1 },
"platform": {
"type": "string",
"description": "The install manifest (install/<platform>.json) the installer uses on this setup, as install.py's OS rules choose it. Empty for a setup the installer lays out with no manifest."
},
"sources": {
"type": "object",
"minProperties": 1,
"additionalProperties": {
"type": "object",
"additionalProperties": false,
"required": ["repo", "commit"],
"properties": {
"repo": { "type": "string", "pattern": "^https://" },
"commit": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
"tag": { "type": "string" },
"note": { "type": "string" }
}
}
},
"roms_root": {
"type": "object",
"additionalProperties": false,
"required": ["path", "from_bios", "source_ref"],
"properties": {
"path": { "type": ["string", "null"], "minLength": 1, "description": "Null for a setup with no rom folder of its own." },
"from_bios": {
"type": ["string", "null"],
"description": "The roms root relative to the BIOS folder the installer already knows. Null when no fixed relation exists."
},
"source_ref": { "$ref": "#/$defs/ref" }
}
},
"case_sensitive": {
"type": ["boolean", "null"],
"description": "Whether the OS opens a folder only under the spelling it lists. Null when the source does not settle it (filesystem dependent)."
},
"case_ref": { "$ref": "#/$defs/ref" },
"skip": {
"type": "array",
"description": "Folders under the roms root the scan never enters (the ELEC family's bios folder, the OS's own data).",
"items": { "$ref": "#/$defs/named_rule" }
},
"hidden": {
"type": "array",
"description": "File and folder name patterns (fnmatch, case-insensitive) the OS hides from its game list.",
"items": { "$ref": "#/$defs/named_rule" }
},
"media": {
"type": "array",
"description": "Folders inside a system folder that hold artwork, never games.",
"items": { "$ref": "#/$defs/named_rule" }
},
"notes": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"folders": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["folder", "source_ref"],
"properties": {
"folder": { "type": "string", "minLength": 1, "description": "Path under the roms root, as the OS writes it." },
"name": { "type": "string", "minLength": 1, "description": "The OS's own system id when it differs from the folder." },
"aliases": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
"extensions": {
"type": "array",
"description": "Lowercased, with the dot. Absent when the OS lists every file.",
"items": { "type": "string", "pattern": "^\\.[^A-Z\\s]+$" },
"uniqueItems": true
},
"files": {
"type": "array",
"description": "Whole file names the OS lists as games, as it writes them, in place of or beside extensions.",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
},
"core": { "type": "string", "minLength": 1, "description": "The core or emulator the OS starts by default, in its own spelling." },
"emulator": { "type": "string", "minLength": 1 },
"source_ref": { "$ref": "#/$defs/ref" },
"board_defaults": {
"type": "object",
"additionalProperties": { "$ref": "#/$defs/board_default" }
},
"arcade": { "type": "boolean" },
"searched_by": {
"type": "array",
"description": "The emulators, or the libretro core with its runner, whose commands for this folder pass a ROM search path, and the folders below the roms root it names.",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["emulator", "reads", "source_ref"],
"properties": {
"emulator": { "type": "string", "minLength": 1 },
"core": { "type": "string", "minLength": 1, "description": "The libretro core RetroArch starts, handed the search path in its content command line." },
"reads": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
"machines": { "type": "array", "description": "The machines the commands start, as the emulator names them.", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
"any_machine": { "type": "boolean", "description": "A command starts the game itself as the machine (ES-DE's %BASENAME%)." },
"source_ref": { "$ref": "#/$defs/ref" }
}
}
},
"note": { "type": "string", "minLength": 1 }
}
}
}
}
}