04
A full CHIP-8 emulator and debugger, built to understand how computers actually work.
Chip8 Emulator
CHIP-8 is an interpreted programming language from the 1970s, designed to make game development easier on early microcomputers. Writing an emulator for it is a classic exercise in low-level programming — you implement the CPU, memory model, display, input, and timing from scratch.
This was a university project. The goal was to understand the mechanics of emulation: opcode decoding, register management, stack operations, and the relationship between the host system's timing and the emulated clock speed.
The Problem
Most CHIP-8 emulators available as reference implementations are written in JavaScript or Python, which obscure the low-level details behind abstractions. Writing it in C++ and SDL2 meant confronting those details directly.
Implemented the full CHIP-8 instruction set (35 opcodes) in C++ with a fetch-decode-execute loop.
Used SDL2 for display rendering (64×32 monochrome), keyboard input mapping, and audio (the single-tone buzzer).
Built a simple debugger view that renders register state, the current stack, and the last 10 executed instructions.
Validated correctness against a suite of public CHIP-8 test ROMs before testing with actual games.
Outcome
The emulator runs all standard CHIP-8 programs correctly, including Pong, Space Invaders, and Tetris. The debugger made it straightforward to trace timing bugs in games that depend on the 60Hz display tick.




Stack