Now Reading
Exploring the Gameboy Reminiscence Financial institution Controller · Brendan’s Web site

Exploring the Gameboy Reminiscence Financial institution Controller · Brendan’s Web site

2023-04-09 09:50:16

21 minutes to learn

Array of Carts

And not using a recreation cartridge, a Gameboy is simply shows “Gameboy” and freezes.
As soon as slotted in, the bits and bytes contained inside a cartridge created numerous worlds and reminiscences.
How did a Gameboy cartridges retailer such all kinds of video games, whereas additionally enabling issues like save information, rumble, and even infrared communication?

On this article, we are going to study the Reminiscence Financial institution Controllers (MBC) contained contained in the cartridge, and the way they enabled the worlds of Pokemon, Zelda, and numerous different to turn into a actuality within the palms of youngsters and adults all over the place.
To start out, we are going to outline what precisely a Reminiscence Financial institution Controller is, and the differing types that had been accessible.
We’ll additionally analyze some utilization statistics about how widespread they had been in cartridges, and what varieties had been used probably the most.

Subsequent we’ll have a look at how the Gameboy decided the cartridge sort by analyzing the sport ROM header.
Lastly, we’ll check out some actual examples from my very own recreation assortment and see how the MBC was utilized in apply.

Desk of Contents


Reminiscence Financial institution Controller had been part of many cartridge video games developed for the Gameboy and Gameboy coloration.
It allowed the cartridge to not solely tackle bigger quantities of RAM and ROM, however to even have extra {hardware} that the Gameboy might make the most of.
The MBCs had been mostly paired with bigger ROM and extra RAM, however totally different MBCs additionally allowed the usage of actual time clocks, rumble, and even a lightweight sensor.

A traditional cartridge had 16 tackle strains, permitting the Gameboy to deal with a most of 64KB of ROM on the cartridge with out an MBC.
In apply the utmost ROM measurement of a recreation with out an MBC was 32KB.
Video games like Tetris and Dr. Mario had been 32KB or much less in measurement, so didn’t require a MBC to function.
This allowed for quite simple PCB layouts, as the one ROM chip could be straight linked to the cartridge pins.
By inserting an MBC between the console and the cartridge ROM/RAM, it might translate particular reads and writes to facilitate the financial institution switching.

ROM knowledge on a cartridge could be cut up into 16KB “banks” that might be swapped out at will by the sport.
The primary financial institution, 00, could be at all times mounted at 0x0000-0x3FFF within the Gameboy’s reminiscence map.
This primary financial institution normally contained code that was used generally, as it will at all times be current and accessible by this system.
The sport would be capable to swap out any extra banks by writing values to particular areas of the reminiscence map, which might instruct the MBC what financial institution to change to.
The chosen financial institution could be mounted from 0x4000-0x7FFF, proper subsequent to the realm of reminiscence that was financial institution 00.

RAM banks behaved equally, although it solely mounted 8KB at a time.
That knowledge was mounted at addresses 0xA000-0xBFFF and was capable of be each learn and written to (as one would count on).
Many video games took benefit of getting further RAM on the cartridge as a result of the Gameboy DMG solely had 8KB accessible internally.
The Gameboy coloration bumped that to 32KB, however that would nonetheless be constraining for bigger titles.
For a deeper dive into the specifics of how video games carried out ROM and RAM financial institution switching, take a look at my article right here: Gameboy DMG ROM and RAM Bank Switching.

When creating a recreation, it was and nonetheless is vital to contemplate the dimensions of the ultimate product (except you’re Name of Obligation).
The dimensions of the sport and add-ons like RAM managed what sort of reminiscence financial institution controller could be required.
The next varieties of reminiscence financial institution controllers had been normally accessible to be used:

Sort Max ROM Max RAM Information
None 32KB 8KB No financial institution controller, only a ROM chip and probably 1 financial institution’s price of RAM
MBC1 2MB 32KB The fundamental Gameboy MBC
MBC2 256KB 512×4 bits Information in RAM consists of 4 bit values
MBC3 2MB 64KB Much like MBC1, additionally included addition of an actual time clock
MBC5 8MB 1MB Supported the sunshine sensor, and a rumble motor
MBC6 1MB 32KB Solely used for one recreation: Web de Get: Minigame @ 100. Had separate, switchable ROM and RAM units plus flash reminiscence. ROM banks had been 8KB and RAM banks had been 4KB
MBC7 8MB 1MB Contained extra 256 byte EEPROM and 2-axis accelerometer. Much like MBC5
MMM01 2MB 32KB A “metamapper” for a recreation assortment, which switches between units of banks
Tama5 ? ? Customized MBC designed by Bandai for a single recreation, Tamagotchi 3
HuC-1 2MB 32KB Buyer MBC designed by Hudson, helps infrared LED enter.
HuC-3 2MB 32KB Buyer MBC designed by Hudson that provides a RTC and piezo buzzer to the HuC-1
      Source 1 Source 2

A notice in regards to the MMM01, it’s a “metamapper” that’s used within the recreation assortment (Momotarō Assortment 2 and Taito Selection Pack).
It offers a boot menu that enables the consumer to pick out a recreation earlier than locking itself down right into a separate “regular” mapper mode that solely exposes sure banks to the sport inside the gathering.
To learn extra in regards to the specifics, together with an attention-grabbing VHDL design, take a look at this wiki page.

Gameboy cartridges mostly used no MBC in any respect, or MBC sort 1,2, and 5.
MBC 3, 6 and seven had been normally reserved for particular circumstances and didn’t see as a lot use.
The differing types enabled builders to make use of {hardware} like actual time clocks, RAM, batteries for saving, rumble, and even a lightweight sensor.
A number of reminiscence controllers had been made to assist management the price of producing the cartridge.
Whereas it will be handy to have a “One measurement matches all” controller that would dynamically accommodate add-ons and ranging quantities of ROM and RAM, it will have been an costly chip to supply.
By producing quite a lot of varieties, recreation builders might choose the MBC that might finest accommodate their recreation.

Utilization Statistics

The Game Boy hardware database is a community-created database of gameboy cartridges.
It accommodates detailed data and photographs of assorted cartridges and their inner elements.
There are 316 distinct Gameboy recreation entries, out of 1,049 DMG + 576 GBC video games (1,625 complete).
There are lots of video games lacking, however I determine it must be a ok pattern that we should always no less than be capable to discern some tendencies from the info.

I grabbed a knowledge dump, loaded it into sqlite3 and ran some queries over it to get some extra details about what varieties of financial institution controllers had been used over time.
You’ll be able to view the identical dataset I used here, or seize probably the most up-to-date copy from here.
The question I used counted what number of distinct recreation titles used every MBC sort by 12 months.
It offers a tough view of each the variety of video games launched and the controller varieties utilized in these video games annually.

Chart of
Full size

1989 4 2 1   1                         1989
1990 9 2 12   2                         1990
1991 3   21   1                         1991
1992     11 2                           1992
1993     4 7 2                         1993
1994     5 1                           1994
1995     7 8                           1995
1996 1   9 6 1                 1       1996
1997 2   7 20 3 1             1   1     1997
1998     15 12 1 6   7   6     1   1 1 3 1998
1999     2 1       3   21         1   1 1999
2000 2           1 4 3 32   2           2000
2001 1               9 13 1 1           2001
2002                 2 4               2002
2003                 1                 2003

Question: SELECT COUNT(DISTINCT "identify"), COALESCE(NULLIF("mapper_kind",''), 'None'), "board_year" FROM cart WHERE DISTINCT "identify" GROUP BY "mapper_kind", "board_year" ORDER BY "board_year", "mapper_kind";

For the primary 7 years, we actually solely see the MBC1 and MBC2 used.
The MBC2 was used sparingly.
When it comes to ROM house, it had 1/eighth the house of the MBC1 however 8x the house of only a ROM with no MBC.
It additionally had 128 Bytes of RAM that was cut up into 4-byte chunks.
It appears that evidently it was the only MBC accessible to recreation builders, meant for video games that required extra storage than only a ROM chip, however didn’t want all of the capabilities of MBC1.

Between the totally different revisions of the MBC1, the MBC1B was used probably the most.
There are just a few MBC1A entries, however they had been solely current in Japanese titles in the course of the first two years of the gameboy.
The MBC1B most likely fastened bugs current within the MBC1A, however I haven’t been capable of finding any concrete proof describing what these points is likely to be, I’m simply going of the naming scheme.
I believe the distinction between the MBC1B and MBC1B1 was much less extreme, presumably one thing to do with energy consumption or pace since it is just a “minor model” enchancment.
The MBC1B1 appeared for use interchangeably with the traditional MBC1B, as proven by the mapper sort entries for Donkey Kong Land III (USA, Europe) (Rev 1) (SGB Enhanced), the place we are able to see it utilizing each varieties over a interval of two years:

MBC1B Jul/1998
MBC1B1 Jul/1998
MBC1B1 Aug/1998
MBC1B Jun/1999

The MBC3 solely began for use in 1998, the identical 12 months the Gameboy Colour was launched.
Earlier than that time, we actually solely see video games use an MBC1, MBC2, or no MBC in any respect.
As soon as the MBC3 was launched, it was used primarily for newer Gameboy Colour video games, nevertheless it additionally noticed some use in video games focused for the Gameboy DMG, like Mary Kate and Ashley’s Pocket Planner.

Much like the MBC1, we are able to additionally see {hardware} lifecycle occasions for the MBC3 over time it was used.
It appears that evidently the change from MBC3 -> MBC3A -> MBC3B was rather more absolute than MBC1A -> MBC1B -> MBC1B1.
After 1998, Nintendo appeared to transition totally to the MBC3A, as we don’t see any MBC3 entries; after 2000 we see the identical development with the MBC3A and MBC3B.
The truth that we don’t see any use of a earlier model within the 12 months following the introduction of newer model leads me motive that the brand new variations fastened bugs within the {hardware}, as a substitute of efficiency enhancements just like the MBC1B -> MBC1B1 replace.

When a brand new console is launched, it normally takes a short while for recreation builders to start out utilizing it to it’s fullest potential.
We’re capable of see that apply right here with the MBC1 and MBC5 within the two years following every of their releases.

In 1990, you’ll be able to see a rise of use throughout the accessible MBC varieties: “None”, MBC1, and MBC2.
A part of the expansion within the 12 months following the Gameboy DMG launch might be contributed to the discharge dates of the Gameboy in April (JP), late July (USA), and late September (EU).
I assume that by ready till the 12 months following the discharge, builders have a bit extra time with the {hardware} and may apply extra polish to their video games.
In 1991, we see a pointy drop off in video games with only a ROM, and a big enhance of MBC1 sort video games.
From 1992 to 1995, all of the video games find yourself utilizing an MBC. with MBC1B and MBC1B1 seeing the majority of the motion.

There’s a comparable development with the adoption of the MBC5 between 1998 and 2000.
Between 1998 and 1999, there was a big drop in MBC1 use, and a humongous enhance in MBC5.
The MBC5 was an enormous enchancment over the MBC1, and in addition had help for added {hardware} additions to the cartridge.
1998 had about 50% of the video games use a MBC1 model controller, with various use throughout the opposite varieties.
In 1999 nonetheless, there’s a enormous drop in MBC1 use and a big leap in MBC5 use.
The MBC5 turned accessible with the discharge of the Gameboy coloration (1998), and the sharp enhance in use in 1999 and 2000 present how beneficial the additional capabilities of the controller had been.
After 1999, we don’t see any extra of the MBC1 and only a smattering of use of ROMs with out an MBC.

In 2001, the Gameboy Advance was launched, and with it a very new cartridge known as the GamePak.
The brand new cartridge was incompatible with the previous sort, primarily as a result of the Gameboy Advance used an ARM processor as a substitute of a Z-80 clone just like the Gameboy DMG and CGB.
This is similar motive the Nintendo DS is simply capable of play Advance video games, nothing prior.
The brand new cartridge had 24 tackle strains as a substitute of 16, and your entire cartridge ROM was within the reminiscence map offered to the sport, eradicating the necessity for financial institution switching.
You’ll be able to learn extra in regards to the GamePak cartridge here.

With the discharge of the Gameboy Advance, we see a pointy decline within the variety of titles launched.
Video games had been nonetheless launched for the Gameboy Colour up till 2003.
Surprisingly, the final Gameboy DMG video games had been launched in Japan in 2001, over a decade because the handheld was first launched.

When a cartridge is inserted right into a Gameboy, it wants some strategy to talk it’s {hardware} properties to the boot loader.
That is carried out by way of the cartridge header.
When getting ready a recreation to be positioned on a cartridge, a header is positioned firstly of the ROM.
This header is current on all cartridges at addresses 0x100-0x14F.
It’s the very first thing that’s learn by the Gameboy and accommodates bits of knowledge describing totally different properties of software program and {hardware}.

The cartridge header shops data like the primary 16 characters of the sport’s title (0x134-0x143), area (0x14a), and even the nintendo emblem (0x104-0x133).
This is similar emblem that’s saved within the Gameboy’s boot loader, and is used to test if the cartridge is official.
If it’s not right, the sport received’t load.
It additionally allowed Nintendo to have a stronger case in opposition to third social gathering firms making their very own cartridges, because the nintendo emblem is copyrighted.

The cartridge sort is saved as a hex code at tackle 0x147.
The hex code described the {hardware} configuration of the sport cartridge.
Not solely did it accommodate all of the MBC plus {hardware} configurations, it additionally had codes for particular cartridges just like the pocket digicam and third social gathering MBCs.

Code Sort Code Sort
00h ROM Solely 19h MBC5
01h MBC1 1Ah MBC5+RAM
02h MBC1+RAM 1Bh MBC5+RAM+Battery
03h MBC1+RAM+Battery 1Ch MBC5+Rumble
05h MBC2 1Dh MBC5+Rumble+RAM
06h MBC2+Battery 1Eh MBC5+Rumble+RAM+Battery
08h ROM+RAM 20h MBC6
09h ROM+RAM+Battery 22h MBC7+Sensor+Rumble+RAM+Battery
0Bh MMM01    
0Ch MMM01+RAM    
0Dh MMM01+RAM+Battery    
0Fh MBC3+Timer+Battery    
10h MBC3+Timer+RAM+Battery FCh Pocket Digicam
12h MBC3+RAM FEh HuC3
13h MBC3+RAM+Battery FFh HuC1+RAM+Battery

Given a cartridge ROM and this chart, it is rather simple to search out the cartridge sort of a recreation by grabbing bytes on the proper addresses.
You probably have ROMs of video games, you’ll be able to peek these values utilizing xxd within the terminal.
Listed here are some examples of the cart title and kind from just a few totally different video games:

$ xxd -seek 0x134 -len 16  pokecrystal.gbc 
00000134: 504d 5f43 5259 5354 414c 0042 5954 45c0  PM_CRYSTAL.BYTE.

$ xxd -plain -seek 0x147 -len 1 pokecrystal.gbc 
$ xxd -seek 0x134 -len 16  'Pokemon Buying and selling Card Recreation (U) [C][!].gbc' 
00000134: 504f 4b45 4341 5244 0000 0041 5851 4580  POKECARD...AXQE.

$ xxd -plain -seek 0x147 -len 1 'Pokemon Buying and selling Card Recreation (U) [C][!].gbc' 
$ # MBC5 + RAM + Battery
$ xxd -seek 0x134 -len 16  'SpongeBob SquarePants - Legend of the Misplaced Spatula (USA).gbc' 
00000134: 5342 5350 204c 4f54 4c53 2142 5150 45c0  SBSP LOTLS!BQPE.

$ xxd -plain -seek 0x147 -len 1 'SpongeBob SquarePants - Legend of the Misplaced Spatula (USA).gbc' 
$ # MBC5
$ xxd -seek 0x134 -len 16  'Recreation de Hakken!! Tamagotchi - Osutchi to Mesutchi (Japan) (SGB Enhanced).gb' 
00000134: 4742 2054 414d 4147 4f54 4348 4920 3300  GB TAMAGOTCHI 3.

$ xxd -plain -seek 0x147 -len 1 'Recreation de Hakken!! Tamagotchi - Osutchi to Mesutchi (Japan) (SGB Enhanced).gb' 
$ # Bandai Tama5 (In-built alarm for when to feed your Tamagotchi!)

Cartridge {Hardware}

On this subsequent part, I took footage of most of my Gameboy video games and recorded the totally different chips on the cart.
They’ve been cut up into sections based mostly on the MBC sort the cartridge makes use of.
For every recreation, there’s a image of the cartridge and the PCB.
For webpage measurement causes, there’s a hyperlink beneath every picture to the complete measurement authentic.
There’s additionally a desk beneath every recreation that notates the board and chip labels.

The circumstances comprise two bits of attention-grabbing data: the sport ID and a case stamp.
The sport ID is within the format [Handheld type]{3}-[Game identifier]{3,4}-[Region]{2,3}-[Revision]{0,1}.
For the video games beneath, the hand held sort is normally DMG for the unique Gameboy and CGB for the Gameboy Colour.
The sport identifier is normally 3 or 4 characters lengthy, and is much like the ID on the ROM chip.
It uniquely identifies what recreation it’s.
The area is 2 or 3 characters and describes the meant area of the sport.
The most typical that I’ve seen is USA and JP, however EUR for Europe and AUS for Australia additionally exist.
Some carts additionally embody a non-obligatory quantity on the finish, probably comparable to the revision variety of the sport.

The case stamp is a label printed on the label of the case consisting of two digits and a letter.
It may be laborious to see in some circumstances, however I’ve carried out my finest to document it right here.
I’m undecided what it means, however I believe it could have one thing to do with the cartridge manufacturing.
They observe the format [0-3]{1}[0-4]{1}[A-D]{0,1}

Contained in the cart, the PCB additionally has particular marking on each the PCB itself and the ROM chip that accommodates the sport code.
PCB board is within the format [Handheld type]{3}-[PCB type]{4}-[Revision]{2}.
The hand held sort on the case, cartridge and ROM chip ought to all match.
The PCB sort is determined by the {hardware} configuration required by the sport.
Video games that had the identical MBC and additional {hardware} normally had the identical sort, however not at all times.
Lastly, the revision declared what revision the board was.
For instance, Frogger (revision 10) and Super Mario Land (revision 01) and see that regardless of having the identical MBC and {hardware}, the boards are barely totally different.
Solely revisions I’ve seen right here and within the Gameboy {hardware} database are 01 and 10, binary 1 and a pair of.

The ROM chips observe an identical format to the sport cartridge, solely leaving off the area code.
ROM chips use the format [Handheld type]{3}-[Game identifier]{3,4}-[Revision]{1}.

Now on to the images!




Launch: DMG-AW-USA

Case Stamp: 05


Board Sort: DMG-AAA-03


  Chip Board Label Mfr. Date Chip Label
U1 ROM PRG Sharp Week 34 1990 DMG-AWA-0

Dr. Mario


Launch: DMG-VU-USA

Case Stamp: 22


Board Sort: DMG-AAA-03


  Chip Board Label Mfr. Date Chip Label
U1 ROM PRG Sharp Week 34 1990 DMG-VUA-0


Cart 1


Launch: DMG-TR-USA

Case Stamp: 23 A


Board Sort: DMG-AAA-03


  Chip Board Label Mfr. Date Chip Label
U1 ROM PRG Sharp Week 14 1990 DMG-TRA-1

Cart 2


Launch: DMG-TR-USA

Case Stamp: 23 A


Board Sort: DMG-AAA-03


  Chip Board Label Mfr. Date Chip Label
U1 ROM PRG Sharp Week 9 1991 DMG-TRA-1



Launch: DMG-MJJ

Case Stamp: 22 A


Board Sort: DMG-AAA-03


  Chip Board Label Mfr. Date Chip Label
U1 ROM PRG Sharp Week 14 1990 DMG-MJJ-1




Launch: DMG-BS-USA

Case Stamp: 22


Board Sort: DMG-BBA-02


  Chip Board Label Mfr. Date Chip Label
U1 ROM PRG Sharp Week 51 1989 DMG-BSA-0
U2 Mapper MBC1/1A/1B Nintendo Week 41 1989 MBC1A




Case Stamp: 12


See Also

Board Sort: DMG-BEAN-10


  Chip Board Label Mfr. Date Chip Label
U1 ROM PRG Sharp Week 4 1999 DMG-AFGE-0
U2 Mapper MBC1/1B/1B1 Nintendo Week 51 1998 DMG MBC1B1

Tremendous Mario Land


Launch: DMG-ML-USA

Case Stamp: 23 A


Board Sort: DMG-BEAN-01


  Chip Board Label Mfr. Date Chip Label
U1 ROM PRG Nintendo Week 37 1990 DMG-MLA-1
U2 Mapper MBC1/1A/1B Nintendo DMG-MBC1B


Pokemon Gold Model



Case Stamp: 20


Board Sort: DMG-KGDU-10


  Chip Board Label Mfr. Date Chip Label
U2 Mapper MBC3A Nintendo Date MBC3 A
U3 RAM RAM Hyundai Week 29 2000 GM76C256CLLFW70
U4 RAM Protector MM1134 Mitsumi Week 7 1973 6735

Pokemon Silver Model USA



Case Stamp: 13


Board Sort: DMG-KGDU-10


  Chip Board Label Mfr. Date Chip Label
U2 Mapper MBC3A Nintendo MBC-3 B
U3 RAM RAM BSI Week 42 2000 BS62LV256SC-70
U4 RAM Protector MM1134 Mitsumi 6735

Pokemon Silver Model JP



Case Stamp: 12 A


Board Sort: DMG-KFDN-10


  Chip Board Label Mfr. Date Chip Label
U2 Mapper MBC3A Nintendo MBC-3 A
U3 RAM RAM Sharp Week 5 2000 LH52256CN-10LL
U4 RAM Protector MM1134 Mitsumi Week 40 1990 6735


Monster Rancher Battle Card GB


Launch: DMG-A6TE-USA

Case Stamp: 00

Board Sort: DMG-A08-01

ROM Sort: DMG-A6TE-0

  Chip Board Label Mfr. Date Chip Label
U1 ROM 16M/32M/64M-MROM MX MX23C1603-12A DMG-A6TE-0
U2 Mapper MBC-5 Nintendo MBC5
U3 RAM 64K-SRAM Sharp Week 21 2000 LH5164AN-10L
U4 RAM Protector MM1134A Atmel 028 134A

Pokemon Pinball




Case Stamp: 22


Board Sort: DMG-A04-01


  Chip Board Label Mfr. Date Chip Label
U2 MBC MBC5 Week 33 1999 LZ9GB31
U3 RAM 64K SRAM Sharp Week 9 1999 LH5164AN-10L
U4 RAM Protector MM1134A Atmel

Additional Studying

Source Link

What's Your Reaction?
In Love
Not Sure
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top