controllers

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package controllers contains the implementations for all the emulated controllers for the VCS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGamepad

NewGamepad is the preferred method of initialisation for the Gamepad type Satisifies the ports.NewPeripheral interface and can be used as an argument to ports.AttachPlayer0() and ports.AttachPlayer1().

func NewKeypad

NewKeypad is the preferred method of initialisation for the Keyboard type Satisifies the ports.NewPeripheral interface and can be used as an argument to ports.AttachPlayer0() and ports.AttachPlayer1().

func NewPaddlePair added in v0.21.0

NewPaddlePair is the preferred method of initialisation for the PaddlePair type Satisifies the ports.NewPeripheral interface and can be used as an argument to ports.AttachPlayer0() and ports.AttachPlayer1().

func NewStick

NewStick is the preferred method of initialisation for the Stick type Satisifies the ports.NewPeripheral interface and can be used as an argument to ports.AttachPlayer0() and ports.AttachPlayer1().

Types

type Gamepad

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

Gamepad represents a two button gamepad. It is based on and is virtually the same as the regular Stick type.

It also consumes the same event types as the regular Stick type.

Information about how 2-button gamepads are expected to be handled found in the AtariAge thread below:

https://atariage.com/forums/topic/158596-2-button-games-in-bb-using-sega-genesis-pads-with-the-2600/?tab=comments

func (*Gamepad) HandleEvent

func (pad *Gamepad) HandleEvent(event ports.Event, data ports.EventData) (bool, error)

HandleEvent implements the ports.Peripheral interface.

func (*Gamepad) ID

func (pad *Gamepad) ID() plugging.PeripheralID

ID implements the ports.Peripheral interface.

func (*Gamepad) IsActive

func (pad *Gamepad) IsActive() bool

IsActive implements the ports.Peripheral interface.

func (*Gamepad) Plumb

func (pad *Gamepad) Plumb(bus ports.PeripheralBus)

Plumb implements the ports.Peripheral interface.

func (*Gamepad) PortID

func (pad *Gamepad) PortID() plugging.PortID

PortID implements the ports.Peripheral interface.

func (*Gamepad) Reset

func (pad *Gamepad) Reset()

Reset implements the ports.Peripheral interface.

func (*Gamepad) Snapshot

func (pad *Gamepad) Snapshot() ports.Peripheral

Snapshot implements the Peripheral interface.

func (*Gamepad) Step

func (pad *Gamepad) Step()

Step implements the ports.Peripheral interface.

func (*Gamepad) String

func (pad *Gamepad) String() string

String implements the ports.Peripheral interface.

func (*Gamepad) Unplug added in v0.17.0

func (pad *Gamepad) Unplug()

Unplug implements the Peripheral interface.

func (*Gamepad) Update

func (pad *Gamepad) Update(data chipbus.ChangedRegister) bool

Update implements the ports.Peripheral interface.

type Keypad

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

Keypad represents the VCS keypad type.

func (*Keypad) HandleEvent

func (key *Keypad) HandleEvent(event ports.Event, data ports.EventData) (bool, error)

HandleEvent implements the ports.Peripheral interface.

func (*Keypad) ID

func (key *Keypad) ID() plugging.PeripheralID

ID implements the ports.Peripheral interface.

func (*Keypad) IsActive

func (key *Keypad) IsActive() bool

IsActive implements the ports.Peripheral interface.

func (*Keypad) Plumb

func (key *Keypad) Plumb(bus ports.PeripheralBus)

Plumb implements the ports.Peripheral interface.

func (*Keypad) PortID

func (key *Keypad) PortID() plugging.PortID

PortID implements the ports.Peripheral interface.

func (*Keypad) Reset

func (key *Keypad) Reset()

Reset implements the ports.Peripheral interface.

func (*Keypad) Snapshot

func (key *Keypad) Snapshot() ports.Peripheral

Snapshot implements the Peripheral interface.

func (*Keypad) Step

func (key *Keypad) Step()

Step implements the ports.Peripheral interface.

func (*Keypad) String

func (key *Keypad) String() string

String implements the ports.Peripheral interface.

func (*Keypad) Unplug added in v0.17.0

func (key *Keypad) Unplug()

Unplug implements the Peripheral interface.

func (*Keypad) Update

func (key *Keypad) Update(data chipbus.ChangedRegister) bool

Update implements the ports.Peripheral interface.

type Paddles added in v0.21.0

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

Paddles represents a pair of paddles inserted into the same port

func (*Paddles) HandleEvent added in v0.21.0

func (pdl *Paddles) HandleEvent(event ports.Event, data ports.EventData) (bool, error)

HandleEvent implements the ports.Peripheral interface.

func (*Paddles) ID added in v0.21.0

func (pdl *Paddles) ID() plugging.PeripheralID

ID implements the ports.Peripheral interface.

func (*Paddles) IsActive added in v0.21.0

func (pdl *Paddles) IsActive() bool

IsActive implements the ports.Peripheral interface.

func (*Paddles) Plumb added in v0.21.0

func (pdl *Paddles) Plumb(bus ports.PeripheralBus)

Plumb implements the ports.Peripheral interface.

func (*Paddles) PortID added in v0.21.0

func (pdl *Paddles) PortID() plugging.PortID

PortID implements the ports.Peripheral interface.

func (*Paddles) Reset added in v0.21.0

func (pdl *Paddles) Reset()

Reset implements the ports.Peripheral interface.

func (*Paddles) Snapshot added in v0.21.0

func (pdl *Paddles) Snapshot() ports.Peripheral

Snapshot implements the Peripheral interface.

func (*Paddles) Step added in v0.21.0

func (pdl *Paddles) Step()

Step implements the ports.Peripheral interface.

func (*Paddles) String added in v0.21.0

func (pdl *Paddles) String() string

String implements the ports.Peripheral interface.

func (*Paddles) Unplug added in v0.21.0

func (pdl *Paddles) Unplug()

Unplug implements the Peripheral interface.

func (*Paddles) Update added in v0.21.0

func (pdl *Paddles) Update(data chipbus.ChangedRegister) bool

Update implements the ports.Peripheral interface.

type Stick

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

Stick represents the VCS digital joystick controller.

func (*Stick) HandleEvent

func (stk *Stick) HandleEvent(event ports.Event, data ports.EventData) (bool, error)

HandleEvent implements the ports.Peripheral interface.

func (*Stick) ID

func (stk *Stick) ID() plugging.PeripheralID

ID implements the ports.Peripheral interface.

func (*Stick) IsActive

func (stk *Stick) IsActive() bool

IsActive implements the ports.Peripheral interface.

func (*Stick) Plumb

func (stk *Stick) Plumb(bus ports.PeripheralBus)

Plumb implements the ports.Peripheral interface.

func (*Stick) PortID

func (stk *Stick) PortID() plugging.PortID

PortID implements the ports.Peripheral interface.

func (*Stick) Reset

func (stk *Stick) Reset()

Reset implements the ports.Peripheral interface.

func (*Stick) Snapshot

func (stk *Stick) Snapshot() ports.Peripheral

Snapshot implements the Peripheral interface.

func (*Stick) Step

func (stk *Stick) Step()

Step implements the ports.Peripheral interface.

func (*Stick) String

func (stk *Stick) String() string

String implements the ports.Peripheral interface.

func (*Stick) Unplug added in v0.17.0

func (stk *Stick) Unplug()

Unplug implements the Peripheral interface.

func (*Stick) Update

func (stk *Stick) Update(data chipbus.ChangedRegister) bool

Update implements the ports.Peripheral interface.

Jump to

Keyboard shortcuts

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