We just reached 30,000 articles on this wiki! 🥳
If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!
This article has a talk page!

Game Boy Color Bootstrap ROM

From The Cutting Room Floor
Jump to navigation Jump to search

Title Screen

Game Boy Color Bootstrap ROM

Developer: Nintendo
Publisher: Nintendo
Released in JP: October 21, 1998
Released in US: November 18, 1998
Released in EU: November 23, 1998
Released in AU: February 3, 1999
Released in KR: December 20, 2000[1]


GraphicsIcon.png This console has unused graphics.
Carts.png This console has revisional differences.


NotesIcon.png This console has a notes page

Hmmm...
To do:
  • Stuff from the source code in the 2020-07-25 Nintendo leak.
  • Prototype with blue Nintendo bootscreen and graphical select menu

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, color.

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 GBC 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 Bootstrap ROM. 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.

Sub-Page

Miscellaneous tidbits that are interesting enough to point out here.
Notes

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
0x04 BG 0xFFFFFF 0x7BFF00 0xB57300 0x000000
OBJ0 0xFFFFFF 0xFF8484 0x943A3A 0x000000
OBJ1 0xFFFFFF 0xFF8484 0x943A3A 0x000000
0x07 BG 0xFFFFFF 0xFFFF00 0xFF0000 0x000000
OBJ0 0xFFFFFF 0x63A5FF 0x0000FF 0x000000
OBJ1 0xFFFFFF 0x5ABDFF 0xFF0000 0x0000FF
0x0A BG 0xB5B5FF 0xFFFF94 0xAD5A42 0x000000
OBJ0 0x000000 0xFFFFFF 0xFF8484 0x943A3A
OBJ1 0x000000 0xFFFFFF 0xFF8484 0x943A3A
0x13 BG 0x000000 0x008484 0xFFDE00 0xFFFFFF
OBJ0 0xFFFFFF 0xFF8484 0x943A3A 0x000000
OBJ1 0xFFFFFF 0x7BFF31 0x008400 0x000000
0x16 BG 0xFFFFFF 0xA5A5A5 0x525252 0x000000
OBJ0 0xFFFFFF 0xA5A5A5 0x525252 0x000000
OBJ1 0xFFFFFF 0xA5A5A5 0x525252 0x000000
0x1B BG 0xFFFFFF 0xFFCE00 0x9C6300 0x000000
OBJ0 0xFFFFFF 0xFFCE00 0x9C6300 0x000000
OBJ1 0xFFFFFF 0xFFCE00 0x9C6300 0x000000

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.

Version differences

Three revisions of the Game Boy Color bootstrap ROM exist: CGB0, CGB, and CGB-AGB.

CGB0

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

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.

(Source: boot ROM disassembly)

References

  1. [1], GAMEMECA