controllers

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: GPL-3.0, GPL-3.0 Imports: 8 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

func NewGamepad(instance *instance.Instance, port plugging.PortID, bus ports.PeripheralBus) ports.Peripheral

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

func NewKeypad(instance *instance.Instance, port plugging.PortID, bus ports.PeripheralBus) ports.Peripheral

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 NewPaddle

func NewPaddle(instance *instance.Instance, port plugging.PortID, bus ports.PeripheralBus) ports.Peripheral

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

func NewStick

func NewStick(instance *instance.Instance, port plugging.PortID, bus ports.PeripheralBus) ports.Peripheral

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 Paddle

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

Paddle represents the VCS paddle controller type.

func (*Paddle) HandleEvent

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

HandleEvent implements the ports.Peripheral interface.

func (*Paddle) ID

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

ID implements the ports.Peripheral interface.

func (*Paddle) IsActive

func (pdl *Paddle) IsActive() bool

IsActive implements the ports.Peripheral interface.

func (*Paddle) Plumb

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

Plumb implements the ports.Peripheral interface.

func (*Paddle) PortID

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

PortID implements the ports.Peripheral interface.

func (*Paddle) Reset

func (pdl *Paddle) Reset()

Reset implements the ports.Peripheral interface.

func (*Paddle) Snapshot

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

Snapshot implements the Peripheral interface.

func (*Paddle) Step

func (pdl *Paddle) Step()

Step implements the ports.Peripheral interface.

func (*Paddle) String

func (pdl *Paddle) String() string

String implements the ports.Peripheral interface.

func (*Paddle) Unplug added in v0.17.0

func (pdl *Paddle) Unplug()

Unplug implements the Peripheral interface.

func (*Paddle) Update

func (pdl *Paddle) 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