- Rust 82.4%
- HTML 9.2%
- JavaScript 5.7%
- Makefile 1.5%
- CSS 0.9%
- Other 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| core | ||
| games | ||
| sdl | ||
| wasm | ||
| web | ||
| .gitignore | ||
| LICENSE.md | ||
| Makefile | ||
| README.md | ||
Chip-8
My Chip-8 emulator written in Rust for both SDL2 and HTML5
https://github.com/aquova/chip8
This is not meant to an efficient, or really even a used emulator. I have always been curious about emulator development, and figured I needed to start somewhere.
The games included in games are not of my own creation, they are from several different sources and included here for ease of use.
Usage
- SDL2: If cargo is installed, the emulator can be run via
cargo run path/to/gamefrom within the parent directory. - WASM: The wasm-pack build tool must be installed first. Then the WASM version can be run via the
build-wasm.shscript, then loading the webpage inwebin a webserver.
Limitations
-
The emulator is quite buggy, I'm pretty sure the math on some opcode is wrong somewhere.
-
The WebAssembly build also doesn't handle random number generation correctly, so many games will have the same random element chosen every time
Resources
-
Greatly helped with emulator development: http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/
-
JavaScript code for the WebAssembly build heavily inspired from here: https://github.com/ColinEberhardt/wasm-rust-chip8
-
Helped with disassembler opcode syntax: http://devernay.free.fr/hacks/chip8/C8TECH10.HTM#4.0
-
Opcode reference: https://en.wikipedia.org/wiki/CHIP-8
-
c8_test.c8 is a test ROM from here: https://github.com/Skosulor/c8int/tree/master/test