mra

package
v2.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: GPL-3.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const Ext = ".mra"

Ext is the MiSTer arcade descriptor extension.

View Source
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

func ReadSetName(fs afero.Fs, filename string) string

ReadSetName returns the descriptor's set name alone. See ReadIdentity.

func SetStem

func SetStem(sourcePath string) string

SetStem treats ZIP paths as identities, never as files to open. Source bundles may contain absolute paths from a different machine, including Windows.

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

func NormalizeIdentity(setName, parent string) Identity

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

func ReadIdentity(fs afero.Fs, filename string) Identity

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL