Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APU ¶
type APU struct {
// contains filtered or unexported fields
}
APU is the GameBoy's audio processing unit. Audio is comprised of four channels, each one controlled by a set of registers.
Channels 1 and 2 are both Square channels, channel 3 is a arbitrary waveform channel which can be set in RAM, and channel 4 outputs noise.
func (*APU) ToggleSoundChannel ¶
ToggleSoundChannel toggles a sound channel for debugging.
func (*APU) WriteWaveform ¶
WriteWaveform writes a value to the waveform ram.
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel represents one of four Gameboy sound channels.
func NewChannel ¶
func NewChannel() *Channel
NewChannel returns a new sound channel using a sampling function.
type WaveGenerator ¶
WaveGenerator is a function which can be used for generating waveform samples for different channels.
func Noise ¶
func Noise() WaveGenerator
Noise returns a wave generator for a noise channel. This is used by channel 4.
func Square ¶
func Square(mod float64) WaveGenerator
Square returns a square wave generator with a given mod. This is used for channels 1 and 2.
func Waveform ¶
func Waveform(ram []byte) WaveGenerator
Waveform returns a wave generator for some waveform ram. This is used by channel 3.