libretro

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package libretro is a small libretro frontend: it loads a core (a shared library the user installed), runs it one frame at a time and hands back raw video and audio. It uses no cgo, so one Go toolchain builds it everywhere.

This package is only linked into wittyplay-host, the separate sandboxed process that runs a game. The server never loads a core itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	// contains filtered or unexported fields
}

Core is a loaded libretro core. A process holds at most one, because the libretro API is one set of global callbacks per library.

func Load

func Load(path string, paths Paths, options map[string]string, h engine.Handlers) (*Core, error)

Load opens a core and starts it. Call this, and everything else on Core, from one locked OS thread.

func (*Core) Close

func (c *Core) Close()

Close unloads the game and the core.

func (*Core) LoadGame

func (c *Core) LoadGame(path string) (engine.AVInfo, error)

LoadGame gives the core a game. The file is read here only when the core wants it in memory.

func (*Core) LoadState

func (c *Core) LoadState(b []byte) bool

LoadState restores a snapshot from SaveState.

func (*Core) Reset

func (c *Core) Reset()

Reset is the console's reset button.

func (*Core) Run

func (c *Core) Run()

Run advances the game one frame.

func (*Core) SaveRAM

func (c *Core) SaveRAM() []byte

SaveRAM is the game's battery-backed memory, nil when it has none.

func (*Core) SaveState

func (c *Core) SaveState() []byte

SaveState returns a snapshot of the machine, or nil when the core has none.

func (*Core) SystemInfo

func (c *Core) SystemInfo() engine.SystemInfo

SystemInfo asks the core about itself.

type Paths

type Paths struct {
	System string // BIOS files
	Save   string // the core's own save files
}

Paths are the folders a core is told about.

Jump to

Keyboard shortcuts

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