types

package
v0.0.0-...-45a14b4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const SCREEN_HEIGHT = 240
View Source
const SCREEN_WIDTH = 256

Variables

This section is empty.

Functions

func CoordinatesToArrayIndex

func CoordinatesToArrayIndex(x int, y int, canvasWidth int) int

func HighNibble

func HighNibble(word Word) byte

func LinearToXCoordinate

func LinearToXCoordinate(index int, canvasWidth int) int32

func LinearToYCoordinate

func LinearToYCoordinate(index int, canvasWidth int) int32

func LowNibble

func LowNibble(word Word) byte

Types

type Address

type Address = Word

Address is an address representation

func CreateAddress

func CreateAddress(low byte, high byte) Address

CreateAddress creates an Address

type Color

type Color struct {
	R byte
	G byte
	B byte
}

type Frame

type Frame struct {
	Pixels [SCREEN_WIDTH * SCREEN_HEIGHT]Color
}

func (*Frame) PushTile

func (frame *Frame) PushTile(tile Tile, x int, y int)

func (*Frame) SetPixel

func (frame *Frame) SetPixel(x int, y int, rgb Color)

type Pixel

type Pixel struct {
	X     int
	Y     int
	Color Color
}

type Tile

type Tile struct {
	Pixels [8 * 8]Color
}

type Word

type Word uint16

Word is an unsigned int 16 bits

func CreateWord

func CreateWord(low byte, high byte) Word

CreateWord creates a Word

func (*Word) HighNibble

func (word *Word) HighNibble() byte

func (*Word) LowNibble

func (word *Word) LowNibble() byte

func (*Word) ToBytes

func (word *Word) ToBytes() []byte

Jump to

Keyboard shortcuts

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