Game Boy Audio

The Game Boy has a sound unit with four channels: two square-wave tones, one of them with a pitch sweep, a wave channel that plays back a short user-defined waveform, and a noise channel for drums and effects. Each channel has its own registers in the I/O range, and a set of master registers mixes them to the two output sides. This page gives the per-channel register layout.

Game Boy Audio

Overview

The four channels play at once and are summed into two output sides, left and right, so the machine has stereo through headphones and mono through the built-in speaker. Channels 1 and 2 are square waves with a choice of duty cycle. Channel 3 reads a table of 32 four-bit samples, playing any repeating waveform the program supplies. Channel 4 is a noise generator. Each channel has a length counter and, except the wave channel, a volume envelope.

ChannelKindRegisters
1Square with sweep$FF10 – $FF14
2Square$FF16 – $FF19
3Wave$FF1A – $FF1E, table $FF30 – $FF3F
4Noise$FF20 – $FF23
MasterMix and enable$FF24 – $FF26

Channel 1: square with sweep

Channel 1 is a square wave with a hardware frequency sweep, which slides the pitch up or down on its own, useful for zaps and rising alerts. Its five registers set the sweep, the duty and length, the volume envelope, and the 11-bit frequency split across the low and high registers.

RegisterAddressContents
NR10$FF10Sweep: period, direction, shift.
NR11$FF11Duty cycle (top 2 bits), length load.
NR12$FF12Volume envelope: start volume, direction, period.
NR13$FF13Frequency low 8 bits.
NR14$FF14Trigger, length enable, frequency high 3 bits.

Channel 2: square

Channel 2 is the same square-wave generator as channel 1 but without the sweep unit, so it has four registers. It carries the melody or a second harmony line while channel 1 handles sweeping effects.

RegisterAddressContents
NR21$FF16Duty cycle (top 2 bits), length load.
NR22$FF17Volume envelope: start volume, direction, period.
NR23$FF18Frequency low 8 bits.
NR24$FF19Trigger, length enable, frequency high 3 bits.

The duty field chooses one of four pulse widths (12.5%, 25%, 50% or 75%), which changes the tone's timbre from thin to full.

Channel 3: wave

Channel 3 plays back a 32-step waveform the program writes into wave RAM at $FF30 to $FF3F. Those 16 bytes hold 32 four-bit samples, two per byte, and the channel cycles through them at a rate set by its frequency registers. This lets it voice shapes the square channels cannot, such as smooth or bass tones.

RegisterAddressContents
NR30$FF1AChannel on or off (DAC power).
NR31$FF1BLength load (8 bits).
NR32$FF1COutput level: full, half, quarter or mute.
NR33$FF1DFrequency low 8 bits.
NR34$FF1ETrigger, length enable, frequency high 3 bits.
Wave RAM$FF30 – $FF3F32 four-bit samples, two per byte.

Channel 4: noise

Channel 4 produces noise from a linear-feedback shift register clocked at a programmable rate. A width bit switches between a longer, hissier sequence and a shorter, more tonal one, so it covers cymbals, explosions and buzzes. It has a volume envelope but no frequency in the usual sense; its pitch is a clock divisor.

RegisterAddressContents
NR41$FF20Length load (6 bits).
NR42$FF21Volume envelope: start volume, direction, period.
NR43$FF22Clock shift, LFSR width, divisor.
NR44$FF23Trigger, length enable.

Master control

Three registers sit above the channels. They set the master volume for each side, route each channel to the left or right output, and switch the whole sound unit on or off.

RegisterAddressContents
NR50$FF24Left and right master volume, plus external audio in.
NR51$FF25Which channels feed the left and right sides.
NR52$FF26Sound on or off, and per-channel status flags.

Clearing bit 7 of NR52 powers the sound unit down and zeroes the other sound registers, which saves battery when no audio is playing. Turning it back on requires reloading the channels before they will sound.