Documentation
¶
Overview ¶
Package mra reads the MAME set name out of a MiSTer arcade descriptor.
An MRA filename is a display title, so the set name inside the descriptor is the only stable identity an arcade row has. Scrapers keying external arcade metadata to indexed media share this reader so they agree on which descriptors are identity sources and which are not.
Index ¶
Constants ¶
const Ext = ".mra"
Ext is the MiSTer arcade descriptor extension.
const MaxHeaderBytes = 256 * 1024
MaxHeaderBytes bounds the descriptor header a set name may be read from. It is not a file size limit: MiSTer MRAs embed their ROM payload as base64 <part> data and run to tens of megabytes, and refusing those would leave real arcade games with no identity at all.
Variables ¶
This section is empty.
Functions ¶
func ReadSetName ¶
ReadSetName returns the descriptor's set name alone. See ReadIdentity.
Types ¶
type Identity ¶ added in v2.23.0
type Identity struct {
// SetName is the descriptor's own MAME set, lower-cased.
SetName string
// Parent is the set this one is a clone of, lower-cased. Empty for a
// parent set and for a descriptor that does not say.
Parent string
}
Identity is what a descriptor says about which romset it is.
func NormalizeIdentity ¶ added in v2.23.0
NormalizeIdentity validates the raw text of a descriptor's set and parent elements. A set name that is not a plain romset name is no identity at all. A parent that is not one, or that only repeats the set, is dropped and the set name kept: the parent is a hint about other rows, not this row's key.
func ReadIdentity ¶ added in v2.23.0
ReadIdentity requires one complete, bounded descriptor header. Unlike optional artwork lookup, this identity can select a different title's write target, so malformed documents and repeated setname elements must not select a row. A zero Identity means the descriptor is not an identity source.