Every register in Pan Docs’ Hardware Registers list (the table on the memory map page), with what each of its bits does, one section per address (anchor #ffXX, in lower case). The text is our own wording of the raw Pan Docs Markdown (CC0, kept in the site’s sample sources with SHA-256 in the sample README), file by file as cited in each group. “R/W” is read and write, “R” read-only, “W” write-only. A bit Pan Docs does not name in its bit diagram is listed as “not named”; this page does not say what it does. The timing and behaviour behind the bits is on the video, sound and I/O page. “CGB Mode” means a Game Boy Color running a Color game; “Non-CGB Mode” covers the original Game Boy, the Super Game Boy and a Color running a monochrome game.
Joypad, serial, timer and interrupts
From Pan Docs’ Joypad_Input.md, Serial_Data_Transfer_(Link_Cable).md, Timer_and_Divider_Registers.md and Interrupts.md.
$FF00 — P1/JOYP: Joypad
The eight buttons form a 2 × 4 matrix: write bits 4 and 5 to choose a group, then read bits 0–3.
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7–6 | not named | — | Not in Pan Docs’ bit diagram. |
| 5 | Select buttons | R/W | 0 = the action buttons (Start, Select, B, A) can be read from bits 3–0. |
| 4 | Select d-pad | R/W | 0 = the directions can be read from bits 3–0. |
| 3 | Start / Down | R | 0 = pressed. |
| 2 | Select / Up | R | 0 = pressed. |
| 1 | B / Left | R | 0 = pressed. |
| 0 | A / Right | R | 0 = pressed. |
The low nibble is read-only. A pressed button reads as 0, unusually for the Game Boy. If neither group is selected ($30 written) the low nibble reads $F. Most programs read the port several times and use only the last value, the first reads serving as a delay while the inputs settle. Super Game Boy games also use this register to send command packets to the SNES (see the memory map page).
$FF01 — SB: Serial transfer data
R/W, 8 bits. Before a transfer it holds the byte that will go out. During a transfer it holds a mix: on each clock the leftmost bit is shifted out and the bit arriving from the other side is shifted in at bit 0, so after eight shifts SB holds the received byte (Pan Docs’ diagram shows o.7 … o.0 outgoing bits being replaced one by one by i.7 … i.0).
$FF02 — SC: Serial transfer control
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | Transfer enable | R/W | 1 = a transfer is requested or in progress. |
| 6–2 | not named | — | Not in Pan Docs’ bit diagram. |
| 1 | Clock speed | R/W, CGB Mode only | 1 = high-speed serial clock (about 256 kHz in normal speed). |
| 0 | Clock select | R/W | 0 = external clock (this console is the “slave”), 1 = internal clock (“master”). |
The master loads SB and writes $81; when the transfer ends SC bit 7 is cleared and a serial interrupt is requested (read only bit 7 to test for completion). The other console loads SB and writes $80, and gets the same two signals at the end. The internal clock rates:
| Clock | Speed | Conditions |
|---|---|---|
| 8192 Hz | 1 KB/s | bit 1 clear, normal speed (the only rate outside CGB Mode) |
| 16384 Hz | 2 KB/s | bit 1 clear, double speed |
| 262144 Hz | 32 KB/s | bit 1 set, normal speed |
| 524288 Hz | 64 KB/s | bit 1 set, double speed |
$FF04 — DIV: Divider register
R/W, 8 bits. Counts up at 16384 Hz (about 16779 Hz on a Super Game Boy), 32768 Hz in CGB double speed. Writing any value resets it to $00; the stop instruction and a speed switch reset it too, and it ticks again only when stop mode ends. It always counts, whatever TAC says.
$FF05 — TIMA: Timer counter
R/W, 8 bits. Counts up at the rate chosen in TAC. When it overflows past $FF it is reloaded from TMA and a timer interrupt is requested.
$FF06 — TMA: Timer modulo
R/W, 8 bits. The value TIMA restarts from after an overflow. Set to $FF it makes an interrupt for every increment; $FE divides the selected clock by two, $FD by three, and so on. A TMA write in the same M-cycle as the reload: Pan Docs’ register text says TIMA keeps the old value, but its own overflow text, the gbdev wiki, Mooneye tma_write_reloading and SameBoy all give TIMA the new value, which we follow (see timer, HALT and power).
$FF07 — TAC: Timer control
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7–3 | not named | — | Not in Pan Docs’ bit diagram. |
| 2 | Enable | R/W | Whether TIMA counts (DIV does regardless). |
| 1–0 | Clock select | R/W | The TIMA rate, in the table below. |
| Bits 1–0 | TIMA increments every | DMG, SGB2, CGB normal speed | SGB1 | CGB double speed |
|---|---|---|---|---|
| 00 | 256 M-cycles | 4096 Hz | about 4194 Hz | 8192 Hz |
| 01 | 4 M-cycles | 262144 Hz | about 268400 Hz | 524288 Hz |
| 10 | 16 M-cycles | 65536 Hz | about 67110 Hz | 131072 Hz |
| 11 | 64 M-cycles | 16384 Hz | about 16780 Hz | 32768 Hz |
Writing TAC may increase TIMA once (Pan Docs’ “Timer Obscure Behaviour” chapter, not read here). This timer has nothing to do with the real-time clock of the MBC3 cartridge.
$FF0F — IF: Interrupt flag
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7–5 | not named | — | Not in Pan Docs’ bit diagram. They read as 1: Mooneye if_ie_registers reads $E8 with the serial request set and $E0 after it is served; SameBoy returns IF OR $E0 (see timer, HALT and power). |
| 4 | Joypad | R/W | 1 = the joypad interrupt (vector $60) is requested. |
| 3 | Serial | R/W | 1 = serial interrupt ($58) requested. |
| 2 | Timer | R/W | 1 = timer interrupt ($50) requested. |
| 1 | LCD | R/W | 1 = STAT interrupt ($48) requested. |
| 0 | VBlank | R/W | 1 = VBlank interrupt ($40) requested. |
A bit is set when its request signal goes from low to high. A set bit only requests: the handler runs when both the CPU’s IME flag and the matching IE bit allow it. Software seldom needs to write IF, but may, to request or discard an interrupt by hand.
$FFFF — IE: Interrupt enable
Same bit order as IF: bit 4 Joypad, 3 Serial, 2 Timer, 1 LCD, 0 VBlank (all R/W; bits 7–5 not named). A set bit lets that interrupt’s handler be called, if IME is also set. If several are requested and allowed, the lowest bit number is served first (VBlank highest priority, Joypad lowest). IME itself is not a register: it cannot be read, is changed by ei, di, reti and by entering a handler, and is off when the game starts. Entering a handler clears the IF bit and IME, then calls the vector, which takes 5 M-cycles.
Sound
From Pan Docs’ Audio_Registers.md, with the DAC, mixer and PCM facts from Audio_details.md. Names follow NRxy: x is the channel (5 for the global registers) and y the register within it. As a rule NRx0 is a channel-specific feature, NRx1 the length timer, NRx2 volume and envelope, NRx3 the period (low part) and NRx4 the trigger, the length enable and the rest of the period, with exceptions. A channel’s DAC is on when NRx2 & $F8 is not zero (channel 3: NR30 bit 7).
$FF10 — NR10: Channel 1 sweep
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | not named | — | Not in Pan Docs’ bit diagram. |
| 6–4 | Pace | R/W | How often a sweep step happens, in 128 Hz ticks (7.8 ms). The value is re-read only after a step completes or on trigger; writing 0 stops the steps at once. |
| 3 | Direction | R/W | 0 = the period increases, 1 = it decreases. |
| 2–0 | Individual step | R/W | Each step makes the new period = period ± period ÷ 2step. |
Each step rewrites the period held in NR13/NR14. In addition mode, a new period above $7FF turns the channel off, even when the pace is 0. A period of 0 can never be changed by the sweep, which also cannot underflow.
$FF11 — NR11: Channel 1 length timer and duty cycle
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7–6 | Wave duty | R/W | The pulse shape (table below). |
| 5–0 | Initial length timer | W | The higher the value, the sooner the channel is cut (it counts up to 64). |
| Bits 7–6 | Duty cycle |
|---|---|
| 00 | 12.5 % |
| 01 | 25 % |
| 10 | 50 % |
| 11 | 75 % (sounds the same as 25 %) |
The duty also changes the phase slightly, which is audible only together with other channels.
$FF12 — NR12: Channel 1 volume and envelope
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7–4 | Initial volume | R/W | How loud the channel starts. The bits are not updated by the envelope. |
| 3 | Env dir | R/W | 0 = the volume falls, 1 = it rises. |
| 2–0 | Sweep pace | R/W | The envelope ticks at 64 Hz and changes the volume every this many ticks; 0 turns the envelope off. |
Bits 7–3 all zero (volume 0, decreasing) turn the DAC off, and so the channel, which may cause an audio pop. A write while the channel is on needs a retrigger afterwards (unless it turned the channel off). Writing $08 then retriggering with $80 in NRx4 silences a channel without turning its DAC off.
$FF13 — NR13: Channel 1 period low
W, 8 bits: the low 8 bits of the 11-bit period value (the high 3 bits are in NR14). The period divider counts up and, on overflowing past 2047 ($7FF), reloads from NR13/NR14, so a higher value gives a shorter period and a higher pitch. The pulse channels are clocked at 1048576 Hz and their wave has 8 samples, so the sample rate is 1048576 ÷ (2048 − period) Hz and the tone 131072 ÷ (2048 − period) Hz. A period change takes effect only after the current sample ends.
$FF14 — NR14: Channel 1 period high and control
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | Trigger | W | Writing with this bit set triggers the channel: it is switched on, an expired length timer is reset, the period divider and the envelope timer are reloaded, the volume is set from NR12’s initial volume, and the sweep restarts. |
| 6 | Length enable | R/W | Takes effect at once; when on, the length timer can switch the channel off. |
| 5–3 | not named | — | Not in Pan Docs’ bit diagram. |
| 2–0 | Period | W | The high 3 bits of the period value. |
If the channel’s DAC is off, a trigger does not turn the channel on.
$FF16 — NR21: Channel 2 length timer and duty cycle
Channel 2 is channel 1 without the sweep. NR21 has the same bits as NR11 (bits 7–6 duty, bits 5–0 initial length timer, the latter write-only).
$FF17 — NR22: Channel 2 volume and envelope
The same bits as NR12: bits 7–4 initial volume, bit 3 envelope direction, bits 2–0 envelope pace.
$FF18 — NR23: Channel 2 period low
W; the same as NR13, for channel 2.
$FF19 — NR24: Channel 2 period high and control
The same bits as NR14: bit 7 trigger, bit 6 length enable, bits 2–0 the high part of the period.
$FF1A — NR30: Channel 3 DAC enable
R/W. Bit 7 (DAC on/off) switches channel 3’s DAC on or off; the other bits are not named. Turning the DAC off turns the channel off at once and may cause a pop. It is often turned off before wave RAM is written.
$FF1B — NR31: Channel 3 length timer
W, bits 7–0: the initial length timer. Channel 3’s timer counts up to 256, so the higher the value, the sooner the channel is cut.
$FF1C — NR32: Channel 3 output level
R/W. Bits 6–5 choose the volume; the other bits are not named. This channel has no envelope.
| Bits 6–5 | Output level |
|---|---|
| 00 | mute |
| 01 | 100 % (samples as read from wave RAM) |
| 10 | 50 % (shifted right once) |
| 11 | 25 % (shifted right twice) |
$FF1D — NR33: Channel 3 period low
W: the low 8 bits of the period value. This channel’s divider runs at 2097152 Hz and its wave has 32 samples, so the sample rate is 2097152 ÷ (2048 − period) Hz and the tone 65536 ÷ (2048 − period) Hz, half the pitch of a pulse channel with the same period value. A period change takes effect after the next wave RAM read.
$FF1E — NR34: Channel 3 period high and control
Bit 7 Trigger (W), bit 6 Length enable (R/W), bits 2–0 Period high (W), bits 5–3 not named; the same roles as in NR14. A trigger switches the channel on, resets an expired length timer, reloads the period divider and the volume, and resets the wave RAM index without refilling the wave. On monochrome consoles only, retriggering while the channel is about to read a wave RAM byte corrupts wave RAM unpredictably. A triggered channel keeps outputting the last sample it read (0 after the APU was off) until it reads its next one.
$FF20 — NR41: Channel 4 length timer
W, bits 5–0: the initial length timer (bits 7–6 not named); the higher the value, the sooner the channel is cut.
$FF21 — NR42: Channel 4 volume and envelope
The same bits as NR12.
$FF22 — NR43: Channel 4 frequency and randomness
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7–4 | Clock shift | R/W | See the formula below. |
| 3 | LFSR width | R/W | 0 = 15-bit, 1 = 7-bit (a more regular output, closer to a pulse than to noise). |
| 2–0 | Clock divider | R/W | See the formula below; 0 is treated as 0.5. |
The LFSR is clocked at 262144 ÷ (divider × 2shift) Hz; a shift of 14 or 15 stops it. A 0 bit shifted out gives 0, a 1 bit gives the volume from NR42. Switching from 15 to 7 bits in a certain LFSR state can lock it up and silence the channel; retriggering resets the LFSR.
$FF23 — NR44: Channel 4 control
Bit 7 Trigger (W), bit 6 Length enable (R/W), bits 5–0 not named. A trigger switches the channel on, resets an expired length timer and the envelope timer, loads the volume from NR42 and resets the LFSR.
$FF24 — NR50: Master volume and VIN panning
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | VIN left | R/W | Sends the cartridge’s VIN line to the left output; keep 0 if no external sound hardware is used. |
| 6–4 | Left volume | R/W | 0–7; 0 counts as volume 1 (very quiet), 7 as 8 (no reduction). The amplifier never mutes a non-silent input. |
| 3 | VIN right | R/W | As bit 7, for the right output. |
| 2–0 | Right volume | R/W | As bits 6–4. |
$FF25 — NR51: Sound panning
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | CH4 left | R/W | 1 = channel 4 goes to the left output. |
| 6 | CH3 left | R/W | as above for channel 3. |
| 5 | CH2 left | R/W | as above for channel 2. |
| 4 | CH1 left | R/W | as above for channel 1. |
| 3 | CH4 right | R/W | 1 = channel 4 goes to the right output. |
| 2 | CH3 right | R/W | as above for channel 3. |
| 1 | CH2 right | R/W | as above for channel 2. |
| 0 | CH1 right | R/W | as above for channel 1. |
Selecting or deselecting a channel whose DAC is on causes an audio pop.
$FF26 — NR52: Audio master control
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | Audio on/off | R/W | Powers the sound unit. Off saves about 16 % power, clears all sound registers and makes them read-only until it is on again (on monochrome models the length timers too); wave RAM and the DIV-APU counter are not affected. |
| 6–4 | not named | — | Not in Pan Docs’ bit diagram. |
| 3 | CH4 on? | R | 1 = channel 4 is active. |
| 2 | CH3 on? | R | 1 = channel 3 is active. |
| 1 | CH2 on? | R | 1 = channel 2 is active. |
| 0 | CH1 on? | R | 1 = channel 1 is active. |
Writing the four status bits does not switch channels on or off. A channel is switched on by a trigger (if its DAC is on) and off by its length timer expiring, by the channel 1 sweep overflowing, or by its DAC being turned off; the envelope reaching volume 0 does not. The bits report the channels’ generators, not their DACs.
$FF30–$FF3F — Wave pattern RAM
R/W, 16 bytes, each holding two 4-bit samples. Channel 3 reads them left to right, high nibble first, but when it starts the first sample it reads is the low nibble of the first byte. While channel 3 is active the CPU’s access misbehaves: on the AGB reads give $FF and writes are ignored; on monochrome consoles access works only on the cycle channel 3 itself reads; on other models the CPU reaches the byte channel 3 is reading, whatever the address. With the channel inactive wave RAM reads and writes normally, even with the DAC on.
$FF76 — PCM12: Digital outputs 1 and 2
R, Color models only, undocumented by Nintendo. The low nibble copies channel 1’s digital output, the high nibble channel 2’s.
$FF77 — PCM34: Digital outputs 3 and 4
R, Color models only. The same for channels 3 (low nibble) and 4 (high nibble).
LCD, scrolling, DMA and monochrome palettes
From Pan Docs’ LCDC.md, STAT.md, Scrolling.md, Window.md, OAM_DMA_Transfer.md and Palettes.md.
$FF40 — LCDC: LCD control
R/W. The main control register; its bits switch the picture layers on and off. The PPU never locks it, so it can be changed in the middle of a line.
| Bit | Name | 0 | 1 |
|---|---|---|---|
| 7 | LCD and PPU enable | off | on |
| 6 | Window tile map area | $9800–$9BFF | $9C00–$9FFF |
| 5 | Window enable | off | on |
| 4 | BG and Window tiles (tile data area) | $8800–$97FF (signed “$8800 method”) | $8000–$8FFF (unsigned) |
| 3 | BG tile map area | $9800–$9BFF | $9C00–$9FFF |
| 2 | OBJ size | 8 × 8 (one tile) | 8 × 16 (two stacked tiles) |
| 1 | OBJ enable | off | on |
| 0 | BG and Window enable / priority | off (Non-CGB) or objects always on top (CGB) | on (Non-CGB) or normal priority (CGB) |
- Bit 7. Turning it off gives the CPU free access to VRAM and OAM. Switch off only during VBlank: doing it at another time may burn a black line into the screen, and Nintendo reportedly rejected games that did. A disabled screen is blank (on the DMG a white “whiter” than colour 0; on the Super Game Boy the last picture stays). When re-enabled, the PPU starts at once but the first frame stays blank.
- Bit 5. On the DMG it is overridden when bit 0 is clear. Changing it mid-frame has complex effects (window).
- Bit 4. Objects always use the
$8000method. - Bit 2. Changing from 8 × 8 to 8 × 16 mid-frame within 8 lines of the bottom of an object shows its second tile for the rest of those lines; a change during mode 2 or 3 can leave artefacts.
- Bit 1. May be toggled mid-frame, for instance to hide objects behind a status bar (set it for game lines, clear it for the bar lines, from the VBlank and STAT handlers). Pan Docs adds that toggling mid-line might have odd results on the DMG; this needs investigation.
- Bit 0. In Non-CGB Mode, clearing it blanks the background and window (white), ignores bit 5, and leaves only objects (if bit 1 is set). In CGB Mode it is the master priority: clear, objects are always drawn over the background and window whatever the OAM and map attribute priority bits say; set, the priority rules of the hardware page apply.
$FF41 — STAT: LCD status
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | not named | — | Not in Pan Docs’ bit diagram. |
| 6 | LYC int select | R/W | 1 = the LYC == LY condition raises the STAT interrupt. |
| 5 | Mode 2 int select | R/W | 1 = the mode 2 (OAM scan) condition does. |
| 4 | Mode 1 int select | R/W | 1 = the mode 1 (VBlank) condition does. |
| 3 | Mode 0 int select | R/W | 1 = the mode 0 (HBlank) condition does. |
| 2 | LYC == LY | R | Set while LY equals LYC; updated constantly. |
| 1–0 | PPU mode | R | The current mode 0–3; reads 0 while the PPU is off. |
The same table, the shared “STAT interrupt line” and the write quirk of the monochrome Game Boy are on the memory map page; the mode numbers are on the hardware page.
$FF42 — SCY: Background viewport Y position
R/W, 8 bits (0–255): the Y coordinate of the top-left corner of the visible 160 × 144 area inside the 256 × 256 pixel background map. The bottom edge is (SCY + 143) mod 256, so values past 255 wrap around to the top. It can be written during mode 3 but the change may not show at once: it is re-read at each tile fetch. Models before the CGB-D read Y once per bitplane (a precisely timed write can desynchronise them); the CGB-D and later use one value for both.
$FF43 — SCX: Background viewport X position
R/W, 8 bits: the X coordinate of that corner; the right edge is (SCX + 159) mod 256. It is re-read at each tile fetch except its low 3 bits, which are read only at the start of the line for the initial pixel shift.
$FF44 — LY: LCD Y coordinate
R, 8 bits: the line that is about to be drawn, being drawn or just drawn, 0–153; 144–153 is the VBlank period.
$FF45 — LYC: LY compare
R/W, 8 bits. The console compares it with LY all the time; while they are equal STAT bit 2 is set and, if STAT bit 6 is set, a STAT interrupt is requested.
$FF46 — DMA: OAM DMA source address and start
R/W, 8 bits. Writing starts a copy of 160 bytes into OAM ($FE00–$FE9F) from $XX00–$XX9F, where XX is the value written ($00–$DF). The copy takes 160 M-cycles (640 dots in normal speed, 320 in CGB double speed). While it runs the DMG’s CPU can reach only HRAM ($FF80–$FFFE), so programs run the wait loop from HRAM. On the CGB the cartridge and work RAM are on separate buses, so ROM or SRAM can be used during a copy from work RAM and the other way round, but waiting in HRAM is still advised because calls use the stack. Keep interrupts off during the copy (run it in the VBlank handler or after di), since the handler fetch and return address would clash. During the copy the PPU cannot read OAM properly: in mode 2 most revisions treat every object as off-screen, and in mode 3 it reads whatever word the copy is writing. Most programs start the copy in mode 1 and copy from a buffer in work RAM; a copy mid-frame can show more than 40 objects at the cost of a couple of object-free lines.
$FF47 — BGP: BG palette data
R/W, Non-CGB Mode only. Four 2-bit fields give the shade for each colour ID of the background and window tiles: bits 7–6 for ID 3, 5–4 for ID 2, 3–2 for ID 1, 1–0 for ID 0. Each field: 0 white, 1 light grey, 2 dark grey, 3 black. In CGB Mode the colours come from palette memory instead; in compatibility mode BGP indexes the Color palettes.
$FF48 — OBP0: OBJ palette 0 data
R/W, Non-CGB Mode only. The same layout as BGP, except that bits 1–0 are ignored because colour ID 0 is transparent for objects.
$FF49 — OBP1: OBJ palette 1 data
As OBP0. An object chooses OBP0 or OBP1 with bit 4 of its attributes (OAM).
$FF4A — WY: Window Y position
R/W, 8 bits: the screen Y coordinate of the window’s top-left pixel. The window shows (if enabled) when WY is 0–143 and WX is 0–166; WX = 7, WY = 0 puts it at the top left, covering the background.
$FF4B — WX: Window X position plus 7
R/W, 8 bits: the screen X coordinate of the window’s left edge plus 7. A WX of 0 switches to the window before the initial fine scroll, shifting it left by SCX mod 8 pixels. On monochrome systems WX = 166 triggers a bug: the window covers the whole screen, shifted down one line. The rest of the window’s mid-frame behaviour is on the hardware page.
Game Boy Color and boot ROM
From Pan Docs’ CGB_Registers.md and Palettes.md (and Power_Up_Sequence.md for $FF50). The channel 1–4 output registers PCM12 and PCM34 are in the sound group above. Using any Color register needs the header’s CGB flag ($0143) set: $80 for games that also run on the monochrome Game Boy, $C0 for Color-only games; otherwise the console runs in monochrome compatibility mode. A Color is recognised by A = $11 right after start-up; B bit 0 then tells a Color (clear) from an Advance (set).
$FF4C — KEY0/SYS: CPU mode select
Color only, not officially documented; the boot ROM writes it and it is locked once the boot ROM unmaps itself, so the mode cannot change without a reset. Pan Docs infers the layout from the boot ROM disassembly:
| Bit | Name | Meaning |
|---|---|---|
| 7–4, 1–0 | not named | Not in Pan Docs’ bit diagram. |
| 3 | PGB mode (speculated) | Pan Docs says setting bit 3 is speculated to enable a special “PGB” mode for controlling the LCD externally, “not well researched”. Writing a PGB value ($X8 or $XC) makes OPRI take effect at once, until STOP runs. |
| 2 | DMG compatibility mode | 0 = off (full Color mode, for ordinary Color cartridges), 1 = on (monochrome-only cartridges). |
For a monochrome-only game the boot ROM writes $04; for a Color-compatible one it writes the header’s CGB flag byte itself, which can enable PGB mode.
$FF4D — KEY1/SPD: Prepare speed switch
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | Current speed | R | 0 = normal speed, 1 = double speed. |
| 6–1 | not named | — | Not in Pan Docs’ bit diagram. |
| 0 | Switch armed | R/W | 1 = the switch happens at the next stop. |
Pan Docs’ recommended sequence, when bit 7 is not the wanted speed: write $00 to IE, $30 to P1, $01 to KEY1, then run stop. Bit 0 clears by itself and the console runs at the other speed; it starts in normal speed, and double speed uses more power. Twice as fast in double speed: the CPU (about 2.10 MHz), the timer and divider, the serial port and OAM DMA. Unchanged: the LCD controller, VRAM DMA and all sound timing. After stop the CPU pauses for 2050 M-cycles (8200 T-cycles), DIV does not tick and the video memory locks are frozen: started in mode 0 or 1 the PPU cannot read video memory and draws black; in mode 2 it draws the background but no objects; in mode 3 nothing is affected. Pan Docs leaves open whether interrupts can occur during the pause.
$FF4F — VBK: VRAM bank
R/W, Color only. Bit 0 selects the VRAM bank; the other bits are ignored on write. A read returns the bank number in bit 0 and 1 in all other bits. Bank 1 has tiles at $8000–$97FF like bank 0, and the attributes for the tile maps at $9800–$9FFF (tile maps).
$FF50 — BANK: Boot ROM mapping control
W. Pan Docs gives this register no bit layout and lists it only as a link to the Power-Up Sequence chapter. The boot ROM’s last act is a write to it, which unmaps the boot ROM and hands over at $0100; the value written is $01 (DMG, SGB), $FF (MGB, SGB2) or $11 (Color models), and the A register carries it into the game (power-up). The write also locks KEY0.
$FF51 — HDMA1: VRAM DMA source high
W. With HDMA2 it gives the source address, normally in $0000–$7FF0 or $A000–$DFF0 (Pan Docs notes that Echo RAM, OAM, $FExx, I/O and HRAM have not been tested). A source in VRAM copies garbage.
$FF52 — HDMA2: VRAM DMA source low
W. The low byte of the source; its low 4 bits are ignored (treated as 0).
$FF53 — HDMA3: VRAM DMA destination high
W. With HDMA4 it gives the destination in $8000–$9FF0. Only bits 12–4 of the address count; the upper 3 bits are ignored, so the destination is always in VRAM.
$FF54 — HDMA4: VRAM DMA destination low
W. The low byte of the destination; its low 4 bits are ignored.
$FF55 — HDMA5: VRAM DMA length, mode and start
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | Mode | R/W | Written 0 = general-purpose DMA, 1 = HBlank DMA. Read: 0 = a transfer is active, 1 = not active (or stopped). |
| 6–0 | Length | R/W | Transfer length ÷ $10 minus 1, so $00–$7F give $10–$800 bytes. Read: the remaining length in the same units. |
- General-purpose (bit 7 = 0): all the data is copied at once and the program halts meanwhile; it blindly copies even while the LCD is using VRAM, so use it with the display off, in VBlank, or for short blocks in HBlank. When done HDMA5 reads
$FF. - HBlank (bit 7 = 1):
$10bytes in each HBlank at LY 0–143, none in VBlank, resuming at LY 0. The program runs between blocks. Do not change the VRAM bank (VBK) or the source ROM/RAM bank until it is finished (pause it while switching). Halting the CPU withhalthalts the transfer. It must not be started during HBlank (mode 0). Writing 0 to bit 7 ends an active HBlank transfer: reads then give the blocks left (minus 1) in bits 6–0 and 1 in bit 7; HDMA1–4 are not set to$FF. If the destination address overflows the transfer stops early (the register state then is, in Pan Docs, still to be investigated). - Timing. A block of
$10bytes takes about 8 µs in both speeds (8 M-cycles in normal, 16 “fast” ones in double speed), which allows about 2280 bytes (up to 142.5 tiles) in VBlank. Older bank controllers (MBC1–3) and slower ROMs are not guaranteed to support it.
$FF56 — RP: Infrared communications port
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7–6 | Read enable | R/W | 0 = disabled (bit 1 then reads 1), 3 = enabled. |
| 5–2 | not named | — | Not in Pan Docs’ bit diagram. |
| 1 | Receiving | R | 0 = receiving an IR signal, 1 = normal. |
| 0 | Emitting | R/W | 0 = LED off, 1 = LED on. |
To read, bits 7 and 6 must be set (and bit 0 clear, unless the console’s own signal is wanted). Reset the register to $00 after use to save battery. The receiver adapts to the ambient IR level, so a long LED-on signal soon reads as normal; a Philips TV remote sends 32 pulses of 10 µs on and 17.5 µs off. The Game Boy Advance has no infrared port.
$FF68 — BCPS/BGPI: Background palette index
| Bit | Name | Meaning |
|---|---|---|
| 7 | Auto-increment | 0 = off, 1 = the address increases after each write to BCPD. |
| 6 | not named | Not in Pan Docs’ bit diagram. |
| 5–0 | Address | Which byte of background palette memory BCPD reads or writes (0–63). |
R/W. Unlike BCPD, this register can be used at any time. The Color has 8 background and 8 object palettes of 4 colours; each colour is a little-endian 16-bit word with 5 bits each of red, green and blue (bits 4–0 red, 9–5 green, 14–10 blue; bit 15 is ignored, so filling palette RAM with $FF gives white). Each bank is 64 bytes (2 × 4 × 8), is not in the memory map, and is reached only through the index and data registers. The boot ROM sets all background colours to white.
$FF69 — BCPD/BGPD: Background palette data
R/W. Reads or writes the palette byte at the index in BCPS; a whole colour needs two accesses. During mode 3, when the PPU reads palette memory, writes are ignored and reads give $FF. If auto-increment is on, every write moves the address on by one (63 wraps to 0), even a write that failed; reads never move it.
$FF6A — OCPS/OBPI: OBJ palette index
R/W. The same bits as BCPS, for the separate 64 bytes of object palette memory.
$FF6B — OCPD/OBPD: OBJ palette data
R/W. Works like BCPD. Colour 0 of an object palette is never used (always transparent), so it may hold anything. In Color mode the boot ROM leaves object colours uninitialised except for the first byte of object colour 0 of palette 0 ($00); in monochrome compatibility mode it sets the two object palettes that OBP0 and OBP1 use.
$FF6C — OPRI: Object priority mode
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7–1 | not named | — | Not in Pan Docs’ bit diagram. |
| 0 | Priority mode | R/W | 0 = Color-style priority (by position in OAM), 1 = monochrome-style (by X coordinate). |
The boot ROM sets it after checking the game’s Color compatibility. Pan Docs says it has an effect when a PGB value is written to KEY0 before STOP runs, and takes effect at once; after the boot ROM is unmapped, a write seems to have no (instant) effect, still to be verified.
$FF70 — SVBK/WBK: WRAM bank
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7–3 | not named | — | Not in Pan Docs’ bit diagram. |
| 2–0 | WRAM bank | R/W | Maps that bank (1–7) at $D000–$DFFF; 0 maps bank 1. |
In Color mode there are 32 KiB of work RAM in 8 banks of 4 KiB; bank 0 is always at $C000–$CFFF.
$FF72 — undocumented (Color mode)
Pan Docs lists $FF72 and $FF73 as undocumented registers whose purpose is unknown, “Bits 0–7”: both are fully read/write and start at $00. Pan Docs suggests they can be used to tell a Color from an emulator or a DMG.
$FF73 — undocumented (Color mode)
As $FF72.
$FF74 — undocumented (Color mode)
In Color mode fully readable and writable, starting at $00. In other modes it is read-only and locked at $FF.
$FF75 — undocumented (Color mode)
Only bits 4, 5 and 6 can be written; they start at 0.
Sources
- Raw Pan Docs Markdown (CC0), read 2026-11-19, kept in
samples/gb/sources/pandocswith SHA-256 in the sample README:Joypad_Input.md,Serial_Data_Transfer_(Link_Cable).md,Timer_and_Divider_Registers.md,Interrupts.md,Audio_Registers.md,Audio_details.md,LCDC.md,STAT.md,Scrolling.md,Window.md,OAM_DMA_Transfer.md,Palettes.md,CGB_Registers.md,Power_Up_Sequence.md,Hardware_Reg_List.md. One source only (Pan Docs); none of it was checked against hardware here. - Hardware registers, Audio registers, LCD control, CGB registers – Pan Docs
Not described
Known, not yet covered
- The behaviour behind the bits is on the deeper pages: picture unit in depth (PPU modes, the pixel FIFO, the OAM bug, STAT), sound in depth (mixer, Advance audio, obscure behaviour), timer, HALT and power (Timer Obscure Behaviour), DMA, joypad and serial, palettes and colourisation, Super Game Boy and Game Boy Printer.
- The compatibility palette tables are on the palettes page, from the SameBoy boot ROM source (Pan Docs only links to them), not from Nintendo’s boot ROM.
Unknown
- Bits Pan Docs does not name (listed as “not named” above), and the registers at the addresses its list leaves out.
- What the PGB mode of KEY0 does.