libretro

package
v3.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyPressed  = 1
	KeyReleased = 0
)
View Source
const (
	CallSerialize   = 1
	CallUnserialize = 2
)

Variables

This section is empty.

Functions

func Init

func Init(localPath string)

func LoadGame

func LoadGame(path string) error

func SetLibretroLogger

func SetLibretroLogger(log *logger.Logger)

Types

type ArchInfo

type ArchInfo struct {
	// bottom: x86_64, x86, ...
	Arch string
	// middle: windows, ios, ...
	Os string
	// top level: apple, nintendo, ...
	Vendor string

	// platform dependent library file extension (dot-prefixed)
	LibExt string
}

ArchInfo contains Libretro core lib platform info. And cores are just C-compiled libraries. See: https://buildbot.libretro.com/nightly.

func GetCoreExt

func GetCoreExt() (ArchInfo, error)

type Frontend

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

func NewFrontend

func NewFrontend(conf conf.Emulator, log *logger.Logger) (*Frontend, error)

NewFrontend implements Emulator interface for a Libretro frontend.

func (*Frontend) Close

func (f *Frontend) Close()

func (*Frontend) GetAudio

func (f *Frontend) GetAudio() func(*emulator.GameAudio)

func (*Frontend) GetFps

func (f *Frontend) GetFps() uint

func (*Frontend) GetFrameSize

func (f *Frontend) GetFrameSize() (int, int)

func (*Frontend) GetHashPath

func (f *Frontend) GetHashPath() string

func (*Frontend) GetSRAMPath

func (f *Frontend) GetSRAMPath() string

func (*Frontend) GetSampleRate

func (f *Frontend) GetSampleRate() uint

func (*Frontend) GetVideo

func (f *Frontend) GetVideo() func(*emulator.GameFrame)

func (*Frontend) HasVerticalFrame

func (f *Frontend) HasVerticalFrame() bool

func (*Frontend) Input

func (f *Frontend) Input(player int, data []byte)

func (*Frontend) Load

func (f *Frontend) Load() error

Load restores the state from the filesystem.

func (*Frontend) LoadGame

func (f *Frontend) LoadGame(path string) error

func (*Frontend) LoadGameState

func (f *Frontend) LoadGameState() error

func (*Frontend) LoadMetadata

func (f *Frontend) LoadMetadata(emu string)

func (*Frontend) Save

func (f *Frontend) Save() error

Save writes the current state to the filesystem.

func (*Frontend) SaveGameState

func (f *Frontend) SaveGameState() error

func (*Frontend) SetAudio

func (f *Frontend) SetAudio(ff func(*emulator.GameAudio))

func (*Frontend) SetMainSaveName

func (f *Frontend) SetMainSaveName(name string)

func (*Frontend) SetVideo

func (f *Frontend) SetVideo(ff func(*emulator.GameFrame))

func (*Frontend) SetViewport

func (f *Frontend) SetViewport(width int, height int)

func (*Frontend) Start

func (f *Frontend) Start()

func (*Frontend) ToggleMultitap

func (f *Frontend) ToggleMultitap()

type InputState

type InputState [maxPort]State

InputState stores full controller state. It consists of:

  • uint16 button values
  • int16 analog stick values

func NewGameSessionInput

func NewGameSessionInput() InputState

type State

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

InputState stores full controller state. It consists of:

  • uint16 button values
  • int16 analog stick values

type StateStorage

type StateStorage struct {
	// save path without the dir slash in the end
	Path string
	// contains the name of the main save file
	// e.g. abc<...>293.dat
	// needed for Google Cloud save/restore which
	// doesn't support multiple files
	MainSave string
}

func (*StateStorage) GetSRAMPath

func (s *StateStorage) GetSRAMPath() string

func (*StateStorage) GetSavePath

func (s *StateStorage) GetSavePath() string

func (*StateStorage) Load

func (s *StateStorage) Load(path string) ([]byte, error)

func (*StateStorage) Save

func (s *StateStorage) Save(path string, dat []byte) error

func (*StateStorage) SetMainSaveName

func (s *StateStorage) SetMainSaveName(name string)

type Storage

type Storage interface {
	GetSavePath() string
	GetSRAMPath() string
	SetMainSaveName(name string)
	Load(path string) ([]byte, error)
	Save(path string, data []byte) error
}

type ZipStorage

type ZipStorage struct {
	Storage
}

func (*ZipStorage) GetSRAMPath

func (z *ZipStorage) GetSRAMPath() string

func (*ZipStorage) GetSavePath

func (z *ZipStorage) GetSavePath() string

func (*ZipStorage) Load

func (z *ZipStorage) Load(path string) ([]byte, error)

Load loads a zip file with the path specified.

func (*ZipStorage) Save

func (z *ZipStorage) Save(path string, data []byte) error

Save saves the array of bytes into a file with the specified path.

Directories

Path Synopsis
raw

Jump to

Keyboard shortcuts

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