Game Boy Cartridge emulation from a stm32f4 Development Board
C Python Makefile C++


Game Boy Cartridge emulation from a stm32f4 Development Board

I wrote about this project in my blog:


This project implements the emulation of a gameboy cartridge using a stm32f4 Development Board. A real gameboy can be connected to a stm32f4 running this software and load real roms as well as homebrew roms.

  • ROM Only and MBC1 Cartridges are implemented. See a full list at:
  • RAM emulation implemented. The contents will be erased upon powering off the stm32f4
  • Custom boot logo implemented. It will be shown only during the first boot.


In order to use a rom in the code, the file must be converted into a C array:

xxd -i | sed 's/unsigned/unsigned const/g' > tetris_rom.h


main.c: Main Program body.

Initialization of the GPIOs.

stm32f4xx_it.c: Interrupt handlers.

The interrupt handler for the rising flag trigger is defined here. It handles the read and write operations of the gameboy to the cartridge.

Custom logo Draws a logo on a window

Requieres pygame Converts a png logo image into a binary file to be used as a boot logo

Requieres pygame

./ dhole_logo2.png dhole_logo2.bin
cp dhole_logo2.bin logo.bin
xxd -i logo.bin > dhole2_logo.h
rm logo.bin


If some games don't run, or you get crashes at some points, it may be a timming issue (the timmings are very tight, and I believe they may need to be different on different hardware revisions). You can try goebish's branch which modifies the number of NOPs in the code.