Skip to content
Game Boy Cartridge emulation from a stm32f4 Development Board
Branch: master
Clone or download
Pull request Compare This branch is 3 commits ahead, 1 commit behind Dhole:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


##How to build project:

  1. mkdir Gameboy
  2. cd Gameboy
  3. git clone
  4. cd stm32f_GBCart
  5. Download STSW-STM32068 from and then cd to its directory
  6. unzip -d ~/Gameboy/
  7. cd ~/Gameboy/stm32f_GBCart/linker
  8. ./
  9. move your Gameboy rom into ~/Gameboy/stm32f_GBCart/roms
  10. cd ~/Gameboy/stm32f_GBCart/roms
  11. ./
  12. cd ..
  13. make

##How to program board (Linux): There's lots of ways to do this (just google it), but the way I prefer (from is below (others may require additional steps because my system has many packages installed from previous prjects I've worked on):

  1. Install QStlink2 ( from source or linked package
  2. run ```qstlink2'''
  3. connect your board to the PC
  4. click "Send..."
  5. open ~/Gameboy/stm32f_GBCart/gbcart.bin
  6. Confirm Yes

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
You can’t perform that action at this time.