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 manufactorer 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<#014B — 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:

CodePublisher
00None
01Nintendo R&D1
08Capcom
13Electronic Arts
18Hudson Soft
19b-ai
20kss
22pow
24PCM Complete
25san-x
28Kemco Japan
29seta
30Viacom
31Nintendo
32Bandai
33Ocean/Acclaim
34Konami
35Hector
37Taito
38Hudson
39Banpresto
41Ubi Soft
42Atlus
44Malibu
46angel
47Bullet-Proof
49irem
50Absolute
51Acclaim
52Activision
53American sammy
54Konami
55Hi tech entertainment
56LJN
57Matchbox
58Mattel
59Milton Bradley
60Titus
61Virgin
64LucasArts
67Ocean
69Electronic Arts
70Infogrames
71Interplay
72Broderbund
73sculptured
75sci
78THQ
79Accolade
80misawa
83lozc
86Tokuma Shoten Intermedia
87Tsukuda Original
91Chunsoft
92Video system
93Ocean/Acclaim
95Varie
96Yonezawa/s’pal
97Kaneko
99Pack in soft
A4Konami (Yu-Gi-Oh!)

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 1
$09ROM+RAM+BATTERY 1
$0BMMM01
$0CMMM01+RAM
$0DMMM01+RAM+BATTERY
$0FMBC3+TIMER+BATTERY
$10MBC3+TIMER+RAM+BATTERY 2
$11MBC3
$12MBC3+RAM 2
$13MBC3+RAM+BATTERY 2
$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
1

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

2

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 3
$531.2 MiB80 3
$541.5 MiB96 3
3

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 4
$028 KiB1 bank
$0332 KiB4 banks of 8 KiB each
$04128 KiB16 banks of 8 KiB each
$0564 KiB8 banks of 8 KiB each
4

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<#0144-0145 — New licensee must be considered instead. (The SGB will ignore any command packets unless this value is $33.)

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

HEXLicensee
00None
01Nintendo
08Capcom
09Hot-B
0AJaleco
0BCoconuts Japan
0CElite Systems
13EA (Electronic Arts)
18Hudsonsoft
19ITC Entertainment
1AYanoman
1DJapan Clary
1FVirgin Interactive
24PCM Complete
25San-X
28Kotobuki Systems
29Seta
30Infogrames
31Nintendo
32Bandai
33Indicates that the [New licensee<#0144-0145 - New licensee should be used instead.
34Konami
35HectorSoft
38Capcom
39Banpresto
3C.Entertainment i
3EGremlin
41Ubisoft
42Atlus
44Malibu
46Angel
47Spectrum Holoby
49Irem
4AVirgin Interactive
4DMalibu
4FU.S. Gold
50Absolute
51Acclaim
52Activision
53American Sammy
54GameTek
55Park Place
56LJN
57Matchbox
59Milton Bradley
5AMindscape
5BRomstar
5CNaxat Soft
5DTradewest
60Titus
61Virgin Interactive
67Ocean Interactive
69EA (Electronic Arts)
6EElite Systems
6FElectro Brain
70Infogrames
71Interplay
72Broderbund
73Sculptered Soft
75The Sales Curve
78t.hq
79Accolade
7ATriffix Entertainment
7CMicroprose
7FKemco
80Misawa Entertainment
83Lozc
86Tokuma Shoten Intermedia
8BBullet-Proof Software
8CVic Tokai
8EApe
8FI’Max
91Chunsoft Co.
92Video System
93Tsubaraya Productions Co.
95Varie Corporation
96Yonezawa/S’Pal
97Kaneko
99Arc
9ANihon Bussan
9BTecmo
9CImagineer
9DBanpresto
9FNova
A1Hori Electric
A2Bandai
A4Konami
A6Kawada
A7Takara
A9Technos Japan
AABroderbund
ACToei Animation
ADToho
AFNamco
B0acclaim
B1ASCII or Nexsoft
B2Bandai
B4Square Enix
B6HAL Laboratory
B7SNK
B9Pony Canyon
BACulture Brain
BBSunsoft
BDSony Imagesoft
BFSammy
C0Taito
C2Kemco
C3Squaresoft
C4Tokuma Shoten Intermedia
C5Data East
C6Tonkinhouse
C8Koei
C9UFL
CAUltra
CBVap
CCUse Corporation
CDMeldac
CE.Pony Canyon or
CFAngel
D0Taito
D1Sofel
D2Quest
D3Sigma Enterprises
D4ASK Kodansha Co.
D6Naxat Soft
D7Copya System
D9Banpresto
DATomy
DBLJN
DDNCS
DEHuman
DFAltron
E0Jaleco
E1Towa Chiki
E2Yutaka
E3Varie
E5Epcoh
E7Athena
E8Asmik ACE Entertainment
E9Natsume
EAKing Records
EBAtlus
ECEpic/Sony Records
EEIGS
F0A Wave
F3Extreme Entertainment
FFLJN

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).