Hack The Planet!

Game Boy emulator in Go

29 Aug 2025

A few weeks ago my friend Ilja rekindled my interest in learning the Go programming language. I first heard about Go many years ago. What piqued my interest is that it appears to be a simple yet powerful language, like C, but with some modern features like package / module management and garbage collection. I like how it produces a single binary (like C) and that it has cross platform capabilities built into its compiler and toolchain. Its concurrency features in the form of so called goroutines are praised as well, but I have not yet had a reason to look into that.

I believe the best way to learn a new programming language is to actually build something with it. Otherwise what’s the use learning it? It is a tool, a means to and end after all. And this is what kept me from looking into Go. I didn’t know what to build with it. Until a few weeks ago while playing with some retro game emulators in RetroArch. I’ve always been interested in how emulators work and I gathered some resources over the years (which subsequently got out of sight, out of mind as these things tend to do) to help me understand how they work and how to build one.

And so I decided to build (or port :p) a Game Boy emulator in Go. Here are some of the resources I’m using:

I’m not very far yet, but I have the basic project structure down and using the Simple DirectMedia Layer (SDL) I’m already able to get some pixels on the screen using some boilerplate code. Now I’ve started work on emulating the Game Boy CPU which involves the tedious task of implementing all the opcodes.

You can check out the source code here.

–m