Files
libretro/schemas/platform.schema.json
T

343 lines
9.4 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Abdess/retrobios/schemas/platform.schema.json",
"title": "Platform Configuration",
"description": "Schema for retrogaming platform BIOS configuration files",
"type": "object",
"additionalProperties": false,
"required": [
"platform"
],
"properties": {
"inherits": {
"type": "string",
"description": "Parent platform config to inherit from (e.g., 'retroarch')"
},
"platform": {
"type": "string",
"description": "Platform display name"
},
"version": {
"type": "string",
"description": "Platform version"
},
"dat_version": {
"type": "string"
},
"cores": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
}
]
},
"standalone_cores": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"homepage": {
"type": "string",
"format": "uri",
"description": "Platform homepage URL"
},
"source": {
"type": "string",
"description": "URL to source BIOS requirements list"
},
"base_destination": {
"type": "string",
"description": "Base directory for BIOS files on this platform"
},
"hash_type": {
"type": "string",
"enum": [
"sha1",
"md5",
"crc32",
"sha256"
],
"description": "Primary hash algorithm used by this platform"
},
"verification_mode": {
"type": "string",
"enum": [
"existence",
"md5",
"sha1"
],
"default": "existence",
"description": "How the platform verifies BIOS at runtime: existence (file exists), md5 (checks MD5 hash), sha1 (checks SHA1 hash)"
},
"systems": {
"type": "object",
"description": "Systems/consoles supported by this platform",
"additionalProperties": {
"$ref": "#/$defs/system"
}
},
"overrides": {
"type": "object",
"additionalProperties": false,
"description": "Override inherited system configs",
"properties": {
"systems": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/system"
}
}
}
}
},
"$defs": {
"system": {
"type": "object",
"additionalProperties": false,
"properties": {
"core": {
"type": "string",
"description": "Emulator core name"
},
"manufacturer": {
"type": "string",
"description": "Hardware manufacturer"
},
"name": {
"type": "string"
},
"native_id": {
"type": "string"
},
"dat_version": {
"type": "string",
"description": "Version of the DAT file used as source for BIOS hashes"
},
"source": {
"type": "string",
"description": "URL or reference to the source of BIOS requirements"
},
"release_year": {
"type": "integer",
"minimum": 1970,
"maximum": 2030,
"description": "Console release year"
},
"docs": {
"type": "string",
"format": "uri",
"description": "Documentation URL"
},
"includes": {
"type": "array",
"items": {
"type": "string"
},
"description": "Shared BIOS groups to include (from _shared.yml)"
},
"data_directories": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"ref"
],
"properties": {
"ref": {
"type": "string"
},
"destination": {
"type": "string"
}
}
}
},
"files": {
"type": "array",
"items": {
"$ref": "#/$defs/bios_file"
},
"description": "BIOS files required for this system"
},
"native_check": {
"type": "object",
"additionalProperties": false,
"description": "EmuDeck: the shape of the shell check written for this system",
"properties": {
"kind": {
"type": "string",
"enum": [
"md5",
"file-exists"
]
},
"function": {
"type": "string"
},
"var": {
"type": "string"
},
"array": {
"type": "string"
},
"firmware": {
"type": "string"
},
"keys": {
"type": "string"
}
}
}
}
},
"bios_file": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"destination"
],
"properties": {
"name": {
"type": "string",
"description": "BIOS filename"
},
"sha1": {
"type": "string",
"pattern": "^[a-f0-9]{40}$",
"description": "SHA1 hash"
},
"md5": {
"type": "string",
"pattern": "^[a-fA-F0-9]{32}(,[a-fA-F0-9]{32})*$",
"description": "MD5 hash (comma-separated for multi-hash)"
},
"sha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$",
"description": "SHA256 hash"
},
"crc32": {
"type": "string",
"pattern": "^[a-f0-9A-F0-9]{8}$",
"description": "CRC32 hash"
},
"size": {
"type": "integer",
"minimum": 0,
"description": "File size in bytes"
},
"destination": {
"type": "string",
"description": "Destination path relative to base_destination"
},
"required": {
"type": "boolean",
"default": true,
"description": "Whether this BIOS is required for the core to function"
},
"extract": {
"type": "boolean",
"default": false,
"description": "Extract ZIP contents instead of copying the ZIP"
},
"storage": {
"type": "string",
"enum": [
"embedded",
"external",
"user_provided",
"large_file",
"release"
],
"default": "embedded",
"description": "Storage tier: embedded (in repo), external (download at build), user_provided (manual)"
},
"source_url": {
"type": "string",
"format": "uri",
"description": "Download URL for external storage tier"
},
"instructions": {
"type": "string",
"description": "Human-readable instructions (for user_provided or context)"
},
"zipped_file": {
"type": "string",
"description": "If set, the MD5 hash refers to this file inside the ZIP, not the ZIP itself"
},
"native_system": {
"type": "string",
"description": "System id the platform itself uses for this file"
},
"mirror_of": {
"type": "string",
"description": "Native system whose entry this one repeats; the platform's own file does not carry the copy"
},
"curated": {
"type": "boolean",
"description": "Added by our scraper from the cores' source, not declared in the platform's own file"
},
"native_name": {
"type": "string",
"description": "Display name the platform gives its own system"
},
"alt_md5": {
"type": "string",
"pattern": "^[a-fA-F0-9]{32}(,[a-fA-F0-9]{32})*$",
"description": "Second accepted MD5 (Batocera altmd5, ROCKNIX altmd5)"
},
"core": {
"type": "string",
"description": "Cores the platform names for this file (comma-separated)"
},
"note": {
"type": "string",
"description": "Free-text note the platform attaches to this file"
},
"description": {
"type": "string",
"description": "Description the platform attaches to this file"
},
"hash_match_mandatory": {
"type": "boolean",
"description": "Recalbox: a hash mismatch is an error, not a warning"
},
"mandatory_declared": {
"type": "boolean",
"description": "Recalbox: mandatory was stated explicitly, not defaulted"
},
"required_label": {
"type": "string",
"description": "RetroDECK: the requirement wording, which is free text"
},
"component": {
"type": "string",
"description": "RetroDECK: the component whose manifest declares this file"
},
"alt_paths": {
"type": "array",
"items": {
"type": "string"
},
"description": "Further paths the platform accepts for the same file"
},
"native_path": {
"type": "string",
"description": "How the platform itself writes this file reference"
}
}
}
}
}