The original Game Boy was a smash success for Nintendo and has an amazing collection of games. You might relive some childhood nostalgia by booting up a Game Boy emulator, but to really get the full experience you’ll need the battery-draining green-tinted original hardware. Thanks to modern technology you can also load all of the games at one time on the original hardware with this STM32 cartridge that fits right in.
The device can load any Game Boy game (and homebrews) and ROMs can be sent to the cartridge via USB. There were are a lot of hurdles to getting this working properly, the largest of which is power management. A normal cartridge has a battery backup for save data, but using a small coin cell to run an STM32 would kill the battery quickly. To get around that, the cartridge writes the states to nonvolatile memory and then shuts itself off, although this has the side effect of crashing the Game Boy.
The creator of this project, [Emeryth], noted that we featured a similar project from [Dhole] a few years ago, also involving an STM32. [Emeryth] decided that it would be fun to build his own project anyway, and it’s certainly an interesting take on GameBoy hacking. He also has the files for this project available on his Git Hub page.
Very interesting project Emeryth, on 2017 i made a very similar cartridge to Atari 2600 and sell some units with the stm32f103 at 117MHz to make the costs low. To achieve 300ns of access on the worst case it was necessary to do all the rom emulation and bank switching on inline assembly. On the 2600 this task was easy with only three kinds of bank switching and it was possible to cover about 95% of the games with 32kB of emulated rom. Another problem I had was with the reset signal that wasn’t included on 2600’s the cart connector, the STM32 had less than 40ms to return from reset and do the rom emulation.
Everdrive + sd card is a breeze with gb…that one looks cool too especially if it avoids using a coin cell.
The only issue is the increased battery consumption :/
So the only problem is the time it takes for the microcontroller to detect the rising edge and work its magic?
That’s the easy part. The problem is that you have to time your reads and writes just right.
Sampling the bus too soon will give you the wrong address, for example.
Anyway, it’s not that hard at 1MHz. Now I’m trying to get it to work at twice the speed – for Game Boy Color games, and here it gets interesting.
Some years ago I thaugt it should be possible to use a µC to emulate GameBoy and SNES cartridges. After a closer look I came to the conclusion it would not be possible because of the timing problem.
It is very impressing to see that one has now managed to use a µC! Respect!
As it not used as flash memory I guess there should be no wear and tear.
Concerning the 3.3V logic level, while it should work, it is maybe not such a good idea. All current flash cards use level shift IC to adapt 3.3V to 5V. In the scene this page is usually named as reference:
https://db-electronics.ca/2017/07/05/the-dangers-of-3-3v-flash-in-retro-consoles/
I personally have an Everdrive clone “EDGB” from Aliexpress (~30€) which used – as far I understand the chips – the 74LVT16224SB for the adaption.
An Altera Max II CPLD is used to copy the roms from SDC to the flash which takes some time, especially for GBC roms.
The last few month new flashcards came to the market which are using FPGAs and have much faster loading times.
The Everdrive X7 is the high end solution but also costs a lot (~130€). At the moment I’m not sure how the fast loading speed is realized, if they use RAM or a fast flash module.
Then there is the EZ Flash Junior which supports a RTC, the firmware is pretty young and some features are still missing. But it seems to be available on aliexpress for about 40€.
It would be interesting in which price region the STM32 cartridge would be. I personally play my gameboy games only once per year, so I was not willing to invest more than 30€.
On the oder side, I very often play with my SNES – bought the SD2SNES (now called FXPAK) directly from krikzz for about 200€.
That whole article boils down to “these cards are not 5V input tolerant”. The STM32 however, is designed to be 5V input tolerant.
The real question then remains, is the GB 3.3V input tolerant, or are you living on the edge there. But there are most likely no specs about that.
That link is… frighteningly bad. “[W]hen the console outputs 5V into a 3.3V input the extra voltage must go somewhere”? Yeah. Um. No. That’s not how logic inputs work (that’s not how *electricity* works, but, besides that). I mean, the general idea of “don’t shove higher voltages into a chip willy-nilly” is a “duh” thing, but with the right FET I can shove voltages well above the drain and it’s not going to give a damn.
It’s just a question of whether or not the input has a protection diode to Vcc on it, and whether it’ll start conducting at 5V or not. The STM32’s 5V tolerant inputs don’t have a diode – they can take up to Vdd+4V and they won’t inject any current.
“Thanks to modern technology you can also load all of the games at one time”
Playing all the games at once would certainly be a challenge!
B^)
Particularly when they’re all tiled on screen and it’s one pixel per game.
Nice! I did some research on this many years ago, my idea was to store games on SD and copy the one you wanted into fast SRAM for the GB to access. The largest Game Boy (Color) game ever released was the Japanese “Densha de Go! 2”, a train simulator, which clocks in at 8 megabytes. It even has voice acting, and video!
Wow, never knew about that!
Wait, so is this worth looking at getting right now? Or does that battery backup for save data issue still need to be ironed out?
Yes, it could use fixing. Ideally the cart would save its state automatically when you turn off the console.
Right now you have a “save and quit” button on the cartridge.
“Battery-draining”… The original Gameboy could go virtually forever on a set of batteries…
Back in the day when the GB was as new, my grand father turned up after a far east business trip with a 500 in 1 game cart.
Until then, all we’d been playing was tetris. Now we could play everything !