Documentation
¶
Overview ¶
Package recalbox implements Recalbox. Games are launched through EmulationStation's UDP command port so ES stays in charge of emulator configuration, and followed through the state file ES rewrites on every event.
Index ¶
- Constants
- type Installer
- type Platform
- func (p *Platform) LaunchMedia(cfg *config.Instance, path string, launcher *platforms.Launcher, ...) error
- func (p *Platform) Launchers(cfg *config.Instance) []platforms.Launcher
- func (p *Platform) ReturnToMenu() error
- func (p *Platform) RootDirs(cfg *config.Instance) []string
- func (*Platform) ServiceBinaryDir() string
- func (*Platform) Settings() platforms.Settings
- func (p *Platform) StartPost(ctx context.Context, cfg *config.Instance, ...) error
- func (p *Platform) Stop() error
- func (p *Platform) StopActiveLauncher(intent platforms.StopIntent) error
- func (p *Platform) SupportedReaders(cfg *config.Instance) []readers.Reader
Constants ¶
const ( // ScriptPath is a permanent user script: ES runs it once when it starts // and leaves it running across frontend restarts. ScriptPath = "/recalbox/share/userscripts/zaparoo(permanent).sh" // SupervisorPIDFile is written by the script so it runs only once. SupervisorPIDFile = "/tmp/zaparoo-supervisor.pid" )
const ( // InstallDir holds the binary, config, database and logs on the share // partition, which Recalbox upgrades keep. InstallDir = "/recalbox/share/system/zaparoo" // ServiceBinaryDir is on tmpfs, which can execute files. ServiceBinaryDir = "/tmp/zaparoo-bin" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Installer ¶ added in v2.23.0
type Installer struct {
FS afero.Fs
// StartScript runs the installed script detached from the caller.
StartScript func(path string) error
// Signal sends a signal to a process.
Signal func(pid int, sig syscall.Signal) error
// Sleep waits between checks that a stopped supervisor has exited.
Sleep func(time.Duration)
// Script is the supervisor template; it names @ZAPAROO_BIN@.
Script string
// Executable is the absolute path of the binary the script runs.
Executable string
}
Installer installs Core as a Recalbox user script.
func NewInstaller ¶ added in v2.23.0
NewInstaller returns an Installer for the real system.
type Platform ¶
Platform implements platforms.Platform for Recalbox.
func NewPlatform ¶ added in v2.23.0
func NewPlatform() *Platform
NewPlatform creates a Recalbox platform.
func (*Platform) LaunchMedia ¶
func (p *Platform) LaunchMedia( cfg *config.Instance, path string, launcher *platforms.Launcher, db *database.Database, opts *platforms.LaunchOptions, ) error
LaunchMedia launches media with the platform's launchers.
func (*Platform) Launchers ¶
Launchers returns one launcher per Recalbox system Zaparoo knows, plus custom and generic launchers.
func (*Platform) ReturnToMenu ¶ added in v2.7.0
ReturnToMenu stops the running game, which returns to ES.
func (*Platform) RootDirs ¶
RootDirs returns configured index roots plus the folders ES reads ROMs from.
func (*Platform) ServiceBinaryDir ¶ added in v2.23.0
ServiceBinaryDir is where the service runs from. The share is FAT mounted without exec bits, so the binary is copied to tmpfs first.
func (*Platform) StartPost ¶
func (p *Platform) StartPost( ctx context.Context, cfg *config.Instance, launcherManager platforms.LauncherContextManager, activeMedia func() *models.ActiveMedia, setActiveMedia func(*models.ActiveMedia), db *database.Database, scheduler *idle.Scheduler, ) error
StartPost starts following EmulationStation events.
func (*Platform) StopActiveLauncher ¶
func (p *Platform) StopActiveLauncher(intent platforms.StopIntent) error
StopActiveLauncher stops the running game, whether Core or ES started it. Active media stays set when the game could not be stopped.