pixel

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FontSet = [80]byte{
	0xF0, 0x90, 0x90, 0x90, 0xF0,
	0x20, 0x60, 0x20, 0x20, 0x70,
	0xF0, 0x10, 0xF0, 0x80, 0xF0,
	0xF0, 0x10, 0xF0, 0x10, 0xF0,
	0x90, 0x90, 0xF0, 0x10, 0x10,
	0xF0, 0x80, 0xF0, 0x10, 0xF0,
	0xF0, 0x80, 0xF0, 0x90, 0xF0,
	0xF0, 0x10, 0x20, 0x40, 0x40,
	0xF0, 0x90, 0xF0, 0x90, 0xF0,
	0xF0, 0x90, 0xF0, 0x10, 0xF0,
	0xF0, 0x90, 0xF0, 0x90, 0x90,
	0xE0, 0x90, 0xe0, 0x90, 0xE0,
	0xF0, 0x80, 0x80, 0x80, 0x80,
	0xF0, 0x90, 0x90, 0x90, 0xE0,
	0xF0, 0x80, 0xF0, 0x80, 0xF0,
	0xF0, 0x80, 0xF0, 0x80, 0x80,
}

FontSet found in http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter

Functions

This section is empty.

Types

type Window

type Window struct {
	*pixelgl.Window
	KeyMap   map[uint16]pixelgl.Button
	KeysDown [16]*time.Ticker
}

Window embeds a pixelgl window, holds a keymapping of hex -> pixelgl.Button, and an array of tickers for keeping tracking of keys down

func NewWindow

func NewWindow() (*Window, error)

NewWindow handles creating a new pixelgl window config, initializing the window, and returning a pointer a Window with an embedded *pixelgl.Window

func (*Window) DrawGraphics

func (w *Window) DrawGraphics(gfx [64 * 32]byte)

DrawGraphics clears the window and draws a new one based on what pixels in the VM's gfx are turned on

Jump to

Keyboard shortcuts

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