All Projects
CHIP-8 Emulator
A CHIP-8 virtual machine interpreter written in C that runs classic 8-bit games and programs from the 1970s–80s era.
A CHIP-8 emulator built from scratch in C. CHIP-8 is an interpreted programming language from the mid-1970s, originally designed for the COSMAC VIP and Telmac 1800 microcomputers. This project implements the full virtual machine, capable of running classic ROMs like Breakout and Rock-Paper-Scissors.
How It Works
CHIP-8 programs are loaded into memory and executed instruction by instruction. The emulator fetches a two-byte opcode, decodes it, and executes the corresponding operation—handling everything from drawing sprites to processing keyboard input.
The virtual machine includes:
- 4KB of memory with programs loaded at address
0x200 - 16 general-purpose 8-bit registers (V0–VF)
- A 64×32 pixel monochrome display
- A 16-key hexadecimal keypad for input
- A delay timer that counts down at 60Hz
Key Features
- Full opcode support for the standard CHIP-8 instruction set
- Display rendering with a 64×32 monochrome framebuffer
- Input handling mapped from a modern keyboard to the CHIP-8 hex keypad
- Timer emulation running at the correct 60Hz frequency
- ROM loading supporting standard
.ch8binary format
What I Learned
This project deepened my understanding of:
- How CPUs fetch, decode, and execute instructions
- Memory-mapped I/O and display systems
- Emulation concepts like cycle timing and input polling
- Binary file parsing and bitwise operations in C