coords

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: 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

View Source
const FrameIsUndefined = ^(0)

FrameIsUndefined is used to indicate that the Frame field of the TelevisionCoords struct is to be ignored

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.

If the Frame field is undefined for either argument then the Frame field is ignored for the test.

func GreaterThan

func GreaterThan(A, B TelevisionCoords) bool

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

If the Frame field is undefined for either argument then the Frame field is ignored for the test.

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.

If the Frame field is undefined for either argument then the Frame field is ignored for the test.

func Sum added in v0.18.0

func Sum(A TelevisionCoords, scanlinesPerFrame int) int

Sum the the number of clocks in the television coordinates.

If the Frame field is undefined for the TelevisionCoords then the Frame field in the result of the function is also undefined.

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.

If the Frame field is undefined for either TelevisionCoords argument then the Frame field in the result of the function is also undefined.

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