clock

package
v0.0.0-...-fa24f98 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClockInput

type ClockInput func(uint64) uint64

type ClockState

type ClockState int
const (
	Stopped ClockState = iota
	Running
	OneStep
)

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

type Master

type Master struct {
	// contains filtered or unexported fields
}

func New

func New(freq uint64) *Master

New returns a new clock running at the given frequency, using the specified step value as increment value. Higher step values means more calls will happen in batches, but improves how close this will run to real time.

func (*Master) Frequency

func (m *Master) Frequency() uint64

func (*Master) Listen

func (m *Master) Listen(divider, delta uint64, cb ClockInput) *Listener

Listen will cause cb() to be called every `divider` tick of the master clock, allowing synchronization between various elements of the NES.

func (*Master) Start

func (m *Master) Start()

func (*Master) Stop

func (m *Master) Stop()

Jump to

Keyboard shortcuts

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