Documentation
¶
Overview ¶
Package esde provides shared utilities for EmulationStation Desktop Edition based platforms including ES-DE, Batocera ES, and RetroBat.
Index ¶
- Variables
- func CreateSystemScanner(romsBasePath, gamelistBasePath, systemFolder string) func() ([]platforms.ScanResult, error)
- func EnhanceResultsFromGamelist(results map[string]platforms.ScanResult, cfg ScannerConfig) error
- func GetFoldersForSystemID(systemID string) []string
- func GetSystemID(folder string) (string, error)
- func HasExtension(folder, ext string) bool
- func ResolveGamePath(gamePath, romsBasePath, systemFolder string) string
- func ScanGamelist(cfg ScannerConfig) ([]platforms.ScanResult, error)
- type GameEntry
- type GameList
- type ScannerConfig
- type SystemInfo
Constants ¶
This section is empty.
Variables ¶
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 ¶
GetFoldersForSystemID returns all ES folder names that map to a given Zaparoo system ID.
func GetSystemID ¶
GetSystemID returns the Zaparoo system ID for an ES folder name.
func HasExtension ¶
HasExtension checks if the given extension is supported by the specified folder.
func ResolveGamePath ¶
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 ¶
GameList represents the structure of an EmulationStation gamelist.xml file.
func ReadGameList ¶
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 ¶
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.