Writing a Game Boy compiler in Forth
summary
A Forth-based compiler for Game Boy emerges from incremental reverse engineering: starting from a hello world ROM, raw bytes get decoded into an assembler, then into a simple Forth compiler that emits Game Boy opcodes. The project uses byte-level inspection, tables of CPU instructions, and pattern extraction to implement primitives, a terminal/font library, input and sound, and even port a tiny game with only a few edits. The toolchain is published as gbforth and runs in Docker for easy testing.
AI-written summary · about
chapters (7)
- 0:00Introduction and motivation
- 3:54What is Forth?
- 6:23Reverse engineering ROMs
- 10:33Building a Game Boy assembler
- 13:03Writing a Forth compiler
- 15:50Expanding the Game Boy library
- 16:55Demo and open source
related talks
51mBuilding a Game Boy emulator in .NET Core!
35mBuilding a GameBoy emulator with Elixir and Scenic
39mThe Day I Reverse Engineered a Gameboy Advance Game
06mBattery-free GameBoy
01h 20m“Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
31mHow to Write a Self-Hosted Go Compiler from Scratch
51mTinyGo, small but mighty! 💪
39mIs Go A Good Language to Build Compilers?
