Documentation
¶
Overview ¶
Package retroarch provides reusable RetroArch CLI launchers.
Index ¶
- func ConfigForProfile(profile ConfigProfile) (string, error)
- func Controls(addr string) map[string]platforms.Control
- func EnsureConfigProfile(fs afero.Fs, path string, profile ConfigProfile) error
- func EnsureNetworkCommandConfig(fs afero.Fs, path string) error
- func NewLauncher(opts Options, c CoreLaunch) platforms.Launcher
- func NewLaunchers(opts Options, cs []CoreLaunch) []platforms.Launcher
- type CommandSpec
- type ConfigProfile
- type CoreDef
- type CoreLaunch
- type DownloadPolicy
- type EnvFunc
- type Options
- type PreflightFunc
- type Profile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigForProfile ¶
func ConfigForProfile(profile ConfigProfile) (string, error)
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 ¶
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 ¶
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 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 ¶
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.