The Cartridge Header

Each cartridge contains a header, located at the address range $0100$014F. The cartridge header provides the following information about the game itself and the hardware it expects to run on:

0100-0103 — Entry point

After displaying the Nintendo logo, the built-in boot ROM jumps to the address $0100, which should then jump to the actual main program in the cartridge. Most commercial games fill this 4-byte area with a nop instruction followed by a jp $0150.

This area contains a bitmap image that is displayed when the Game Boy is powered on. It must match the following (hexadecimal) dump, otherwise the boot ROM won’t allow the game to run:

CE ED 66 66 CC 0D 00 0B 03 73 00 83 00 0C 00 0D
00 08 11 1F 88 89 00 0E DC CC 6E E6 DD DD D9 99
BB BB 67 63 6E 0E EC CC DD DC 99 9F BB B9 33 3E

The way the pixels are encoded is as follows: (more visual aid)

  • The bytes $0104$011B encode the top half of the logo while the bytes $011C$0133 encode the bottom half.
  • For each half, each nibble encodes 4 pixels (the MSB corresponds to the leftmost pixel, the LSB to the rightmost); a pixel is lit if the corresponding bit is set.
  • The 4-pixel “groups” are laid out top to bottom, left to right.
  • Finally, the monochrome models upscale the entire thing by a factor of 2 (leading to somewhat chunky pixels).

The Game Boy’s boot procedure first displays the logo and then checks that it matches the dump above. If it doesn’t, the boot ROM locks itself up.

The CGB and later models only check the top half of the logo (the first $18 bytes).

0134-0143 — Title

These bytes contain the title of the game in upper case ASCII. If the title is less than 16 characters long, the remaining bytes should be padded with $00s.

Parts of this area actually have a different meaning on later cartridges, reducing the actual title size to 15 ($0134$0142) or 11 ($0134$013E) characters; see below.

013F-0142 — Manufacturer code

In older cartridges these bytes were part of the Title (see above). In newer cartridges they contain a 4-character manufacturer code (in uppercase ASCII). The purpose of the manufacturer code is unknown.

0143 — CGB flag

In older cartridges this byte was part of the Title (see above). The CGB and later models interpret this byte to decide whether to enable Color mode (“CGB Mode”) or to fall back to monochrome compatibility mode (“Non-CGB Mode”).

Typical values are:

ValueMeaning
$80The game supports CGB enhancements, but is backwards compatible with monochrome Game Boys
$C0The game works on CGB only (the hardware ignores bit 6, so this really functions the same as $80)

Values with bit 7 and either bit 2 or 3 set will switch the Game Boy into a special non-CGB-mode called “PGB mode”.

Research needed

The PGB mode is not well researched or documented yet. Help is welcome!

0144–0145 — New licensee code

This area contains a two-character ASCII “licensee code” indicating the game’s publisher. It is only meaningful if the Old licensee is exactly $33 (which is the case for essentially all games made after the SGB was released); otherwise, the old code must be considered.

Sample licensee codes:

0146 — SGB flag

This byte specifies whether the game supports SGB functions. The SGB will ignore any command packets if this byte is set to a value other than $03 (typically $00).

0147 — Cartridge type

This byte indicates what kind of hardware is present on the cartridge — most notably its mapper.

CodeType
$00ROM ONLY
$01MBC1
$02MBC1+RAM
$03MBC1+RAM+BATTERY
$05MBC2
$06MBC2+BATTERY
$08ROM+RAM 9
$09ROM+RAM+BATTERY 9
$0BMMM01
$0CMMM01+RAM
$0DMMM01+RAM+BATTERY
$0FMBC3+TIMER+BATTERY
$10MBC3+TIMER+RAM+BATTERY 10
$11MBC3
$12MBC3+RAM 10
$13MBC3+RAM+BATTERY 10
$19MBC5
$1AMBC5+RAM
$1BMBC5+RAM+BATTERY
$1CMBC5+RUMBLE
$1DMBC5+RUMBLE+RAM
$1EMBC5+RUMBLE+RAM+BATTERY
$20MBC6
$22MBC7+SENSOR+RUMBLE+RAM+BATTERY
$FCPOCKET CAMERA
$FDBANDAI TAMA5
$FEHuC3
$FFHuC1+RAM+BATTERY
9

No licensed cartridge makes use of this option. The exact behavior is unknown.

10

MBC3 with 64 KiB of SRAM refers to MBC30, used only in Pocket Monsters: Crystal Version (the Japanese version of Pokémon Crystal Version).

0148 — ROM size

This byte indicates how much ROM is present on the cartridge. In most cases, the ROM size is given by 32 KiB × (1 << <value>):

ValueROM sizeNumber of ROM banks
$0032 KiB2 (no banking)
$0164 KiB4
$02128 KiB8
$03256 KiB16
$04512 KiB32
$051 MiB64
$062 MiB128
$074 MiB256
$088 MiB512
$521.1 MiB72 11
$531.2 MiB80 11
$541.5 MiB96 11
11

Only listed in unofficial docs. No cartridges or ROM files using these sizes are known. As the other ROM sizes are all powers of 2, these are likely inaccurate. The source of these values is unknown.

0149 — RAM size

This byte indicates how much RAM is present on the cartridge, if any.

If the cartridge type does not include “RAM” in its name, this should be set to 0. This includes MBC2, since its 512 × 4 bits of memory are built directly into the mapper.

CodeSRAM sizeComment
$000No RAM
$01Unused 12
$028 KiB1 bank
$0332 KiB4 banks of 8 KiB each
$04128 KiB16 banks of 8 KiB each
$0564 KiB8 banks of 8 KiB each
12

Listed in various unofficial docs as 2 KiB. However, a 2 KiB RAM chip was never used in a cartridge. The source of this value is unknown.

Various “PD” ROMs (“Public Domain” homebrew ROMs, generally tagged with (PD) in the filename) are known to use the $01 RAM Size tag, but this is believed to have been a mistake with early homebrew tools, and the PD ROMs often don’t use cartridge RAM at all.

014A — Destination code

This byte specifies whether this version of the game is intended to be sold in Japan or elsewhere.

Only two values are defined:

CodeDestination
$00Japan (and possibly overseas)
$01Overseas only

014B — Old licensee code

This byte is used in older (pre-SGB) cartridges to specify the game’s publisher. However, the value $33 indicates that the New licensee codes must be considered instead. (The SGB will ignore any command packets unless this value is $33.)

Here is a list of known Old licensee codes (source).

HEXLicensee
00None
01Nintendo
08Capcom
09HOT-B
0AJaleco
0BCoconuts Japan
0CElite Systems
13EA (Electronic Arts)
18Hudson Soft
19ITC Entertainment
1AYanoman
1DJapan Clary
1FVirgin Games Ltd.3
24PCM Complete
25San-X
28Kemco
29SETA Corporation
30Infogrames5
31Nintendo
32Bandai
33Indicates that the New licensee code should be used instead.
34Konami
35HectorSoft
38Capcom
39Banpresto
3CEntertainment Interactive (stub)
3EGremlin
41Ubi Soft1
42Atlus
44Malibu Interactive
46Angel
47Spectrum HoloByte
49Irem
4AVirgin Games Ltd.3
4DMalibu Interactive
4FU.S. Gold
50Absolute
51Acclaim Entertainment
52Activision
53Sammy USA Corporation
54GameTek
55Park Place13
56LJN
57Matchbox
59Milton Bradley Company
5AMindscape
5BRomstar
5CNaxat Soft14
5DTradewest
60Titus Interactive
61Virgin Games Ltd.3
67Ocean Software
69EA (Electronic Arts)
6EElite Systems
6FElectro Brain
70Infogrames5
71Interplay Entertainment
72Broderbund
73Sculptured Software6
75The Sales Curve Limited7
78THQ
79Accolade15
7ATriffix Entertainment
7CMicroProse
7FKemco
80Misawa Entertainment
83LOZC G.
86Tokuma Shoten
8BBullet-Proof Software2
8CVic Tokai Corp.16
8EApe Inc.17
8FI’Max18
91Chunsoft Co.8
92Video System
93Tsubaraya Productions
95Varie
96Yonezawa19/S’Pal
97Kemco
99Arc
9ANihon Bussan
9BTecmo
9CImagineer
9DBanpresto
9FNova
A1Hori Electric
A2Bandai
A4Konami
A6Kawada
A7Takara
A9Technos Japan
AABroderbund
ACToei Animation
ADToho
AFNamco
B0Acclaim Entertainment
B1ASCII Corporation or Nexsoft
B2Bandai
B4Square Enix
B6HAL Laboratory
B7SNK
B9Pony Canyon
BACulture Brain
BBSunsoft
BDSony Imagesoft
BFSammy Corporation
C0Taito
C2Kemco
C3Square
C4Tokuma Shoten
C5Data East
C6Tonkin House
C8Koei
C9UFL
CAUltra Games
CBVAP, Inc.
CCUse Corporation
CDMeldac
CEPony Canyon
CFAngel
D0Taito
D1SOFEL (Software Engineering Lab)
D2Quest
D3Sigma Enterprises
D4ASK Kodansha Co.
D6Naxat Soft14
D7Copya System
D9Banpresto
DATomy
DBLJN
DDNippon Computer Systems
DEHuman Ent.
DFAltron
E0Jaleco
E1Towa Chiki
E2Yutaka # Needs more info
E3Varie
E5Epoch
E7Athena
E8Asmik Ace Entertainment
E9Natsume
EAKing Records
EBAtlus
ECEpic/Sony Records
EEIGS
F0A Wave
F3Extreme Entertainment
FFLJN
1

Later known as Ubisoft.

2

Later succeeded by Blue Planet Software, then acquired by The Tetris Company in 2020.

4

Later known as LucasArts between 1990-2021.

5

Later known as Atari SA.

6

Later accquired by Iguana Entertainment in 1995. Parent studio owned by Acclaim Entertainment.

8

Later known as Spike Chunsoft Co., Ltd..

14

Later known as Kaga Create.

16

Known as Vic Tokai Corporation until 2011 when the name changed to Tokai Communications.

15

Later Infogrames North America, Inc.

13

Later named Caesars Entertainment, Inc.

17

Now known as Creatures, Inc.

18

Not to be confused with the IMAX motion picture film format.

19

Merged into Sega as Sega-Yonezawa, later becoming Sega Toys, and finally Sega Fave.

014C — Mask ROM version number

This byte specifies the version number of the game. It is usually $00.

014D — Header checksum

This byte contains an 8-bit checksum computed from the cartridge header bytes $0134–014C. The boot ROM computes the checksum as follows:

uint8_t checksum = 0;
for (uint16_t address = 0x0134; address <= 0x014C; address++) {
    checksum = checksum - rom[address] - 1;
}

The boot ROM verifies this checksum. If the byte at $014D does not match the lower 8 bits of checksum, the boot ROM will lock up and the program in the cartridge won’t run.

014E-014F — Global checksum

These bytes contain a 16-bit (big-endian) checksum simply computed as the sum of all the bytes of the cartridge ROM (except these two checksum bytes).

This checksum is not verified, except by Pokémon Stadium’s “GB Tower” emulator (presumably to detect Transfer Pak errors).