emulator

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emulator

type Emulator interface {
	// SetAudio sets the audio callback
	SetAudio(func(*GameAudio))
	// SetVideo sets the video callback
	SetVideo(func(*GameFrame))
	GetAudio() func(*GameAudio)
	GetVideo() func(*GameFrame)
	LoadMetadata(name string)
	LoadGame(path string) error
	GetFps() uint
	GetSampleRate() uint
	GetFrameSize() (w, h int)
	HasVerticalFrame() bool
	// Start is called after LoadGame
	Start()
	// SetViewport sets viewport size
	SetViewport(width int, height int)
	// SetMainSaveName sets distinct name for saves naming
	SetMainSaveName(name string)
	// SaveGameState save game state
	SaveGameState() error
	// LoadGameState load game state
	LoadGameState() error
	// GetHashPath returns the path emulator will save state to
	GetHashPath() string
	// Close will be called when the game is done
	Close()
	// ToggleMultitap toggles multitap controller.
	ToggleMultitap()
	// Input passes input to the emulator
	Input(player int, data []byte)
}

type GameAudio

type GameAudio struct {
	Data     *[]int16
	Duration time.Duration
}

type GameFrame

type GameFrame struct {
	Data     *image.Frame
	Duration time.Duration
}

type InputEvent

type InputEvent struct {
	RawState []byte
}

type Metadata

type Metadata struct {
	LibPath         string // the full path to some emulator lib
	AudioSampleRate int
	Fps             float64
	BaseWidth       int
	BaseHeight      int
	Rotation        image.Rotate
	IsGlAllowed     bool
	UsesLibCo       bool
	AutoGlContext   bool
	HasMultitap     bool
	HasVFR          bool
	Options         map[string]string
}

Directories

Path Synopsis
gl
Package image contains functions for rotations of points in a 2-dimensional space.
Package image contains functions for rotations of points in a 2-dimensional space.

Jump to

Keyboard shortcuts

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