inputoutput

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2013 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PREFIX string = "IO"
View Source
const ROW_1 byte = 0x10
View Source
const ROW_2 byte = 0x20
View Source
const SCREEN_HEIGHT int = 144
View Source
const SCREEN_WIDTH int = 160

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlScheme

type ControlScheme struct {
	UP     int
	DOWN   int
	LEFT   int
	RIGHT  int
	A      int
	B      int
	START  int
	SELECT int
}
var DefaultControlScheme ControlScheme = ControlScheme{glfw.KeyUp, glfw.KeyDown, glfw.KeyLeft, glfw.KeyRight, 90, 88, 294, 288}

type Display

type Display struct {
	Name                 string
	ScreenSizeMultiplier int
}

func (*Display) DrawFrame

func (s *Display) DrawFrame(screenData *[144][160]types.RGB)

type IO

type IO struct {
	KeyHandler *KeyHandler
	Display    *Display
}

func NewIO

func NewIO() *IO

func (*IO) Init

func (i *IO) Init(title string, screenSize int, onCloseHandler func()) error

type KeyHandler

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

func (*KeyHandler) Init

func (k *KeyHandler) Init(cs ControlScheme)

func (*KeyHandler) KeyDown

func (k *KeyHandler) KeyDown(key int)

released sets bit for key to 0

func (*KeyHandler) KeyUp

func (k *KeyHandler) KeyUp(key int)

released sets bit for key to 1

func (*KeyHandler) LinkIRQHandler

func (k *KeyHandler) LinkIRQHandler(m components.IRQHandler)

func (*KeyHandler) Name

func (k *KeyHandler) Name() string

func (*KeyHandler) Read

func (k *KeyHandler) Read(addr types.Word) byte

func (*KeyHandler) Reset

func (k *KeyHandler) Reset()

func (*KeyHandler) Write

func (k *KeyHandler) Write(addr types.Word, value byte)

type Screen

type Screen interface {
	DrawFrame(screenData *[144][160]types.RGB)
}

Clients just need to talk to the interface to draw frames. Screen data is a pointer for performance reasons

Jump to

Keyboard shortcuts

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