esde

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package esde provides shared utilities for EmulationStation Desktop Edition based platforms including ES-DE, Batocera ES, and RetroBat.

Index

Constants

This section is empty.

Variables

View Source
var SystemMap = map[string]SystemInfo{}/* 247 elements not displayed */

SystemMap contains the consolidated system mappings for all EmulationStation-based platforms. This map uses the ES folder name as the key and maps to system info.

Functions

func CreateSystemScanner

func CreateSystemScanner(
	romsBasePath, gamelistBasePath, systemFolder string,
) func() ([]platforms.ScanResult, error)

CreateSystemScanner creates a scanner function for a specific ES system. This returns a function compatible with platforms.Launcher.Scanner.

func EnhanceResultsFromGamelist

func EnhanceResultsFromGamelist(results map[string]platforms.ScanResult, cfg ScannerConfig) error

EnhanceResultsFromGamelist updates scan results with names from gamelist.xml. This is useful when filesystem scanning finds files but we want display names from the gamelist metadata.

func GetFoldersForSystemID

func GetFoldersForSystemID(systemID string) []string

GetFoldersForSystemID returns all ES folder names that map to a given Zaparoo system ID.

func GetSystemID

func GetSystemID(folder string) (string, error)

GetSystemID returns the Zaparoo system ID for an ES folder name.

func HasExtension

func HasExtension(folder, ext string) bool

HasExtension checks if the given extension is supported by the specified folder.

func ResolveGamePath

func ResolveGamePath(gamePath, romsBasePath, systemFolder string) string

ResolveGamePath resolves a game path from gamelist.xml to an absolute path. Gamelist paths may be: - Absolute (starts with /) - Relative with ./ prefix (./game.rom) - Relative without prefix (game.rom)

func ScanGamelist

func ScanGamelist(cfg ScannerConfig) ([]platforms.ScanResult, error)

ScanGamelist scans a system's gamelist.xml and returns scan results. This function reads the gamelist.xml from the configured path and resolves all game paths relative to the roms directory.

Types

type GameEntry

type GameEntry struct {
	// Name is the display name of the game
	Name string `xml:"name"`
	// Path is the path to the ROM file (may be relative to the system folder)
	Path string `xml:"path"`
}

GameEntry represents a game from an EmulationStation gamelist.xml file.

type GameList

type GameList struct {
	XMLName xml.Name    `xml:"gameList"`
	Games   []GameEntry `xml:"game"`
}

GameList represents the structure of an EmulationStation gamelist.xml file.

func ReadGameList

func ReadGameList(path string) (GameList, error)

ReadGameList reads and parses a gamelist.xml file from the given path.

type ScannerConfig

type ScannerConfig struct {
	// RomsBasePath is the base path where ROM folders are located
	RomsBasePath string
	// GamelistBasePath is the base path where gamelist.xml files are located
	// (may differ from RomsBasePath for some platforms like ES-DE)
	GamelistBasePath string
	// SystemFolder is the name of the system folder (e.g., "nes", "snes")
	SystemFolder string
}

ScannerConfig holds configuration for scanning EmulationStation gamelists.

type SystemInfo

type SystemInfo struct {
	SystemID   string
	LauncherID string
	Extensions []string
}

SystemInfo maps EmulationStation folder names to Zaparoo system information.

func LookupByFolderName

func LookupByFolderName(folder string) (SystemInfo, bool)

LookupByFolderName returns the SystemInfo for an EmulationStation folder name.

func (SystemInfo) GetLauncherID

func (s SystemInfo) GetLauncherID() string

GetLauncherID returns the launcher ID, falling back to SystemID if not set.

Jump to

Keyboard shortcuts

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