The Game Boy’s processor, the Sharp SM83, addresses 64 KiB. The cartridge answers in two
of the ranges: ROM at $0000–$7FFF and RAM at $A000–$BFFF. The
explorer labels the hardware registers in the disassembly.
Facts on this page are from Pan Docs (Memory Map,
Interrupt sources, Hardware registers).
Address space
| Range | Name | What is there |
|---|---|---|
$0000–$3FFF | ROM bank 00 | The first 16 KiB of the cartridge, always visible. It holds the vectors and the header. |
$4000–$7FFF | ROM bank 01–NN | A switchable 16 KiB bank, chosen by writes to the controller’s registers (see bank controllers). |
$8000–$9FFF | Video RAM | 8 KiB of tile data and tile maps. Two banks on the Game Boy Color, chosen by VBK ($FF4F). |
$A000–$BFFF | External RAM | RAM, a clock or sensor registers on the cartridge, switchable by the controller. |
$C000–$CFFF | Work RAM, bank 0 | 4 KiB of the console’s RAM. |
$D000–$DFFF | Work RAM, bank 1 | 4 KiB; on the Game Boy Color banks 1 to 7, chosen by SVBK ($FF70). |
$E000–$FDFF | Echo RAM | A mirror of $C000–$DDFF; Nintendo asks that it not be used. Details below. |
$FE00–$FE9F | OAM | Object attribute memory: 40 sprites of 4 bytes. |
$FEA0–$FEFF | Not usable | Prohibited by Nintendo; what a read gives depends on the hardware revision (table below). |
$FF00–$FF7F | I/O registers | See below. |
$FF80–$FFFE | High RAM | 127 bytes. |
$FFFF | IE | Interrupt enable. |
Restart and interrupt vectors
The first 256 bytes of ROM bank 0 are the entry points the processor jumps to. A RST n instruction calls
$0000, $0008 … $0038 (eight bytes each). When an interrupt is requested and enabled the
processor calls the vector for its source, also eight bytes apart. The header begins at $0100, so the vectors
must fit before it.
| Address | What calls it | Name in the viewer |
|---|---|---|
$0000–$0038 | RST $00 … RST $38 | rst_00 … rst_38 |
$0040 | V-blank interrupt (IF bit 0) | int_vblank |
$0048 | LCD STAT interrupt (IF bit 1) | int_stat |
$0050 | Timer interrupt (IF bit 2) | int_timer |
$0058 | Serial interrupt (IF bit 3) | int_serial |
$0060 | Joypad interrupt (IF bit 4) | int_joypad |
The names are the viewer’s own labels, not Nintendo’s.
Hardware registers
The disassembly puts these names on the operands of LDH and of loads and stores to
$FF00–$FFFF. The table is Pan Docs’ Hardware Registers list (Hardware_Reg_List.md, read raw 2026-11-19), register by register: its descriptions, its “Readable / Writable” column and its “Models” column. R/W is read/write, R read-only, W write-only; Mixed is Pan Docs’ own word; the list does not define it. It appears to mean that some bits of the register are read-only or write-only (access column) or that the register differs between models (Models column), which is our reading; the bit layout of every register is on the register bit layouts page, the behaviour behind them on video, sound and I/O, and the value each register has when the cartridge starts below. Where Pan Docs gives two names (written “A/B”) both are shown; the first is the one the viewer puts on operands.
| Address | Name | Description (Pan Docs) | Read / write | Models |
|---|---|---|---|---|
$FF00 | P1/JOYP | Joypad | Mixed | All |
$FF01 | SB | Serial transfer data | R/W | All |
$FF02 | SC | Serial transfer control | R/W | Mixed |
$FF04 | DIV | Divider register | R/W | All |
$FF05 | TIMA | Timer counter | R/W | All |
$FF06 | TMA | Timer modulo | R/W | All |
$FF07 | TAC | Timer control | R/W | All |
$FF0F | IF | Interrupt flag | R/W | All |
$FF10 | NR10 | Sound channel 1 sweep | R/W | All |
$FF11 | NR11 | Sound channel 1 length timer & duty cycle | Mixed | All |
$FF12 | NR12 | Sound channel 1 volume & envelope | R/W | All |
$FF13 | NR13 | Sound channel 1 period low | W | All |
$FF14 | NR14 | Sound channel 1 period high & control | Mixed | All |
$FF16 | NR21 | Sound channel 2 length timer & duty cycle | Mixed | All |
$FF17 | NR22 | Sound channel 2 volume & envelope | R/W | All |
$FF18 | NR23 | Sound channel 2 period low | W | All |
$FF19 | NR24 | Sound channel 2 period high & control | Mixed | All |
$FF1A | NR30 | Sound channel 3 DAC enable | R/W | All |
$FF1B | NR31 | Sound channel 3 length timer | W | All |
$FF1C | NR32 | Sound channel 3 output level | R/W | All |
$FF1D | NR33 | Sound channel 3 period low | W | All |
$FF1E | NR34 | Sound channel 3 period high & control | Mixed | All |
$FF20 | NR41 | Sound channel 4 length timer | W | All |
$FF21 | NR42 | Sound channel 4 volume & envelope | R/W | All |
$FF22 | NR43 | Sound channel 4 frequency & randomness | R/W | All |
$FF23 | NR44 | Sound channel 4 control | Mixed | All |
$FF24 | NR50 | Master volume & VIN panning | R/W | All |
$FF25 | NR51 | Sound panning | R/W | All |
$FF26 | NR52 | Sound on/off | Mixed | All |
$FF30–$FF3F | Wave RAM (the viewer’s WAVE0–WAVEF) | Storage for one of the sound channels’ waveform | R/W | All |
$FF40 | LCDC | LCD control | R/W | All |
$FF41 | STAT | LCD status | Mixed | All |
$FF42 | SCY | Viewport Y position | R/W | All |
$FF43 | SCX | Viewport X position | R/W | All |
$FF44 | LY | LCD Y coordinate | R | All |
$FF45 | LYC | LY compare | R/W | All |
$FF46 | DMA | OAM DMA source address & start | R/W | All |
$FF47 | BGP | BG palette data | R/W | DMG |
$FF48 | OBP0 | OBJ palette 0 data | R/W | DMG |
$FF49 | OBP1 | OBJ palette 1 data | R/W | DMG |
$FF4A | WY | Window Y position | R/W | All |
$FF4B | WX | Window X position plus 7 | R/W | All |
$FF4C | KEY0/SYS | CPU mode select (Pan Docs’ I/O range table lists $FF4C–$FF4D as first appearing with the CGB) | Mixed | CGB |
$FF4D | KEY1/SPD | Prepare speed switch | Mixed | CGB |
$FF4F | VBK | VRAM bank | R/W | CGB |
$FF50 | BANK | Boot ROM mapping control. Pan Docs links it to its Power-Up Sequence chapter: the boot ROM writes it as its last act to unmap itself (see below). Pan Docs’ I/O range table lists it as first appearing with the DMG. | W | All |
$FF51 | HDMA1 | VRAM DMA source high | W | CGB |
$FF52 | HDMA2 | VRAM DMA source low | W | CGB |
$FF53 | HDMA3 | VRAM DMA destination high | W | CGB |
$FF54 | HDMA4 | VRAM DMA destination low | W | CGB |
$FF55 | HDMA5 | VRAM DMA length/mode/start | R/W | CGB |
$FF56 | RP | Infrared communications port | Mixed | CGB |
$FF68 | BCPS/BGPI | Background color palette specification / Background palette index | R/W | CGB |
$FF69 | BCPD/BGPD | Background color palette data / Background palette data | R/W | CGB |
$FF6A | OCPS/OBPI | OBJ color palette specification / OBJ palette index | R/W | CGB |
$FF6B | OCPD/OBPD | OBJ color palette data / OBJ palette data | R/W | CGB |
$FF6C | OPRI | Object priority mode | R/W | CGB |
$FF70 | SVBK/WBK | WRAM bank | R/W | CGB |
$FF76 | PCM12 | Audio digital outputs 1 & 2 | R | CGB |
$FF77 | PCM34 | Audio digital outputs 3 & 4 | R | CGB |
$FFFF | IE | Interrupt enable | R/W | All |
Pan Docs’ list has no rows for $FF03, $FF08–$FF0E, $FF15, $FF1F, $FF27–$FF2F, $FF4E, $FF57–$FF67, $FF6D–$FF6F, $FF71–$FF75 and $FF78–$FF7F; this page does not say what those addresses do, except that Pan Docs’ CGB_Registers.md has short “undocumented registers” sections for $FF72–$FF75 (register bit layouts).
I/O ranges and when each appeared
From Pan Docs Memory_Map.md, “I/O Ranges” (raw file read 2026-11-14). “First appeared” is the console model that introduced the range.
| Start | End | First appeared | Purpose |
|---|---|---|---|
$FF00 | DMG | Joypad input | |
$FF01 | $FF02 | DMG | Serial transfer |
$FF04 | $FF07 | DMG | Timer and divider |
$FF0F | DMG | Interrupt flags | |
$FF10 | $FF26 | DMG | Audio |
$FF30 | $FF3F | DMG | Wave pattern RAM |
$FF40 | $FF4B | DMG | LCD control, status, position, scrolling and palettes |
$FF46 | DMG | OAM DMA transfer | |
$FF4C | $FF4D | CGB | KEY0 and KEY1 |
$FF4F | CGB | VRAM bank select | |
$FF50 | DMG | Boot ROM mapping control | |
$FF51 | $FF55 | CGB | VRAM DMA |
$FF56 | CGB | Infrared port | |
$FF68 | $FF6B | CGB | Background and object palettes |
$FF6C | CGB | Object priority mode | |
$FF70 | CGB | WRAM bank select |
The register table above also lists $FF76/$FF77 (PCM12, PCM34, CGB, read-only). They are not in the Memory_Map I/O range table, but they are in Pan Docs’ Hardware Registers list (Hardware_Reg_List.md) and have their own sections, “FF76 — PCM12” and “FF77 — PCM34”, as that list’s links show.
VRAM layout
VRAM is ordinary RAM that the picture unit interprets. Bank 1 exists only on the Game Boy Color, switched with VBK ($FF4F) in CGB mode. Each bank first holds
384 tiles of 16 bytes, thought of as three blocks of 128 tiles. After the tiles each bank holds two 32 × 32 maps (1024 bytes each, at
$9800 and $9C00). The banks differ here: bank 0 holds the tile maps, bank 1 the matching attribute maps (CGB). A tile’s ID is its address / 16 mod 256 (the middle two hex digits).
For a map entry, X = address mod 32 and Y = address / 32 mod 32; bit 10 of the address chooses which of the two maps.
Echo RAM
The range $E000–$FDFF is mapped to work RAM, but only the lower 13 bits of the address lines are connected (the upper bits are set internally by the bank swap register), so the address wraps
around: every read and write there has the same effect as one at $C000–$DDFF. Nintendo prohibits its use, and the behaviour is confirmed on all official hardware.
Some emulators (Pan Docs names VisualBoyAdvance before 1.8) do not emulate it, and on some flash cartridges echo RAM interferes with the cartridge RAM at $A000–$BFFF.
Software can test for correct emulation by writing a value other than $00 or $FF to RAM and checking that it appears in echo RAM and not in cartridge RAM.
The $FEA0–$FEFF range
Prohibited by Nintendo. It returns $FF while OAM is blocked; otherwise the behaviour depends on the hardware revision:
| Hardware | Behaviour |
|---|---|
| DMG, MGB, SGB, SGB2 | Reads during the OAM block trigger OAM corruption (the OAM corruption bug); otherwise reads return $00 |
| CGB revisions 0 to D | A unique RAM area, but masked with a revision-specific value |
| CGB revision E, AGB, AGS, GBP | Returns the high nibble of the lower address byte twice ($xxAx returns $AA, $xxBx returns $BB, and so on) |
The masks, from SameBoy
Pan Docs does not give the “revision-specific value”. The one implementation found that does is SameBoy (Core/memory.c, functions GB_read_oam and write_extra_oam; Expat licence; raw copy in samples/gb/sources/sameboy-src; read 2026-11-19). It is an emulator’s model written from tests on real units; we did not check it on hardware, and no other source for the masks was found (the Mooneye Test Suite build used here, mts-20260714-0944-31510e1, contains no test of this range: its file list has no test with “unusable” in its name; Pan Docs’ own text is above). Reading $FExx with a = the low byte of the address ($A0–$FF), when OAM is not blocked:
| Model (SameBoy name) | Read | Write | Size of the RAM behind it |
|---|---|---|---|
| DMG (B), MGB, SGB, SGB2 | $00 | ignored | none |
| CGB 0, A, B, C | the byte stored at a AND $E7 (the address with bits 3 and 4 cleared: addr &= ~$18) | stored at the same masked address | addresses that differ only in bits 3 and 4 share one byte, so each 32-byte block holds 8 distinct bytes and the whole range 24 (our arithmetic from the mask) |
| CGB D | addresses $C0–$FF are forced to $F0–$FF (addr |= $F0), so $FEC0–$FEFF all read the 16 bytes $FEF0–$FEFF; $FEA0–$FEBF are 32 separate bytes | stored the same way | 48 bytes |
| CGB E, AGB A, GBP A | the high nibble of a twice ((a & $F0) | (a >> 4)) | ignored | none; agrees with Pan Docs’ text above |
While OAM is blocked every model returns $FF (and the DMG family corrupts OAM, see the picture unit page). SameBoy does not claim these masks are certain for every unit (its source marks some of the related OAM-bug behaviour “probably instance specific”). So the revision-specific values are now stated for the models SameBoy covers, from one source.
Interrupt source details
- V-blank (
$40) is requested each time the console enters V-blank (mode 1, LY = 144): about 59.7 times a second on a handheld (DMG or CGB) or the Game Boy Player, and about 61.1 times a second on a Super Game Boy. VRAM is free to use during the period, which lasts roughly 1.1 ms. - STAT (
$48): the sources (modes 0 to 2 and LYC = LY) are ORed, if their enable bit is on, into one shared “STAT interrupt line” (inactive low, active high). The interrupt is requested on a rising edge of that line. If a source goes high while the line is already high from another source there is no new edge and no interrupt (“STAT blocking”): with interrupts enabled for two consecutive modes such as 0 and 1, none arrives for the second. - Timer (
$50) is requested when TIMA overflows past$FF. - Serial (
$58) is requested when a transfer completes: eight serial clock cycles after SC bit 7 starts it, the incoming data is in SB. - Joypad (
$60) is requested when any of P1 bits 0–3 goes from high to low, which a button press does if its group is selected by bit 4 or 5; switch bounce usually produces several such transitions. If both groups are selected and a bit is already held low, pressing the matching button changes nothing, so its main use is ending STOP standby. Pan Docs says the GBA SP seems not to bounce.
Using the STAT interrupt
Pan Docs (Interrupt_Sources.md): one very popular use is to tell the program when the video hardware is about to redraw a given LCD line, which is useful for dynamically controlling the scroll registers SCX/SCY ($FF43/$FF42) to perform special video effects. Example application: set LYC to WY, enable the LY=LYC interrupt, and have the handler disable objects. That can be used when the window is a text box at the bottom of the screen and objects (sprites) should be hidden by it.
The STAT register
STAT ($FF41), from Pan Docs’ STAT.md. Bits 6 to 3 select what raises the STAT interrupt; bits 2 to 0 report the state:
| Bit | Name | Access | Meaning |
|---|---|---|---|
| 7 | — | — | Not named in the bit diagram. |
| 6 | LYC int select | Read/write | If set, selects the LYC == LY condition for the STAT interrupt. |
| 5 | Mode 2 int select | Read/write | If set, selects the Mode 2 condition. |
| 4 | Mode 1 int select | Read/write | If set, selects the Mode 1 condition. |
| 3 | Mode 0 int select | Read/write | If set, selects the Mode 0 condition. |
| 2 | LYC == LY | Read-only | Set when LY contains the same value as LYC; constantly updated. |
| 1–0 | PPU mode | Read-only | The PPU’s current status; reports 0 instead when the PPU is disabled (LCDC bit 7). |
LY ($FF44, read-only) indicates the current horizontal line, which might be about to be drawn, being drawn, or just been drawn; it holds 0 to 153, with 144 to 153 indicating V-blank. The console constantly compares LYC and LY; when they are equal the “LYC=LY” flag in STAT is set and, if enabled, a STAT interrupt is requested. Quirk (Pan Docs): on the monochrome Game Boy, writing STAT (even $00) during OAM scan, HBlank, VBlank or LY=LYC can trigger the interrupt, as if $FF were written for one M-cycle and then the value; the Color in DMG mode does not have it, so two games that rely on it (Road Rash, Xerd no Densetsu) do not run on a Color. The meanings of the PPU mode numbers and LCDC bits are in other Pan Docs chapters not copied here.
Detecting Super Game Boy hardware
Unlocking SGB functions needs the SGB flag at $0146 set to $03 and the old licensee code at $014B set to $33 (see the header page). Hardware is detected from the registers directly after start-up: C = $14 means SGB or SGB2, and A tells those apart. DMG and MGB share their initial A with SGB and SGB2 respectively.
| Console | A | C |
|---|---|---|
| DMG | $01 | $13 |
| SGB | $01 | $14 |
| MGB | $FF | $13 |
| SGB2 | $FF | $14 |
| CGB | $11 | $00 |
| AGB | $11 | $00 |
SGB2 has no extra features needing separate detection (Tetris DX shows a different border on it), and only the SGB2 has a link port. The older method sends the MLT_REQ command and sees whether the joypad IDs change (a plain Game Boy keeps returning $0F); it is slower and works only when SGB functions are unlocked by the header.
Power-up: the boot ROM and the CPU registers at $0100
From Pan Docs’ Power-Up Sequence chapter (Power_Up_Sequence.md, raw, read 2026-11-19). The processor starts at $0000, not $0100: a boot ROM inside the CPU is mapped over the cartridge ROM at first, plays the start-up animation and then hands over at $0100, which is why the start address is usually given as $0100. Pan Docs lists nine known official boot ROMs:
| Name | Size (bytes) | Notes (Pan Docs) |
|---|---|---|
| DMG0 | 256 | Blinks on failed checks, no ® |
| DMG | 256 | |
| MGB | 256 | One-byte difference to DMG |
| SGB | 256 | Only forwards logo to SGB BIOS, performs no checks |
| SGB2 | 256 | Same difference to SGB than between MGB and DMG |
| CGB0 | 256 + 1792 | Does not init wave RAM |
| CGB | 256 + 1792 | Split in two parts, with the cartridge header in the middle |
| AGB0 | 256 + 1792 | Increments B register for GBA identification |
| AGB | 256 + 1792 | Fixes “logo TOCTTOU” |
- Monochrome models (DMG0, DMG, MGB). The boot ROM reads the logo from the header, unpacks it into VRAM and scrolls it down; with no cartridge the reads return
$FF, so a black box scrolls. After the scroll it plays the “ba-ding!” sound, reads the logo again and compares it with its own copy, then computes the header checksum and compares it with the one in the header. If either check fails it locks up. Finally it writes theBANKregister at$FF50, which unmaps the boot ROM; theldh [$FF50], ainstruction sits at$00FE(two bytes), so the first instruction from the cartridge is at$0100. The A register passes through: the DMG writes$01, the MGB$FF(the only difference between them). The DMG0 does both checks before displaying anything, blinks white/black on failure, and lacks the ® next to the logo. - Super Game Boy (SGB, SGB2). No header checks in the boot ROM: it sets up the logo, then sends the whole header to the SGB BIOS using the standard packet procedure with packet header bytes
$F1,$F3,$F5,$F7,$F9,$FB, in that order (otherwise invalid IDs). The BIOS on the SNES verifies the logo and header checksum itself and, if they fail, locks up by repeatedly resetting the SGB CPU. SGB and SGB2 write$01and$FFto$FF50, their only difference. The time taken depends on the header (a set bit is one cycle faster than a reset bit; 4 VBlanks are waited after each packet). - Color models (CGB0, CGB, AGB0, AGB). 2048 bytes in two parts,
$0000–$00FFand$0200–$08FF, so that the header at$0100–$014Fstays readable. They unpack the logo to VRAM, copy it to a buffer in HRAM and unpack a smaller one below it; they set up compatibility palettes and play the animation. If bit 7 of the CGB flag ($0143) is reset (monochrome-only game) the user may pick a palette (each choice delays the end of the animation by 30 frames). The logo is then checked from the HRAM buffer and the header checksum verified; for unknown reasons only the first half of the logo is checked. Then the BG palettes fade to white and the hardware is set to compatibility mode: if the CGB flag indicates CGB compatibility it is written to KEY0 ($FF4C), otherwise$04is written to KEY0 (DMG compatibility mode in the CPU),$01to OPRI ($FF6C, DMG object priority) and the compatibility palettes are written. The last act is writing$11to$FF50while handing over. The CGB0 differs only slightly and does not init wave RAM (a different title music in R-Type).
The compatibility palette is chosen from the header (Pan Docs’ summary of the algorithm): the licensee must be Nintendo (old licensee $01, or $33 with new licensee "01"), else palette ID $00; the 16 title bytes are summed and looked up in a table (the table itself is in the boot ROM and is not on this page; if not found, ID $00); if the index is above 64 the title’s fourth letter selects a row of a second table and 14 times the row index is added. For IDs $43 and $58 the logo’s tilemap is also written.
CPU registers when the cartridge starts (PC = $0100)
Pan Docs says to rely on as little of this as possible, that some of it is volatile and may contain errors, and that WRAM and HRAM are random at power-up. “?” is Pan Docs’ unknown. Monochrome models:
| Register | DMG0 | DMG | MGB | SGB | SGB2 |
|---|---|---|---|---|---|
| A | $01 | $01 | $FF | $01 | $FF |
| F | Z=0 N=0 H=0 C=0 | Z=1 N=0 H=? C=?a | Z=1 N=0 H=? C=?a | Z=0 N=0 H=0 C=0 | Z=0 N=0 H=0 C=0 |
| B | $FF | $00 | $00 | $00 | $00 |
| C | $13 | $13 | $13 | $14 | $14 |
| D | $00 | $00 | $00 | $00 | $00 |
| E | $C1 | $D8 | $D8 | $00 | $00 |
| H | $84 | $01 | $01 | $C0 | $C0 |
| L | $03 | $4D | $4D | $60 | $60 |
| PC | $0100 | $0100 | $0100 | $0100 | $0100 |
| SP | $FFFE | $FFFE | $FFFE | $FFFE | $FFFE |
a If the header checksum ($014D) is $00, the carry and half-carry flags are clear; otherwise both are set.
Color models (“DMG mode” is a monochrome game run on the Color or Advance):
| Register | CGB (DMG mode) | AGB (DMG mode) | CGB | AGB |
|---|---|---|---|---|
| A | $11 | $11 | $11 | $11 |
| F | Z=1 N=0 H=0 C=0 | Z=? N=0 H=? C=0b | Z=1 N=0 H=0 C=0 | Z=0 N=0 H=0 C=0 |
| B | ??c | ?? + 1c | $00 | $01 |
| C | $00 | $00 | $00 | $00 |
| D | $00 | $00 | $FF | $FF |
| E | $08 | $08 | $56 | $56 |
| H | $??d | $??d | $00 | $00 |
| L | $??d | $??d | $0D | $0D |
| PC | $0100 | $0100 | $0100 | $0100 |
| SP | $FFFE | $FFFE | $FFFE | $FFFE |
b To get the AGB flags, take the B register you would have got on the CGB (note c) and inc it (an inc b is the last operation to touch the flags); the carry and direction flags are always clear. c If the old licensee code is $01, or $33 with the new licensee code "01" ($30 $31), B is the sum of all 16 title bytes; otherwise $00. On the AGB that value is increased by 1. d Two cases: if B is $43 or $58 (CGB) or $44 or $59 (AGB), HL = $991A; otherwise HL = $007C.
Pan Docs says the tables come from analysis of the boot ROM disassemblies, confirmed with Mooneye-GB tests (boot_regs for DMG0, DMG, MGB, SGB, SGB2, CGB and A). The A and C values here are the ones the hardware-detection table above uses. These tables were compared register by register with the eleven Mooneye boot_regs sources on 2026-11-19; the result is in the next paragraph. Not checked against hardware.
Checked against the Mooneye test sources (boot_regs-dmg0, -dmgABC, -mgb, -sgb, -sgb2, -cgb and -A, the Advance test; there is no file called boot_regs-agb; each file asserts A, F, B, C, D, E, H, L and SP; kept in samples/gb/sources/mooneye). Agreements: DMG0 A $01, F $00, B $FF, C $13, D $00, E $C1, H $84, L $03; DMG A $01, F $B0, B $00, C $13, D $00, E $D8, H $01, L $4D; MGB the same with A $FF; SGB A $01, F $00, B $00, C $14, D $00, E $00, H $C0, L $60; SGB2 the same with A $FF; SP is $FFFE in all of them. Mooneye’s F $B0 for DMG and MGB is Z=1 N=0 H=1 C=1, which fits Pan Docs’ rule (header checksum not $00: both set). The boot_regs-cgb values (A $11, F $80, B $00, C $00, D $00, E $08, H $00, L $7C) equal the column “CGB (DMG mode)” (Z=1 N=0 H=0 C=0, B $00, HL $007C), and boot_regs-A (A $11, F $00, B $01, C $00, D $00, E $08, H $00, L $7C) equals “AGB (DMG mode)” (B = $00 + 1, and inc b then leaves Z=0 H=0 N=0 C=0). Differences: none in any value Mooneye checks. What Mooneye does not check: PC; the CGB and AGB columns in Color mode (D $FF, E $56, H $00, L $0D); the title-sum cases of B, the HL $991A cases and the header-checksum cases of the DMG flags (the test ROMs fix one header); CGB0 and AGB0, which Pan Docs does not list either. In the Mooneye files the pass lists are: boot_regs-cgb CGB only, boot_regs-A AGB and AGS.
Hardware registers when the cartridge starts
From the “Hardware registers” table of Power_Up_Sequence.md (raw, read 2026-11-19), every row and every model column. The values are those at PC = $0100, which matters for timing-sensitive registers. A column covers the models named: “DMG / MGB”, “SGB / SGB2”, “CGB / AGB”. “??” is Pan Docs’ unknown, “---” means the register does not exist on that model. Pan Docs prints the names BGPI, BGPD, OGPI and OGPD in this table; they are the registers this page calls BCPS/BGPI, BCPD/BGPD, OCPS/OBPI and OCPD/OBPD. Register names link to the bit layouts.
| Name | Address | DMG0 | DMG / MGB | SGB / SGB2 | CGB / AGB |
|---|---|---|---|---|---|
| P1 | $FF00 | $CF | $CF | $C7 or $CF | $C7 or $CF |
| SB | $FF01 | $00 | $00 | $00 | $00 |
| SC | $FF02 | $7E | $7E | $7E | $7F |
| DIV | $FF04 | $18 | $AB | ??1 | ??2 |
| TIMA | $FF05 | $00 | $00 | $00 | $00 |
| TMA | $FF06 | $00 | $00 | $00 | $00 |
| TAC | $FF07 | $F8 | $F8 | $F8 | $F8 |
| IF | $FF0F | $E1 | $E1 | $E1 | $E1 |
| NR10 | $FF10 | $80 | $80 | $80 | $80 |
| NR11 | $FF11 | $BF | $BF | $BF | $BF |
| NR12 | $FF12 | $F3 | $F3 | $F3 | $F3 |
| NR13 | $FF13 | $FF | $FF | $FF | $FF |
| NR14 | $FF14 | $BF | $BF | $BF | $BF |
| NR21 | $FF16 | $3F | $3F | $3F | $3F |
| NR22 | $FF17 | $00 | $00 | $00 | $00 |
| NR23 | $FF18 | $FF | $FF | $FF | $FF |
| NR24 | $FF19 | $BF | $BF | $BF | $BF |
| NR30 | $FF1A | $7F | $7F | $7F | $7F |
| NR31 | $FF1B | $FF | $FF | $FF | $FF |
| NR32 | $FF1C | $9F | $9F | $9F | $9F |
| NR33 | $FF1D | $FF | $FF | $FF | $FF |
| NR34 | $FF1E | $BF | $BF | $BF | $BF |
| NR41 | $FF20 | $FF | $FF | $FF | $FF |
| NR42 | $FF21 | $00 | $00 | $00 | $00 |
| NR43 | $FF22 | $00 | $00 | $00 | $00 |
| NR44 | $FF23 | $BF | $BF | $BF | $BF |
| NR50 | $FF24 | $77 | $77 | $77 | $77 |
| NR51 | $FF25 | $F3 | $F3 | $F3 | $F3 |
| NR52 | $FF26 | $F1 | $F1 | $F0 | $F1 |
| LCDC | $FF40 | $91 | $91 | $91 | $91 |
| STAT | $FF41 | $81 | $85 | ??1 | ??2 |
| SCY | $FF42 | $00 | $00 | $00 | $00 |
| SCX | $FF43 | $00 | $00 | $00 | $00 |
| LY | $FF44 | $91 | $00 | ??1 | ??2 |
| LYC | $FF45 | $00 | $00 | $00 | $00 |
| DMA | $FF46 | $FF | $FF | $FF | $00 |
| BGP | $FF47 | $FC | $FC | $FC | $FC |
| OBP0 | $FF48 | ??3 | ??3 | ??3 | ??3 |
| OBP1 | $FF49 | ??3 | ??3 | ??3 | ??3 |
| WY | $FF4A | $00 | $00 | $00 | $00 |
| WX | $FF4B | $00 | $00 | $00 | $00 |
| KEY0 | $FF4C | --- | --- | --- | ??1 |
| KEY1 | $FF4D | --- | --- | --- | $7E5 |
| VBK | $FF4F | --- | --- | --- | $FE5 |
| BANK | $FF50 | --- | --- | --- | --- |
| HDMA1 | $FF51 | --- | --- | --- | $FF5 |
| HDMA2 | $FF52 | --- | --- | --- | $FF5 |
| HDMA3 | $FF53 | --- | --- | --- | $FF5 |
| HDMA4 | $FF54 | --- | --- | --- | $FF5 |
| HDMA5 | $FF55 | --- | --- | --- | $FF5 |
| RP | $FF56 | --- | --- | --- | $3E5 |
| BCPS/BGPI | $FF68 | --- | --- | --- | ??4 |
| BCPD/BGPD | $FF69 | --- | --- | --- | ??4 |
| OCPS/OBPI (Pan Docs: OGPI) | $FF6A | --- | --- | --- | ??4 |
| OCPD/OBPD (Pan Docs: OGPD) | $FF6B | --- | --- | --- | ??4 |
| SVBK | $FF70 | --- | --- | --- | $F85 |
| IE | $FFFF | $00 | $00 | $00 | $00 |
- Because this boot ROM’s duration depends on the header’s contents, no general answer can be given; the value should be the same for a given header.
- Because this boot ROM’s duration depends on the header’s contents (and, in compatibility mode, on the player’s inputs), no answer can be given. Pan Docs: just do not rely on these.
- These registers are left entirely uninitialised. The value is most often
$00or$FF, but it is not reliable, especially if the program runs after a flash cartridge’s or multicart’s menu. Always set them before showing objects for the first time. - These depend on whether compatibility mode is enabled.
- Pan Docs’ sentence: these registers exist only in CGB Mode and read
$FFin Non-CGB Mode, and its table gives the values for the other mode. The two sources do not agree for every register, so read it register by register. Pan Docs’ own table: KEY1$7E, VBK$FE, HDMA1 to HDMA5$FF, RP$3E, SVBK$F8. Mooneye’sboot_hwio-C(a test that passes on the Color and Advance models; I take it to run in Non-CGB Mode, which its source does not say in words) expects$FFat KEY0 ($FF4C), KEY1 ($FF4D), HDMA1 to HDMA5 ($FF51–$FF55), RP ($FF56) and SVBK ($FF70), which agrees with the sentence but not with Pan Docs’ KEY1, RP and SVBK values; and it expects$FEat VBK ($FF4F), which agrees with Pan Docs’ table and not with the sentence. Nothing in these two sources reads$00at OBP0 or OBP1 (see the comparison below). A third source settles the disagreement for these registers (gb-leftovers round, SameBoyCore/memory.c,read_high_memory, raw copy insamples/gb/sources/sameboy-src; an emulator’s model, not a hardware measurement). SameBoy has one flag,cgb_mode, that is true when the game’s header asks for Color mode. In that mode it returns KEY1(register & $7F) | $7E($7Eat normal speed,$FEin double speed), RP(register & $C1) | $2E | $10($3Ewith the register 0;$2Eon a CGB E, which omits the$10) and SVBK the stored value ORed with$F8($F8for bank 0), HDMA5 its own value; and in the other mode (a monochrome game on a Color) it returns$FFfor KEY1, RP, SVBK and HDMA5, but VBK as bank |$FE($FE) in both modes. That model reproduces exactly Pan Docs’ column ($7E,$3E,$F8, VBK$FE) as the Color-mode values and Mooneye’sboot_hwio-Cexpectations ($FF,$FF,$FF, VBK$FE) as the compatibility-mode values, so the two sources are consistent if the Mooneye test ROM runs in compatibility mode, which is what a test ROM without a Color flag does (the ROM’s header flag was not checked here: our reading). This is the best reconciliation found and the page now states it as such; it does not prove what a real Color does, and the P1 and SC differences listed in the comparison below are not explained by it.
Pan Docs says the table comes from the Mooneye-GB tests boot_hwio-dmg0, boot_hwio-dmgABCmgb, boot_hwio-S and boot_hwio-C, plus some extra testing. Every cell was compared with those four sources on 2026-11-19 (next subsection). Not checked against hardware.
The power-on table compared with the Mooneye boot_hwio tests
Each boot_hwio source (kept in samples/gb/sources/mooneye) holds a table of 16 rows of 8 registers from $FF00 to $FF7F. Every row has a bit mask that says which of its eight registers the test really compares (the first register is the top bit), and eight expected values, and the test also compares $FFFF (IE) with $00 in boot_hwio-dmg0, -dmgABCmgb and -S. The tests skip wave RAM ($FF30–$FF3F); boot_hwio-S and -C also skip DIV, LCDC, STAT, LY and DMA, and all four skip OBP0 and OBP1 and DMA. The values the tables hold for a register the mask skips are not readings of the hardware: they are not checked by anything. The test files name the models that pass: boot_hwio-dmg0 DMG0, -dmgABCmgb DMG ABC and MGB, -S SGB and SGB2, -C CGB, AGB and AGS. Every cell of the table above was compared with these four sources:
| Register | Pan Docs (table above) | Mooneye | Result |
|---|---|---|---|
| SB, TIMA, TMA, TAC, IF, NR10 to NR52, BGP, SCY, SCX, LYC, WY, WX, IE, LCDC (DMG0 and DMG/MGB) | as in the table | the same values; NR52 $F0 on SGB and $F1 elsewhere; LCDC $91; IE $00 where tested | agree |
P1 $FF00 | DMG0 and DMG/MGB $CF; SGB/SGB2 and CGB/AGB $C7 or $CF | $CF in boot_hwio-dmg0 and -dmgABCmgb; $FF in -S and -C | agree on DMG0 and DMG/MGB; differ on SGB and CGB/AGB (neither source gives the reason) |
SC $FF02 | CGB/AGB $7F, others $7E | $7E in all four, including -C | agree except CGB/AGB, where Mooneye’s -C reads $7E |
DIV $FF04 | DMG0 $18, DMG/MGB $AB, others unknown | $19 (-dmg0), $AD (-dmgABCmgb); skipped in -S and -C | differ by the time the test code has run (Pan Docs’ values are for PC = $0100); a timing difference |
STAT $FF41 | DMG0 $81, DMG/MGB $85 | $83 (-dmg0), $80 (-dmgABCmgb); skipped in -S and -C | timing difference, as DIV |
LY $FF44 | DMG0 $91, DMG/MGB $00 | $01 (-dmg0), $0A (-dmgABCmgb); skipped in -S and -C | timing difference, as DIV |
DMA $FF46 | DMG0, DMG/MGB, SGB/SGB2 $FF; CGB/AGB $00 | the tables list $FF (DMG0, DMG ABC, SGB) and $00 (Color) but the mask skips this register in all four tests | not checked by Mooneye (Pan Docs says “plus some extra testing”) |
OBP0, OBP1 $FF48, $FF49 | left uninitialised (footnote 3) | the tables list $FF (DMG0, DMG ABC, SGB) and $00 (-C) but the mask skips both in all four tests | not checked; so a $00 reading at OBP0 and OBP1 on the Color is not evidence in the Mooneye sources, and Pan Docs’ “most often $00 or $FF” stands |
KEY0 $FF4C | CGB/AGB unknown | -C expects $FF; the three DMG-family tests expect $FF too | fills the unknown for a test ROM on the Color |
KEY1 $FF4D | CGB/AGB $7E | -C expects $FF | differ (see footnote 5) |
VBK $FF4F | CGB/AGB $FE | -C expects $FE | agree; contradicts the sentence of footnote 5 |
BANK $FF50 | not present (---) | all four tests expect $FF | nothing to compare |
HDMA1 to HDMA5 $FF51–$FF55 | CGB/AGB $FF | -C expects $FF | agree |
RP $FF56 | CGB/AGB $3E | -C expects $FF | differ (see footnote 5) |
BCPS, BCPD, OCPS, OCPD $FF68–$FF6B | depend on compatibility mode (footnote 4) | -C expects $C8, $FF, $D0, $FF | fills the unknown for a test ROM on the Color (the index registers read back with bit 7, the auto-increment flag, set and the unused bit 6 reading 1: $C8 is index 8, $D0 is index $10) |
SVBK $FF70 | CGB/AGB $F8 | -C expects $FF | differ (see footnote 5) |
$FF72, $FF73, $FF74, $FF75, $FF76, $FF77 | not in the table | -C expects $00, $00, $FF, $8F, $00, $00; the other three tests expect $FF for all | extra facts; PCM12 and PCM34 read $00 at start in -C |
every other address of $FF00–$FF7F the table does not list (for example $FF03, $FF08–$FF0E, $FF15, $FF1F, $FF27–$FF2F, $FF4E, $FF57–$FF67, $FF6C–$FF6F, $FF78–$FF7F) | not in the table | expected $FF in all four tests | extra facts |
Summary: for the values the Mooneye tests really compare, the table agrees with them in the DMG0, DMG/MGB and SGB/SGB2 columns except P1 on SGB/SGB2 and the timing registers (DIV, STAT, LY); on the CGB/AGB column it differs at P1, SC, KEY1, RP and SVBK if Mooneye’s test ROM runs in Non-CGB Mode, and agrees at VBK and HDMA1 to HDMA5. Two readings are stated side by side in footnote 5 because the sources differ; the page does not choose.
More from the Power-Up Sequence chapter
All of this is from Power_Up_Sequence.md (raw, read 2026-11-19), in our words; the section it comes from is named in each item.
- Common remarks (“Console state after boot ROM hand-off”). Work RAM and high RAM are random at power-up, in patterns that differ between models and even with temperature. Switching off and on again has been shown to carry RAM over from one game to another, so a program should not rely on its contents. Emulators differ here: some fill with a constant (
$00or$FF), some randomise, some copy hardware patterns; Pan Docs suggests turning on an emulator’s “break on uninitialised RAM read” option. - Cartridge RAM (same section). Cartridge RAM usually holds random data when first powered on, so Pan Docs strongly advises a game to store a long enough known byte sequence at a fixed place in it and check for that sequence before it trusts any saved data.
- Stadium 2 boot ROM (“Stadium 2”). The “GB Tower” emulator in Pokémon Stadium 2 contains an unusual boot ROM, at offset
$015995F0in the US release and only 1008 bytes long; its purpose is unknown. It sets up roughly as a Color boot ROM does but writes to$FF50very early, followed by a lock-up loop, and it carries a valid header that is mostly blank except for the logo, the compatibility flag (dual compatibility) and the header checksum. - CGB0 extra writes (“CGB0”). Besides not initialising wave RAM, the CGB0 boot ROM copies some other variables into work RAM locations that nothing reads; Pan Docs speculates these are debugging leftovers.
- Scrapped palette switching menu (“Scrapped palette switching menu”). The Color’s CPU still contains remnants of a function meant to let the player change the Color palettes while a game runs; Pan Docs says no more than that.
- PGB mode (“Behavior”). When the header’s CGB flag byte is written straight to KEY0, this can enable what Pan Docs calls “PGB mode”; the register page says what is known (KEY0).
- Choosing a palette (“Behavior”, “Compatibility palettes”). While the logo animation runs on a monochrome-only game (CGB flag bit 7 clear), the player can override the automatic palette with certain button combinations, each choice delaying the end of the animation by 30 frames. Some choices equal automatic ones; others are unique. The boot ROM’s palette-ID algorithm is summarised above; Pan Docs links the checksum and fourth-letter tables, and the palette lists, to the boot ROM source and a third-party page, which are not copied here. In compatibility mode the Color palettes are still used: the background uses palette 0 (the attribute map is all zeros) and objects use palette 0 or 1 by bit 4 of their attributes, with BGP, OBP0 and OBP1 indexing those palettes instead of grey shades.
Why the logo is checked: legal background and bypass
From the “Logo check” section of Power_Up_Sequence.md (raw, read 2026-11-19), in our words. Pan Docs marks the legal part as advice that “is not legal advice”: see a lawyer if it matters, for example for a commercial release with logos on the box.
- Purpose. Nintendo did not need to approve every game for the hardware, and chose not to use a hardware lock like the NES’s lockout chip, probably because of cost or power use. Instead the boot ROM insists that every ROM carries an encoded copy of the Nintendo logo, which it shows at start-up. The plan was to threaten makers of unlicensed games with trademark claims.
- Legal status. Pan Docs notes that Sega v. Accolade held (in the US) that using a trademarked logo is acceptable when it is necessary to run programs on the console, so homebrew developers are not at risk from it. To state that a game is not licensed, a program can add text to the logo screen once the boot ROM has handed over.
- Bypass: timing trick. The logo is read twice, once to draw it and once to check it. Cartridge hardware can return a different logo on the second read (a custom mapper, or a capacitor holding some address lines so reads go to another ROM region); this is hard because the order and timing of the reads differ between boot ROMs, and the later AGB boot ROM fixed it.
- Bypass: half logo. Only on the Color and Advance: the boot ROM copies the whole logo to HRAM but compares only the first half, so a logo whose top half is right passes there. The later CGB-AGB boot ROM did not fix this although it fixed the timing trick.
Console specifications
From Pan Docs’ Specifications.md (raw, read 2026-11-19). The whole table is given.
| Game Boy (DMG) | Pocket (MGB) | Super Game Boy (SGB) | Game Boy Color (CGB) | |
|---|---|---|---|---|
| CPU | 8-bit 8080-like Sharp CPU (speculated to be an SM83 core) | |||
| Master clock | 4.194304 MHz | Depends on revision | Up to 8.388608 MHz | |
| System clock | 1/4 of the master clock | |||
| Work RAM | 8 KiB | 32 KiB (4 + 7 × 4 KiB); the DMG value in compatibility mode | ||
| Video RAM | 8 KiB | 16 KiB (2 × 8 KiB); the DMG value in compatibility mode | ||
| Screen | LCD 4.7 × 4.3 cm | LCD 4.8 × 4.4 cm | CRT TV | TFT 4.4 × 4 cm |
| Resolution | 160 × 144 | 160 × 144 within a 256 × 224 border | 160 × 144 | |
| Objects (“sprites”) | 8 × 8 or 8 × 16; at most 40 per screen, 10 per line | |||
| Palettes | BG: 1 × 4, OBJ: 2 × 3 | BG/OBJ: 1 + 4 × 3, border: 4 × 15 | BG: 8 × 4, OBJ: 8 × 3; the DMG value in compatibility mode | |
| Colours | 4 shades of green | 4 shades of grey | 32768 colours (15-bit RGB) | |
| Horizontal sync | 9.198 kHz | complicateda | 9.198 kHz | |
| Vertical sync | 59.73 Hz | complicateda | 59.73 Hz | |
| Sound | 4 channels, stereo | 4 GB channels + SNES audio | 4 channels, stereo | |
| Power | DC 6 V, 0.7 W | DC 3 V, 0.7 W | supplied by the SNES | DC 3 V, 0.6 W |
a The Super Game Boy runs two consoles, a Game Boy inside the cartridge and the SNES itself. The SNES captures and shows the Game Boy’s picture, but the two frame rates do not quite match, so frames are duplicated or dropped. The Game Boy side’s vertical sync follows its CPU clock, with the same ratio as the handhelds.
Pan Docs adds that real DMG units tend to run about 50–70 PPM slow (the accuracy of other models is unknown), and that SGB1 derives its CPU clock from the SNES clock (slightly different on NTSC and PAL) while the SGB2 uses a clock inside the cartridge. Left out: nothing of this table; its footnote about the compatibility-mode values is the “DMG value in compatibility mode” wording above.
Sources
- Raw Pan Docs Markdown (CC0):
Memory_Map.md,Interrupt_Sources.md,SGB_Unlocking.md(read 2026-11-14) andHardware_Reg_List.md,Power_Up_Sequence.md,Specifications.md,STAT.md(read 2026-11-19); all kept in the site’s sample sources, with SHA-256 in the sample README. The register table, STAT text, power-up section and specifications above are from the 2026-11-19 files, and the I/O ranges, VRAM layout, echo RAM,$FEA0range, interrupt details and SGB detection from the earlier ones, all with one source only (Pan Docs). - Memory Map – Pan Docs
- Interrupt sources – Pan Docs: the five vectors
- Hardware register list – Pan Docs
Not described
Known, not yet covered
- The boot ROMs’ compatibility palette tables (checksum and fourth-letter tables and the palette colours; Pan Docs only links to them) are on the palettes and colourisation page, taken from the SameBoy boot ROM source, not from Nintendo’s. The OAM corruption bug is on picture unit in depth, and the Super Game Boy commands on Super Game Boy. The bit layouts, the video, sound, timer, joypad and serial chapters are on the register bit layouts, video, sound and I/O and the pages linked from it.
- A second source: the register names and values on this page rest on Pan Docs, checked against the Mooneye tests (power-on tables) and, for the Color-mode column and the
$FEA0range, SameBoy’s source (see the footnote and the masks); nothing is checked on hardware by us. - The “fairly complex” palette ID mechanism that Pan Docs does not detail is written on the palettes and colourisation page from the SameBoy boot ROM source (algorithm, tables, the 94-entry checksum list).
Unknown
- Whether SameBoy’s
$FEA0–$FEFFmasks (see above) are right for every unit of each Color revision: one source, an emulator’s model; no hardware check and no Mooneye test for this range. - What the addresses missing from Pan Docs’ register list do (for example
$FF03,$FF4E,$FF57–$FF67): the Mooneyeboot_hwiotests expect$FFfrom all of them in all four models’ tests (the “every other address” row of the table), so they read$FFat power-on on the units those tests pass on; whether they are write-sensitive is not stated by any source read. Pan Docs’ Memory_Map I/O ranges table does not cover them either. - The Color-mode versus compatibility-mode values of P1 and SC at power-on: the SameBoy reconciliation in footnote 5 explains KEY1, RP, SVBK, HDMA and VBK but not these two, and no hardware was available.