retroarch

package
v2.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package retroarch provides reusable RetroArch CLI launchers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigForProfile

func ConfigForProfile(profile ConfigProfile) (string, error)

func Controls

func Controls(addr string) map[string]platforms.Control

Controls returns RetroArch network-command controls for addr.

func EnsureConfigProfile

func EnsureConfigProfile(fs afero.Fs, path string, profile ConfigProfile) error

EnsureConfigProfile writes a Zaparoo-owned RetroArch overlay without changing the user's primary RetroArch configuration.

func EnsureNetworkCommandConfig

func EnsureNetworkCommandConfig(fs afero.Fs, path string) error

EnsureNetworkCommandConfig writes Core's minimal RetroArch network-command overlay without changing the user's primary RetroArch configuration.

func NewLauncher

func NewLauncher(opts Options, c CoreLaunch) platforms.Launcher

NewLauncher creates a blocking RetroArch launcher.

func NewLaunchers

func NewLaunchers(opts Options, cs []CoreLaunch) []platforms.Launcher

NewLaunchers creates launchers in the same order as cs.

Types

type CommandSpec

type CommandSpec struct {
	Name string
	Args []string
	Env  []string
}

CommandSpec is a testable command invocation without ambient environment.

func BuildCommand

func BuildCommand(opts Options, c CoreLaunch, mediaPath string) CommandSpec

BuildCommand constructs a RetroArch invocation without starting it.

type ConfigProfile

type ConfigProfile string
const (
	ConfigProfileManaged    ConfigProfile = "managed"
	ConfigProfileLowLatency ConfigProfile = "low_latency"

	NetworkCommandConfig = "network_cmd_enable = \"true\"\nnetwork_cmd_port = \"55355\"\n"
)

type CoreDef

type CoreDef struct {
	PerProfileCore   map[Profile]string
	PerProfilePolicy map[Profile]DownloadPolicy
	SystemID         string
	DefaultCore      string
	ESFolder         string
	Policy           DownloadPolicy
}

CoreDef defines a system's default core and ES-DE folder mapping. An explicit empty per-profile core disables the system for that profile.

func CoreDefinitions

func CoreDefinitions() []CoreDef

CoreDefinitions returns a defensive copy of the core table.

type CoreLaunch

type CoreLaunch struct {
	ID         string
	SystemID   string
	Core       string
	Folders    []string
	Extensions []string
	Scan       bool
}

CoreLaunch maps one Core system to one libretro core.

func CoreLaunchForFolder

func CoreLaunchForFolder(profile Profile, folder string) (CoreLaunch, bool)

CoreLaunchForFolder returns launch metadata for one ES-DE folder.

func CoreLaunches

func CoreLaunches(profile Profile) []CoreLaunch

CoreLaunches builds launch metadata for profile in deterministic order.

type DownloadPolicy

type DownloadPolicy string

DownloadPolicy controls how a future downloader may fetch a core.

const (
	PolicyFree          DownloadPolicy = "free"
	PolicyNonCommercial DownloadPolicy = "non-commercial"
)

Core download policies.

func CorePolicyForFolder

func CorePolicyForFolder(profile Profile, folder string) (DownloadPolicy, bool)

CorePolicyForFolder returns the selected core's download policy.

type EnvFunc

type EnvFunc func() []string

EnvFunc returns launch-time environment overrides.

type Options

type Options struct {
	FS               afero.Fs
	Preflight        PreflightFunc
	CoresDir         string
	ConfigPath       string
	AppendConfigPath string
	LibDir           string
	Home             string
	NetworkCmdAddr   string
	Exec             []string
	VTWrap           []string
	ExtraEnv         []string
	LaunchEnv        EnvFunc
	ExtraArgs        []string
}

Options describes how to invoke RetroArch and where its files live.

type PreflightFunc

type PreflightFunc func(corePath string) error

PreflightFunc performs consumer-specific launch validation.

func MemoizePreflight

func MemoizePreflight(preflight PreflightFunc) PreflightFunc

MemoizePreflight ensures a shared runtime dependency check runs once per launcher catalog while per-core filesystem checks remain independent.

type Profile

type Profile string

Profile identifies a hardware class used for core selection.

const (
	ProfileApplianceARM Profile = "appliance-arm"
	ProfileDesktop      Profile = "desktop"
)

RetroArch core-selection profiles.

Jump to

Keyboard shortcuts

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