Game Boy Color Bootstrap ROM
|Game Boy Color Bootstrap ROM|
This console has a notes page
Stuff from the source code in the 2020-07-25 Nintendo leak.
The Game Boy Color (abbreviated GBC or CGB) is often considered to be the successor to the original Game Boy, although it's technically more of an upgraded model - even being counted as such by Nintendo. The GBC uses the same Z80-based 8-bit CPU as the original Game Boy, but with a higher clock speed, expanded RAM, and most obviously,.
The Game Boy's early competitors, the Game Gear and Lynx, did offer color, but didn't have the Game Boy's huge battery life and library. This new Game Boy later pushed competitors Bandai and SNK to make "Color" upgrades of the WonderSwan and Neo Geo Pocket, respectively.
The Game Boy Color Bootstrap ROM (often mistakenly called a BIOS although it is not a system for handling basic in- or output) is executed when the GBC is turned on. It is the successor to the Game Boy and Game Boy Pocket Bootstrap ROMs. Just like the Game Boy bootstrap ROM, it checks the inserted game cartridge for integrity by calculating the complement checksum, locking out cartridges that may be corrupted or which don't have the copyrighted Nintendo logo within.
Unused Palette Configurations
(See the Notes page for the used palette configurations.)
The ROM assigns color palettes to certain monochrome Game Boy games by computing a hash of the ROM's header title for every Nintendo Licensee game and checking it against an internal database of hashes. The resulting index is then used to obtain an entry ID (from 0x00 up to and including 0x1C) and shuffling flags (a 3-bit bitfield). An entry is a triplet of palettes, and the "shuffling flags" replace some of the triplet's palettes with others. In particular, shuffling flag value 0x05 causes all 3 members of a triplet to be used, and 0x00 causes both OBJ palettes to be overwritten with copies of the BG palette (which never budges). Since bit 2 of the shuffling flags overrides bit 1, values 0x06 and 0x07 are never used.
While not all combinations of entry ID and shuffling flags are used, almost all palettes can be seen in at least one used combination, including manual palette selection with the joypad. Triplets with one unreferenced palette that can't normally be seen are listed below; the unused palettes have their name in bold.
|Entry||Palettes||Color 0||Color 1||Color 2||Color 3|
Most unused palettes are duplicates of others in the same triplet, but entries 0x07 and 0x13 both have unique colors that can normally never be loaded!
Any combination of palette triplet and shuffling flags can be loaded using an emulator that supports the bootstrap ROM, such as BGB or SameBoy: enable GameShark code 01??08D0, where ?? is calculated as
ID | flags << 5, and load a game without GBC compatibility.
The selected palette will load regardless of whether any buttons have been pressed.
Three revisions of the Game Boy Color bootstrap ROM exist: CGB0, CGB, and CGB-AGB.
CGB0 is the nickname given to a different boot ROM present on some early GBC revisions (with a CPU marked
CPU CGB), which has a few differences suggesting, along with its earlier release date, that it is an earlier version of the GBC boot ROM.
It has the following differences to the regular GBC boot ROM:
- The console's wave RAM is not initialized, causing for example different title screen music in R-Type DX.
- A less efficient loop is used to load the "GAME BOY" logo graphics.
- The palette triplet ID and shuffling flags are written to two extra variables in the console's RAM, which are never read from again. It is speculated that these might be debug remnants.
CGB-AGB is a slightly revised version of the boot ROM, present inside Game Boy Advance consoles, and is run when the console is powered up in Game Boy Color compatibility mode.
It finally fixes the "logo TOCTTOU" issue that has plagued the console series since its very beginning, by having the logo be drawn on-screen from the copy made in the console's RAM instead of re-reading it from the cartridge. Curiously, the boot ROM still only compares the first half of the logo.