brew install sdl2
sudo apt-get install libsdl2-dev
See the SDL2.0 development libraries section of the rust-sdl2 library for more information or to troubleshoot install issues.
cargo run
Play one of the locally installed games or checkout a visual demo/test in the games directory.
Enter a file path to upload a game locally from disk.
Enter an http/s url and download a game from a remote server. For Example,
https://johnearnest.github.io/chip8Archive/roms/snake.ch8
- standard - normal game play/speed
Hit the space bar at anytime to enter debug mode. Hit 'return' to re-enter standard mode.
- debug - run the game manually a single cycle at a time
Debug mode allows you to step through the game a single instruction at a time by hitting the space bar. This also produces a verbose output. The current parsed instruction as well as the current PC, I, and all V register state will be visible in your terminal.
Hit 'return' to exit debug mode and enter standard mode at anytime.
The original chip8 keyboard was a 16 key hexadecimal key pad. This has been mapped to the following modern keyboard layout.
chip8 keyboard
------- --------
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
Game play isn't the easiest to figure out. 2, S, Q, E sometimes is up, down, left, right. W starts games occasionally. I recommend downloading and starting with a classic game - snake.
This was mostly an exercise in Rust completed by a person learning Rust. I wanted to leverage lang features (traits, trait objects, etc.) in a somewhat less contrived manner than the examples/exercises in "the book". If you notice something particularly terrible about the code, please let me know.