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.
There are three programs in this package, the emulator and an assembler/disassembler for the instruction set.
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 program takes a text file and outputs a hex file. Usage:
cargo run --bin asm <PATH/TO/SOURCE> <PATH/TO/OUTPUT>
Similarly, the program takes a hex file and outputs a text file. Usage:
cargo run --bin deasm <PATH/TO/SOURCE> <PATH/TO/OUTPUT>
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