nanoarch

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputTerminate = 0xFFFF
)

Variables

View Source
var NAEmulator *naEmulator

Functions

func Init

func Init(roomID string, withImageChannel bool, inputChannel <-chan InputEvent, storage Storage, config config.LibretroCoreConfig) (*naEmulator, chan GameFrame, chan []int16)

Init initialize new RetroArch cloud emulator withImageChan returns an image stream as Channel for output else it will write to unix socket

func NewNAEmulator

func NewNAEmulator(roomID string, inputChannel <-chan InputEvent, storage Storage, conf config.LibretroCoreConfig) (*naEmulator, chan GameFrame, chan []int16)

NAEmulator implements CloudEmulator interface based on NanoArch(golang RetroArch)

Types

type CloudEmulator

type CloudEmulator interface {
	Start(path string)
	SaveGame(saveExtraFunc func() error) error
	LoadGame() error
	GetHashPath() string
	Close()
	ToggleMultitap() error
}

type ConfigProperties

type ConfigProperties map[string]*C.char

func ScanConfigFile

func ScanConfigFile(filename string) ConfigProperties

type GameFrame

type GameFrame struct {
	Image     *image.RGBA
	Timestamp uint32
}

GameFrame contains image and timeframe

type InputEvent

type InputEvent struct {
	RawState  []byte
	PlayerIdx int
	ConnID    string
}

type Players added in v2.5.0

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

func NewPlayerSessionInput added in v2.5.0

func NewPlayerSessionInput() Players

type Storage added in v2.5.0

type Storage 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
}

type VideoExporter

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

VideoExporter produces image frame to unix socket

func NewVideoExporter

func NewVideoExporter(roomID string, imgChannel chan GameFrame) *VideoExporter

NewVideoExporter creates new video Exporter that produces to unix socket

Jump to

Keyboard shortcuts

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