Tuff Virtual Machine is a Rust implement of the CHIP-8 interpreter.
Tuff is a collection of CHIP-8 toolchain projects, written in Rust, as my practice project. Tuff Virtual Machine is one of them.
- Full CHIP-8 instruction set
- Configurable CPU frequency (default 500Hz)
- Real-time debug display (registers, stack, PC, timers)
- Audio output
- Windowed rendering
- Supports
.ch8ROM files
Check the Releases page for pre-built executables (currently only Windows x64).
If your platform is not provided, you can build from source.
Then type path/to/tuff_virtual_machine -h to check what you can do with it.
- Rust (latest stable toolchain recommended)
- Cargo
git clone git@github.com:MimiRabbit87/tuff_virtual_machine.git
cd tuff_virtual_machinecd path/to/local_repository_cloned
cargo run -- -r path/to/your_rom_file.ch8For debug build:
cd path/to/local_repository_cloned
cargo buildFor optimized release build (much faster, recommended for regular use):
cd path/to/local_repository_cloned
cargo build --release| Option | Description |
|---|---|
-r, --run <PATH> |
Path to the CHIP-8 ROM file to run |
-f, --frequency <HZ> |
Set CPU frequency (in instructions per second). Default is 500. Use 0 for unlimited (unstable) |
-i, --with-debug-information |
Show debug information (registers, stack, timers) on the terminal |
--no-vertical-synchronization |
Disable 60Hz frame sync (may cause rendering to be too fast) |
-h, --help |
Print help message (use --help for detailed help) |
-V, --version |
Print version information |
-
For best performance, always build with
--releasewhen playing games. -
Frequencies above
2KHzmay cause high CPU usage and system instability. Use with caution.
Tuff Virtual Machine passes the following Timendus test ROMs:
-
1-chip8-logo.ch8
-
2-ibm-logo.ch8
-
3-corax+.ch8
-
4-flags.ch8
-
5-quirks.ch8
-
6-keypad.ch8
-
7-beep.ch8
Feel free to open issues or pull requests. Suggestions and improvements are welcome.
This project is licensed under the MIT License – see the LICENSE file for details.