Writing a Game Boy Emulator in OCaml
summary
CAMLBOY is a Game Boy emulator written in OCaml that runs in the browser and aims to boot real cartridges like Pokémon. Implementation focuses on a functor-based CPU that depends on a bus interface so the CPU can be unit-tested with a mock bus, avoiding tight coupling to cartridge, RAM, and IO devices. Instruction decoding uses GADTs for instruction typing to express varying argument and result types, and the project shows concrete design choices and tradeoffs that make testing and correctness tractable.
AI-written summary · about
chapters (8)
- 0:00Introduction and motivation
- 2:08Understanding emulators
- 4:13Addressing tight coupling
- 6:51Applying OCaml functors
- 9:01Instruction set challenges
- 12:32Implementing GADTs
- 15:21The learning cycle
- 16:51Criteria for projects
related talks
18mEmulating the Nintendo Game Boy CPU with Elm
26mAn Invitation to OCaml
46mOCaml for Fun & Profit: An Experience Report
01h 18mA Tale of Two Lambdas: A Haskeller's Journey into OCaml
23mHigh-Performance Hardware Design with Hardcaml
32mEffective Programming in OCaml
01h 02mDown the Oregon Trail with Functional C#
51mBuilding Distributed Applications in OCaml
