Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.33 KB

README.md

File metadata and controls

41 lines (32 loc) · 1.33 KB

A Chip8 Emulator in Rust

I wrote this little emulator because I'm still riding the high from last semester's CompArch class, and also because I wanted to try out Rust.

Demo of the emulator

Usage

There are three programs in this package, the emulator and an assembler/disassembler for the instruction set.

The Emulator

You can run the main emulator with cargo:

cargo run --bin chip8 -- --rom <PATH/TO/ROM>

Additional arguments:

-f, --frames <FRAMERATE>       Number of frames to render per second [default: 100]
-r, --rom <ROM>                The ROM to load
-c, --cycles <TICK_PER_FRAME>  Number of instructions to execute per frame [default: 8]
    --no-keypad                Disable keypad rendering
    --smpte                    Enable SMPTE color mode
-h, --help                     Print help

The Assembler

The program takes a text file and outputs a hex file. Usage:

cargo run --bin asm <PATH/TO/SOURCE> <PATH/TO/OUTPUT>

The Disassembler

Similarly, the program takes a hex file and outputs a text file. Usage:

cargo run --bin deasm <PATH/TO/SOURCE> <PATH/TO/OUTPUT>

Acknowledgements

The included ROM folder is taken from https://www.zophar.net/pdroms/chip8/chip-8-games-pack.html

Some code is inspired by https://github.com/cmleon51/cli-chip8-emulator.rs