I’ve mentioned that we use hex addresses instead of just writing the decimal number and we know that there are 16 address lines (A0-A15) but let’s see how we visualise the conversion of hex to binary so that the appropriate address lines are set to 1 (high). So you can see how by having a MBC they overcame the issue of only being able to address 32K bytes.
You could have the main code in the first 16K bytes then ask the MBC to switch to the next 16K bytes because you might have an image on the 2 nd bank and then switch to the 4 th bank of 16K as you might have text there. We would then just re-read the same 16K address range and be presented with new 16K worth of data.įor example, we could have 8 banks x 16K bytes which gives us 128K bytes to work with.
In“0000h” and “7FFFh” the h stands for hexadecimal (hex) which is a way that’s used to express the addresses instead of just writing the decimal number you can convert to and from hex by using an online calculator or if in Windows by opening the calculator and choosing scientific mode.ģ2K bytes for a Gameboy game sometimes isn’t enough so what they were able to do is have multiple 16K ROM banks and have a chip (MBC) to change the ROM bank if we requested it. Note: you will see that 0000h to 00FFh is not really part of the ROM.
You can view the full list of addresses and what they correspond to here. These 16 address lines also control the Gameboy’s internal RAM, etc and so they decided to assign the addresses 0000h to 7FFFh for the Gameboy’s ROM Cartridge which gives us 32,767 bytes to work with. The Gameboy can only address 16bits (16 address lines: A0-A15) which means that the number of combinations of addresses is 2 ^ 16 = 65,536 with 1 byte for each address means that 65,536 bytes can be read/written to. These data lines can also be used to control which ROM bank to load (important for later).įor reading the ROM we are only interested in the WR, RD, A0-A15 and D0-D7 lines.
You can see it has 32 pins and those pin functions are:
I’ll now guide you in how to communicate with the Gameboy cartridge to read the ROM so without further delay, let’s begin! The thought came to me, how can I backup the save game from these devices? There are cart readers around but they seem to be harder to find in this day and age so I thought why not make one myself using the Arduino as it’s so versatile!īefore I begin looking into extracting the save games I’ll look into dumping the ROM which was a way for me to learn how to communicate with the Gameboy cartridge. Recently I’ve been collecting retro gaming consoles such as the Gameboy and SNES and whilst playing a game on the SNES I actually lost all my saves when I turned it off (turns out the battery got disconnected from the cartridge).