layout: ../../layouts/Layout.astro

Remember the 90s? Back when you needed a clumsy worm-light taped to your Game Boy just to see Super Mario jump into a pit? Good times. Today, we are going to absolutely ruin that nostalgia by cramming a full retro emulator onto a piece of silicon the size of a postage stamp.

If you’ve ever looked at a pile of jumper wires and thought, “I bet I can play Tetris on that,” you are in the right place. We aren’t even going to wire up a screen. That’s right—we are going completely headless, streaming the game’s video buffer over Wi-Fi straight to your browser.

How is this even possible?

The ESP32 Development Board is an absolute beast. With its dual-core 240MHz processor, it actually has more than enough horsepower to run a Game Boy emulator (like GNUboy).

Instead of outputting the video to an I2C OLED Display, the ESP32 will act as a WebSocket server. It takes the game’s 160x144 pixel framebuffer, compresses it slightly, and blasts it over your local Wi-Fi network at 60 frames per second.

The Setup

  1. Flash the Firmware: You’ll need to upload the emulator firmware and the ROM file (legally acquired, of course) into the ESP32’s SPIFFS or a Micro SD card (see Lesson 146 for SD card logging basics).
  2. Connect to the Network: When the ESP32 boots, it hosts a local web page (just like we did in Lesson 153).
  3. Play the Game: Open your phone or laptop browser, navigate to the ESP32’s IP address, and the web page will render the video stream onto an HTML5 canvas. You can even use on-screen touch controls to play!

It’s impractical, it’s prone to lag, and it’s completely unnecessary. In other words, it is the perfect weekend electronics project.