pad

package
v0.0.0-...-8886972 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PadAddr types.Addr = 0x00
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button byte
const (
	// A is the A button on the GameBoy.
	A Button = 0x01
	// B is the B button on the GameBoy.
	B Button = 0x02
	// Select is the select button on the GameBoy.
	Select Button = 0x04
	// Start is the start button on the GameBoy.
	Start Button = 0x08
	// Right is the right pad direction on the GameBoy.
	Right Button = 0x10
	// Left is the left pad direction on the GameBoy.
	Left Button = 0x20
	// Up is the up pad direction on the GameBoy.
	Up Button = 0x40
	// Down is the down pad direction on the GameBoy.
	Down Button = 0x80
)

type Pad

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

func NewPad

func NewPad() *Pad

func (*Pad) Press

func (pad *Pad) Press(button Button)

func (*Pad) Read

func (p *Pad) Read(addr types.Addr) byte

func (*Pad) Release

func (pad *Pad) Release(button Button)

func (*Pad) Write

func (p *Pad) Write(addr types.Addr, value byte)

Jump to

Keyboard shortcuts

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