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.
- Overview
- Channel 1: square with sweep
- Channel 2: square
- Channel 3: wave
- Channel 4: noise
- Master control
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.
| Channel | Kind | Registers |
|---|---|---|
| 1 | Square with sweep | $FF10 – $FF14 |
| 2 | Square | $FF16 – $FF19 |
| 3 | Wave | $FF1A – $FF1E, table $FF30 – $FF3F |
| 4 | Noise | $FF20 – $FF23 |
| Master | Mix 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.
| Register | Address | Contents |
|---|---|---|
| NR10 | $FF10 | Sweep: period, direction, shift. |
| NR11 | $FF11 | Duty cycle (top 2 bits), length load. |
| NR12 | $FF12 | Volume envelope: start volume, direction, period. |
| NR13 | $FF13 | Frequency low 8 bits. |
| NR14 | $FF14 | Trigger, 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.
| Register | Address | Contents |
|---|---|---|
| NR21 | $FF16 | Duty cycle (top 2 bits), length load. |
| NR22 | $FF17 | Volume envelope: start volume, direction, period. |
| NR23 | $FF18 | Frequency low 8 bits. |
| NR24 | $FF19 | Trigger, 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.
| Register | Address | Contents |
|---|---|---|
| NR30 | $FF1A | Channel on or off (DAC power). |
| NR31 | $FF1B | Length load (8 bits). |
| NR32 | $FF1C | Output level: full, half, quarter or mute. |
| NR33 | $FF1D | Frequency low 8 bits. |
| NR34 | $FF1E | Trigger, length enable, frequency high 3 bits. |
| Wave RAM | $FF30 – $FF3F | 32 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.
| Register | Address | Contents |
|---|---|---|
| NR41 | $FF20 | Length load (6 bits). |
| NR42 | $FF21 | Volume envelope: start volume, direction, period. |
| NR43 | $FF22 | Clock shift, LFSR width, divisor. |
| NR44 | $FF23 | Trigger, 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.
| Register | Address | Contents |
|---|---|---|
| NR50 | $FF24 | Left and right master volume, plus external audio in. |
| NR51 | $FF25 | Which channels feed the left and right sides. |
| NR52 | $FF26 | Sound 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.