The Cartridge Header

An internal information area is located at $0100-014F in each cartridge. It contains the following values:

0100-0103 - Entry Point

After displaying the Nintendo Logo, the built-in boot procedure jumps to this address ($0100), which should then jump to the actual main program in the cartridge. Usually this 4 byte area contains a nop instruction, followed by a jp $0150 instruction. But not always.

These bytes define the bitmap of the Nintendo logo that is displayed when the Game Boy gets turned on. The hex dump of this bitmap is:

 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 Game Boy’s boot procedure verifies the content of this bitmap (after it has displayed it), and LOCKS ITSELF UP if these bytes are incorrect. A CGB verifies only the first half ($18 bytes of) the bitmap, but others (for example a Game Boy pocket) verify all $30 bytes, as does the Game Boy Advance.

0134-0143 - Title

Title of the game in UPPER CASE ASCII. If it is less than 16 characters then the remaining bytes are filled with $00 bytes. When inventing the CGB, Nintendo has reduced the length of this area to 15 characters, and some months later they had the fantastic idea to reduce it to 11 characters only. The new meaning of the ex-title bytes is described below.

013F-0142 - Manufacturer Code

In older cartridges this area has been part of the Title (see above), in newer cartridges this area contains an 4 character uppercase manufacturer code. Purpose and Deeper Meaning unknown.

0143 - CGB Flag

In older cartridges this byte has been part of the Title (see above). In CGB cartridges the upper bit is used to enable CGB functions. This is required, otherwise the CGB switches itself into Non-CGB-Mode. Typical values are:

 80h - Game supports CGB functions, but also works on old Game Boys.
 C0h - Game works on CGB only (physically the same as $80).

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

TODO: research and document PGB modes…

0144-0145 - New Licensee Code

Specifies a two-character ASCII licensee code, indicating the company or publisher of the game. These two bytes are used in newer games only (games that have been released after the SGB has been invented). Older games are using the header entry at $014B instead.

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

Specifies whether the game supports SGB functions, common values are:

  • $00: No SGB functions (Normal Game Boy or CGB only game)
  • $03: Game supports SGB functions

The SGB disables its SGB functions if this byte is set to a value other than $03.

0147 - Cartridge Type

Specifies which Memory Bank Controller (if any) is used in the cartridge, and if further external hardware exists in the cartridge.

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. Exact behaviour is unknown.

2

MBC3 with RAM size 64 KByte refers to MBC30, used only in Pocket Monsters Crystal Version for Japan.

0148 - ROM Size

Specifies the ROM Size of the cartridge. Typically calculated as “N such that 32 KiB << N”.

CodeSizeAmount of banks
$0032 KByte2 (No ROM banking)
$0164 KByte4
$02128 KByte8
$03256 KByte16
$04512 KByte32
$051 MByte64
$062 MByte128
$074 MByte256
$088 MByte512
$521.1 MByte72 3
$531.2 MByte80 3
$541.5 MByte96 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 for these values is unknown.

0149 - RAM Size

Specifies the size of the external RAM in the cartridge (if any).

CodeSizeComment
$000No RAM 4
$01-Unused 5
$028 KB1 bank
$0332 KB4 banks of 8 KB each
$04128 KB16 banks of 8 KB each
$0564 KB8 banks of 8 KB each
4

When using a MBC2 chip, $00 must be specified as the RAM Size, even though the MBC2 includes a built-in RAM of 512 x 4 bits.

5

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

Various “PD” ROMs (“Public Domain” homebrew ROMs generally tagged “(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

Specifies if this version of the game is supposed to be sold in Japan, or anywhere else. Only two values are defined.

  • $00: Japanese
  • $01: Non-Japanese

014B - Old Licensee Code

Specifies the games company/publisher code in range $00-FF. A value of $33 signals that the New Licensee Code (in header bytes $0144-0145) is used instead. (Super Game Boy functions won’t work if <> $33.) A list of licensee codes can be found here.

014C - Mask ROM Version number

Specifies the version number of the game. That is usually $00.

014D - Header Checksum

Contains an 8 bit checksum across the cartridge header bytes $0134-014C. The boot ROM computes x as follows:

x = 0
i = $0134
while i <= $014C
	x = x - [i] - 1

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

014E-014F - Global Checksum

Contains a 16 bit checksum (upper byte first) across the whole cartridge ROM. Produced by adding all bytes of the cartridge (except for the two checksum bytes). The Game Boy doesn’t verify this checksum.