gui

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: GPL-3.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 Action

type Action int
const (
	Nothing Action = iota

	Select // bool
	Start  // bool
	Pause  // bool
	P0Pro  // bool
	P1Pro  // bool

	StickLeft    // bool
	StickUp      // bool
	StickRight   // bool
	StickDown    // bool
	StickButtonA // bool
	StickButtonB // bool

	AnalogueSelect // bool

	PaddleFire // PaddleFireData
	PaddleMove // PaddleMoveData

	TrakballFire // bool
	TrakballMove // TrakballMove
)

type AudioReader

type AudioReader interface {
	io.Reader
	Nudge()
}

type AudioSetup

type AudioSetup struct {
	Freq int
	Read AudioReader
}

type Blob added in v0.7.1

type Blob struct {
	Filename string
	Data     []uint8
}

type Channels added in v0.7.5

type Channels struct {
	SetImage  chan Image
	UserInput chan Input
	Blob      chan Blob

	// implementations of UI should default to StateRunning
	State chan State

	// AudioSetup should be nil if the emulation is to have no audio
	AudioSetup chan AudioSetup

	// gui receives a string (last selected file) over the FileRequest channel
	// and returns result over the RequestedFile channel
	FileRequest   chan string
	RequestedFile chan string

	// display an error message
	ErrorDialog chan string
}

func NewChannels added in v0.7.5

func NewChannels() *Channels

func (*Channels) Debugger added in v0.7.5

func (c *Channels) Debugger() *ChannelsDebugger

func (*Channels) GUI added in v0.7.5

func (c *Channels) GUI() *ChannelsGUI

type ChannelsDebugger added in v0.7.5

type ChannelsDebugger struct {
	SetImage      chan<- Image
	UserInput     <-chan Input
	Blob          <-chan Blob
	State         chan<- State
	AudioSetup    chan<- AudioSetup
	FileRequest   chan<- string
	RequestedFile <-chan string
	ErrorDialog   chan<- string
}

type ChannelsGUI added in v0.7.5

type ChannelsGUI struct {
	SetImage      <-chan Image
	UserInput     chan<- Input
	Blob          chan<- Blob
	State         <-chan State
	AudioSetup    <-chan AudioSetup
	FileRequest   <-chan string
	RequestedFile chan<- string
	ErrorDialog   <-chan string
}

type Image

type Image struct {
	Main    *image.RGBA
	Overlay *image.RGBA
	Prev    *image.RGBA

	// the ID of the image
	ID string

	// the x/y coordinates of the next pixel to be drawn to Main
	Cursor [2]int
}

type Input

type Input struct {
	Source InputSource
	Port   Port
	Action Action
	Data   any
}

type InputSource added in v0.8.0

type InputSource struct {
	Type     InputType
	Position int
}

type InputType added in v0.8.0

type InputType int
const (
	InputAny InputType = iota
	InputKeyboard
	InputGamepad
	InputNone
)

func (InputType) GoString added in v0.8.0

func (t InputType) GoString() string

type PaddleFireData added in v0.7.3

type PaddleFireData struct {
	Paddle int // 0 or 1 to indicate which paddle in the pair
	Fire   bool
}

type PaddleMoveData added in v0.7.3

type PaddleMoveData struct {
	Paddle int // 0 or 1 to indicate which paddle in the pair
	Delta  int // distance moved by paddle device
}

type Port added in v0.7.3

type Port int
const (
	Players Port = iota
	Panel
)

type State

type State int

the state of the emulation

const (
	StateRunning State = iota
	StatePaused
)

the emulation state can be either paused or running. should default to state running

type TrakballMoveData added in v0.7.3

type TrakballMoveData struct {
	DeltaX int
	DeltaY int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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