← back to posts

GoMulator - Game Boy Emulator in WebAssembly

I built a Game Boy emulator in Go that runs in the browser using WebAssembly.

GoWASMEmulator

I built a Game Boy emulator in Go that runs in the browser using WebAssembly — you can play a Game Boy ROM directly on this page. It’s still a work in progress, with a few graphical bugs left to squash.

Features

Try it yourself

Upload a Game Boy ROM file below and start playing — the emulator runs original DMG games right in the page. It’s dressed up as a molded pocket handheld: tap ⚙ MENU on the screen bar to recolor the shell, buttons, and D-pad or toggle scanlines, and your choice is saved in the browser.

POWER DOT-MATRIX
GOMULATOR pocket system
B X
A Z
SELECT·TAB
START·ENTER

Controls

You can also use the on-screen D-pad and buttons — they respond to both mouse and touch, so it plays on phones too.

Technical Details

The emulator is written in pure Go. Check out the source code on GitHub.

Build Tags

The project uses Go build tags to support both native and WASM targets:

Performance

The WASM build runs surprisingly well, maintaining 60 FPS on most systems. The Go WASM runtime is efficient, and the emulator uses minimal allocations during gameplay.

Run the WASM core yourself

Everything is open source — the core, the WASM build, and the host page all live in the GoMulator repo. Building the self-contained browser package takes one command:

git clone https://github.com/Filip-Pajalic/gomulator
cd gomulator
make wasm

That drops everything into build/wasm/: the gomulator.wasm binary, the Go runtime (wasm_exec.js), a host page, and the emulator-iframe.html that actually runs the core. WebAssembly can’t be opened straight from file://, so serve the folder over HTTP:

cd build/wasm
python3 -m http.server 8080   # then open http://localhost:8080/

To drop it into your own page, point an iframe at emulator-iframe.html and hand it a ROM — the repo’s index.html is a minimal host page showing exactly how, and this post reuses that same approach behind the handheld shell above.

<iframe src="/emulator-iframe.html" title="Game Boy emulator"></iframe>
Thanks for reading.