HeadlinesBriefing favicon HeadlinesBriefing.com

Fame Boy: A Functional Game Boy Emulator that Runs on Desktop and Web

Hacker News •
×

Pioneer Nick Kossolapov turned eight years of software work into a personal quest: building a Game Boy emulator in F#. After mastering NAND‑to‑Tetris and a CHIP‑8 prototype, he spent nights coding Fame Boy, a dual‑platform engine that delivers sound, graphics and accurate timing for desktop and web and performance tests every day he uses it to refine.

Fame Boy keeps a clean split between core and UI, exposing only a 160×144 framebuffer, a 32 768 Hz audio ring, and two callbacks. The CPU mimics the Sharp LR35902, interacting only with a memory map and an IO controller, while memory, VRAM and timers sit in shared structs for speed during every emulation tick they synchronize precisely ensuring.

Choosing F# wasn’t a gimmick; its discriminated unions let Kossolapov collapse 512 opcodes into 58 typed instructions, preventing illegal states at compile time. The stepper orchestrates CPU, APU and PPU cycles, batching four APU ticks per CPU cycle and keeping the 60‑FPS frame rate in sync with the 17 500 CPU‑cycles target per second ensuring smooth.

Beyond nostalgia, Fame Boy demonstrates that functional languages can deliver performant, type‑safe emulation. By exposing a minimal, well‑typed API, Kossolapov invites web developers to run classic games in the browser without native binaries. The project closes the gap between academic understanding of hardware and practical, reusable software tools for educators and hobbyists in the tech community.