nesapu

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufferLength

func BufferLength() time.Duration

Types

type APU

type APU struct {
	Memory    memory.Master
	Input     [2]InputDevice // we put inputs here since the APU's buffer is used to talk to them
	Interrupt func()

	Trace io.Writer
	// contains filtered or unexported fields
}

func New

func New(mem memory.Master, t func(uint64) uint64) *APU

func (*APU) Clock240

func (apu *APU) Clock240(cnt uint64) uint64

func (*APU) Clock44100

func (apu *APU) Clock44100(cnt uint64) uint64

func (*APU) ClockCPU

func (apu *APU) ClockCPU(cnt uint64) uint64

func (*APU) Debug

func (apu *APU) Debug() string

func (*APU) Length

func (p *APU) Length() uint16

func (*APU) MemRead

func (apu *APU) MemRead(offset uint16) byte

func (*APU) MemWrite

func (apu *APU) MemWrite(offset uint16, val byte) byte

func (*APU) Ptr

func (p *APU) Ptr() uintptr

func (*APU) Read

func (apu *APU) Read(b []byte) (int, error)

func (*APU) String

func (p *APU) String() string

type DMC

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

func (*DMC) MemWrite

func (d *DMC) MemWrite(addr uint16, val byte) byte

type Filter

type Filter interface {
	Step(x float32) float32
}

func HighPassFilter

func HighPassFilter(sampleRate float32, cutoffFreq float32) Filter

func LowPassFilter

func LowPassFilter(sampleRate float32, cutoffFreq float32) Filter

sampleRate: samples per second cutoffFreq: oscillations per second

type FilterChain

type FilterChain []Filter

func (FilterChain) Step

func (fc FilterChain) Step(x float32) float32

type FirstOrderFilter

type FirstOrderFilter struct {
	B0 float32
	B1 float32
	A1 float32
	// contains filtered or unexported fields
}

First order filters are defined by the following parameters. y[n] = B0*x[n] + B1*x[n-1] - A1*y[n-1]

func (*FirstOrderFilter) Step

func (f *FirstOrderFilter) Step(x float32) float32

type InputDevice

type InputDevice interface {
	Read() byte // CLK trigger + read
	Write(byte) // OUT0, OUT1 and OUT2 update
}

InputDvice is a generic device connected to either port of the NES Typically a controller, but can be other stuff

type Noise

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

type Pulse

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

func (*Pulse) MemWrite

func (p *Pulse) MemWrite(addr uint16, val byte) byte

type Triangle

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

Jump to

Keyboard shortcuts

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