coords

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: GPL-3.0, GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package coords represents and can work with television coorindates

Coordinates represent the state of the emulation from the point of the television. A good way to think about them is as a measurement of time. They define *when* something happened (this pixel was drawn, this user input was received, etc.) relative to the start of the emulation.

They are used throughout the emulation for rewinding, recording/playback and many other sub-systems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(A, B TelevisionCoords) bool

Equal compares two instances of TelevisionCoords and return true if both are equal.

func GreaterThan

func GreaterThan(A, B TelevisionCoords) bool

GreaterThan compares two instances of TelevisionCoords and return true if A is greater than to B.

func GreaterThanOrEqual

func GreaterThanOrEqual(A, B TelevisionCoords) bool

GreaterThanOrEqual compares two instances of TelevisionCoords and return true if A is greater than or equal to B.

func Sum added in v0.18.0

func Sum(A TelevisionCoords, scanlinesPerFrame int) int

Sum the the number of clocks in the television coordinates.

Types

type TelevisionCoords

type TelevisionCoords struct {
	Frame    int
	Scanline int
	Clock    int
}

TelevisionCoords represents the state of the TV at any moment in time. It can be used when all three values need to be stored or passed around.

Zero value for clock field is -specification.ClksHBlank

func Diff added in v0.18.0

func Diff(A, B TelevisionCoords, scanlinesPerFrame int) TelevisionCoords

Diff returns the difference between the B and A instances. The scanlinesPerFrame value is the number of scanlines in a typical frame for the ROM, implying that for best results, the television image should be stable.

func (TelevisionCoords) String

func (c TelevisionCoords) String() string

Jump to

Keyboard shortcuts

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