apu

package
v0.0.0-...-77df42f Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 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 APU

type APU struct {
	Samples Samples

	Debug struct {
		ChannelEnabled [4]bool
	}
	// contains filtered or unexported fields
}

APU represents the GameBoy's audio processing unit. It comprises 4 channels: 2 pulse channels, a wave channel and a noise channel. Each channel has is controlled by a set of addresses.

Channel 1 and 2 are both square channels. They can be used to play tones of different frequencies. Channel 3 is an arbitrary waveform channel that can be set in RAM. Channel 4 is a noise channel that can be used to play white noise.

func NewAPU

func NewAPU(s *scheduler.Scheduler, b *io.Bus) *APU

NewAPU returns a new APU.

func (*APU) AttachPlayback

func (a *APU) AttachPlayback(playback func([]uint8))

func (*APU) Pause

func (a *APU) Pause()

Pause pauses the APU.

func (*APU) Play

func (a *APU) Play()

Play resumes the APU.

func (*APU) SetModel

func (a *APU) SetModel(model types.Model)

func (*APU) StepFrameSequencer

func (a *APU) StepFrameSequencer()

type Sample

type Sample struct {
	Channel1, Channel2, Channel3, Channel4 uint8
}

type Samples

type Samples []Sample

Jump to

Keyboard shortcuts

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