Mike's Program

My Chip-8 Emulator March 13, 2025

About

This project is a basic command-line program that loads and runs chip-8 ROM files.

Take a look at the Github Repo or a Demonstration on Youtube.

I am looking for work! Check my contacts.

The Project

I started this project to become more familiar with Rust.

Previously, I went through the nand2tetris course, where you build a simple computer from the ground up, starting with NAND gates and ultimately running Tetris on your own custom-built operating system.

I thoroughly enjoyed that course but didn't explore low-level programming or architecture further, as my focus shifted primarily to web development. Now, however, I'm returning to this domain, and the Chip-8 specification seemed like a perfect starting point.

Using Cowgod's technical reference along with a handful of other sources, I began the project. Rust made certain aspects straightforward, especially with tools like pattern matching, though some parts felt unintuitive—and still do. I'm fairly confident that continuing to use the language for larger and more complex projects is the best way to overcome that initial discomfort.

Structuring the CPU was relatively straightforward and closely mirrored the technical specification. My main objective was to write idiomatic Rust code. I'm not entirely sure I've achieved that high standard, but it was a priority throughout the development process.

Built With

Running the Emulator

Clone or download the repository and follow the instructions below.

Prerequisites

This program was written in rust and requires cargo to build.

Installation

cargo install

Controls

The original Chip-8 keypad has been mapped to the following keys on your keyboard:

Original CHIP-8 Emulated CHIP-8
1 2 3 C 1 2 3 4
4 5 6 D Q W E R
7 8 9 E A S D F
A 0 B F Z X C V

Controls for Airplane.ch8

The goal is to hit the ground with the payload without hitting any of the planes below.

Controls for Cave.ch8

The goal is to reach the end without hitting the walls.

Usage

To play a game, run the following command from the root directory

cargo run .\roms\games\Airplane.ch8

or:

cargo run .\roms\games\Cave.ch8

Tests

To see unit test output run:

cargo test

or try one of the test roms:

cargo run .\roms\test\test_opcode.ch8

Contact

Micheal Earl
@m-earl.bsky.social
LinkedIn
Email: [email protected]

Acknowledgments

© 2025 Micheal Earl