inputoutput

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: MIT Imports: 6 Imported by: 1

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
}

type CoreIO

type CoreIO struct {
	OnCloseHandler func()
	KeyHandler     *KeyHandler
	StopChannel    chan int
	Headless       bool
	// contains filtered or unexported fields
}

CoreIO contains all core functionality for running the IO event loop all sub types should extend this type

func NewCoreIO

func NewCoreIO(frameRateLock int64, headless bool, frameRateReporter func(float32), display Display) *CoreIO

func (*CoreIO) GetAvgFrameRate

func (i *CoreIO) GetAvgFrameRate() float32

func (*CoreIO) GetKeyHandler

func (i *CoreIO) GetKeyHandler() *KeyHandler

GetKeyHandler returns the key handler component for managing interactions with the keyboard

func (*CoreIO) GetScreenOutputChannel

func (i *CoreIO) GetScreenOutputChannel() chan *types.Screen

GetScreenOutputChannel returns the channel to push screen change events to the IO event loop

func (*CoreIO) Run

func (i *CoreIO) Run()

Run runs the IO event loop

type Display

type Display interface {
	DrawFrame(*types.Screen)
	Stop()
}

type IOHandler

type IOHandler interface {
	Init(title string, screenSize int, onCloseHandler func()) error
	GetKeyHandler() *KeyHandler
	GetScreenOutputChannel() chan *types.Screen
	GetAvgFrameRate() float32
	Run()
}

IOHandler interface for handling all IO interations with the emulator

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)

Jump to

Keyboard shortcuts

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