Documentation
¶
Overview ¶
Package standalone holds the operating-system independent parts of the built-in standalone emulator launchers: argument builders, launcher target files and the Windows emulator table and install discovery.
Index ¶
- func A7800Args(ctx *Context) ([]string, error)
- func BuildWindowsCommand(emu *WindowsEmulator, system *WindowsSystem, install WindowsInstall, ...) (*platforms.LaunchCommand, error)
- func CemuArgs(ctx *Context) ([]string, error)
- func DiscoverWindows(env *WindowsEnv, emulators []WindowsEmulator) map[string]WindowsInstall
- func FBNeoArgs(ctx *Context) ([]string, error)
- func LauncherExtensions(system *WindowsSystem) []string
- func LauncherFolders(system *WindowsSystem) []string
- func MAMEArgs(ctx *Context) ([]string, error)
- func MAMEConfiguredROMPath(showConfig []byte) string
- func MAMEShowConfig(command *platforms.LaunchCommand, prepare func(cmd *exec.Cmd)) ([]byte, error)
- func NewWindowsLauncher(emu *WindowsEmulator, system *WindowsSystem, install WindowsInstall, ...) platforms.Launcher
- func RPCS3Args(ctx *Context) ([]string, error)
- func ReadLauncherTarget(path, extension string) (string, error)
- func ScummVMArgs(ctx *Context) ([]string, error)
- func ScummVMTarget(path string) (string, error)
- func SetName(path string, extensions ...string) (string, error)
- func ShadPS4Args(ctx *Context) ([]string, error)
- func ValidateMediaFile(path string) error
- func Vita3KArgs(ctx *Context) ([]string, error)
- func WinUAEArgs(ctx *Context) ([]string, error)
- func WindowsLaunchers(emulators []WindowsEmulator, installs map[string]WindowsInstall, ...) []platforms.Launcher
- type ArgsFunc
- type Context
- type UninstallEntry
- type WindowsEmulator
- type WindowsEnv
- type WindowsInstall
- type WindowsSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func A7800Args ¶
A7800Args loads a cartridge into the a7800 machine. A7800 runs from its own folder, so it finds the 7800 BIOS in its roms folder.
func BuildWindowsCommand ¶
func BuildWindowsCommand( emu *WindowsEmulator, system *WindowsSystem, install WindowsInstall, path string, showConfig func(command *platforms.LaunchCommand) ([]byte, error), ) (*platforms.LaunchCommand, error)
BuildWindowsCommand builds the command line for launching path. For MAME builds, showConfig runs the command it is given and returns the output.
func DiscoverWindows ¶
func DiscoverWindows(env *WindowsEnv, emulators []WindowsEmulator) map[string]WindowsInstall
DiscoverWindows finds each emulator's executable. Emulators that are not found are left out of the result, which is keyed by emulator Name.
Discovery only lists known folders and their direct children, each once, so its cost does not grow with the size of the drives searched.
func FBNeoArgs ¶
FBNeoArgs launches a ROM set by name. FinalBurn Neo has no command line ROM path and only finds sets through the ROM folders in its own config, so the set's folder is added there first when it is missing.
func LauncherExtensions ¶
func LauncherExtensions(system *WindowsSystem) []string
LauncherExtensions returns the system's explicit extensions, or the union of its folders' ES-DE extensions and its extra extensions.
func LauncherFolders ¶
func LauncherFolders(system *WindowsSystem) []string
LauncherFolders returns the system's folders plus its Zaparoo system ID folder, without case-insensitive duplicates.
func MAMEArgs ¶
MAMEArgs launches a MAME ROM set by name. The set's folder is put first in the rompath and the rompath MAME is configured with follows it, so BIOS, parent and CHD folders the user configured keep working. MAME strips the folder and extension from the set name itself, so only the name is passed.
func MAMEConfiguredROMPath ¶
MAMEConfiguredROMPath returns the rompath in MAME's -showconfig output, or MAME's default when it is not set. The value is returned as written: MAME expands environment variables and resolves relative entries against its own working directory.
func MAMEShowConfig ¶
MAMEShowConfig runs command, which must be MAME with -showconfig, and returns what it prints: the settings MAME ends up with after reading every ini file on its inipath. Asking MAME is the only reliable way to find them, because builds and packages use different inipaths and defaults.
func NewWindowsLauncher ¶
func NewWindowsLauncher( emu *WindowsEmulator, system *WindowsSystem, install WindowsInstall, prepare func(cmd *exec.Cmd), ) platforms.Launcher
NewWindowsLauncher builds the launcher for one emulator system.
func ReadLauncherTarget ¶
ReadLauncherTarget reads the one-line target stored in a small launcher file such as .ps3, .psvita or .scummvm.
func ScummVMArgs ¶
ScummVMArgs launches the game ID named by a .scummvm target file from the target file's folder.
func ScummVMTarget ¶
ScummVMTarget reads the game ID from a .scummvm target file. An empty file names the game by its file name, as Batocera and RetroBat lay them out.
func SetName ¶
SetName returns a ROM set name taken from an archive file name, for emulators that load sets by name from a ROM path.
func ShadPS4Args ¶
ShadPS4Args launches the game named by a .ps4 target file.
func ValidateMediaFile ¶
ValidateMediaFile requires an absolute path to an existing regular file.
func Vita3KArgs ¶
Vita3KArgs launches the title ID named by a .psvita target file.
func WinUAEArgs ¶
WinUAEArgs boots a floppy image in df0: without the configuration GUI.
func WindowsLaunchers ¶
func WindowsLaunchers( emulators []WindowsEmulator, installs map[string]WindowsInstall, skip func(id string) bool, prepare func(cmd *exec.Cmd), ) []platforms.Launcher
WindowsLaunchers returns a launcher for every system of every discovered emulator, in table order, leaving out IDs for which skip returns true. prepare, if set, adjusts each command before it starts.
Types ¶
type ArgsFunc ¶
ArgsFunc builds the emulator arguments for one launch.
func AltirraArgs ¶
AltirraArgs starts Altirra fullscreen in the given machine's default profile (5200 or xegs). Headerless cartridge images carry no mapper, so one is picked from the image size; otherwise Altirra stops to ask.
func DOSBoxArgs ¶
DOSBoxArgs runs a DOS program, or loads a .conf file whose autoexec starts the game.
type Context ¶
type Context struct {
// MAMEConfig returns MAME's -showconfig output, for launchers that read
// MAME's own settings.
MAMEConfig func() ([]byte, error)
// Path is the absolute media path being launched.
Path string
// InstallDir is the folder holding the emulator executable, when known.
InstallDir string
// Exe is the emulator executable, when known.
Exe string
}
Context is what an argument builder knows about one launch.
type UninstallEntry ¶
UninstallEntry is the part of a Windows Uninstall registry entry used to find an installed emulator.
type WindowsEmulator ¶
type WindowsEmulator struct {
Name string
// Exes are executable file names, matched case-insensitively. A name
// ending in "*" matches any executable starting with the text before it.
Exes []string
// DirHints are lower-case prefixes of folder names the emulator is
// commonly extracted or installed to. The lower-cased Name is always one.
DirHints []string
// Scoop are the emulator's Scoop app names.
Scoop []string
Systems []WindowsSystem
// WorkDirInstall runs the emulator from its own folder, for emulators
// that find their data and config relative to the working directory.
WorkDirInstall bool
// MAMEConfig tells the launcher to ask MAME for its configured rompath.
MAMEConfig bool
}
WindowsEmulator is one standalone Windows emulator and the launchers it provides. Emulators are listed in priority order: when two launchers match the same file, the earlier one is the default.
func WindowsEmulators ¶
func WindowsEmulators() []WindowsEmulator
WindowsEmulators returns the built-in Windows standalone emulators.
type WindowsEnv ¶
type WindowsEnv struct {
FS afero.Fs
Getenv func(key string) string
// Configured returns the install_dir set for a launcher ID or an
// emulator name, if any.
Configured func(launcherID string) string
// AppPath returns the registered App Paths location of an executable.
AppPath func(exe string) string
UninstallEntries []UninstallEntry
// FixedDrives are local fixed drive roots such as `C:\`.
FixedDrives []string
IndexRoots []string
}
WindowsEnv is everything Windows discovery reads from the machine. Every field is optional, so tests can supply only what they exercise.
type WindowsInstall ¶
WindowsInstall is a discovered emulator executable.
type WindowsSystem ¶
type WindowsSystem struct {
Args ArgsFunc
ID string
SystemID string
// Folders are the ROM folder names the launcher indexes. The Zaparoo
// system ID folder is always added.
Folders []string
// Extensions replaces the extensions taken from the folders' ES-DE
// definitions when set.
Extensions []string
// ExtraExtensions are added to the ES-DE extensions.
ExtraExtensions []string
NoScan bool
}
WindowsSystem is one launcher an emulator provides for one system.