- C 70.5%
- Rust 26.4%
- Makefile 1.7%
- Nix 1.4%
|
niftyborg
c10fcdd0f9
Add assembler generation and encoding
Add machine instruction generation along with utilities that facilitate generating encodings and validating correct arity, labels are not yet supported |
||
|---|---|---|
| examples | Add assembler generation and encoding | |
| reference | Add README, add technical reference | |
| src | Add assembler generation and encoding | |
| .gitignore | Update README and emulator | |
| .rustfmt.toml | Add functionality for chip8 emu, test roms 1-4 | |
| flake.lock | Update README and emulator | |
| flake.nix | Fix issue with failed compilation | |
| LICENSE | Update README and emulator | |
| makefile | Add disassembler | |
| README.org | Update README with public repo name | |
| rust-project.json | Add project base | |
Ergo Pixie
Chip8 Emulator
A Chip8 Emulator written in the Rust programming language without the Rust's
std or alloc libraries. Early iterations of the project used a modified
version of the core library but I felt that was too unique a configuration for
others to setup.
This was a experiment in building emulators and seeing how well Rust without
std and alloc, served as a wrapper for libc functionality. Please feel
free to ask me about it if you are interested, I'm still figuring out
creating/publishing articles. But in a few words, pattern matching was amazing.
Requirements
rustc through rustup
rustup toolchain add nightly-2025年01月31日 --profile minimal
For NixOS systems, or linux distributions with Nix:
- Rust nightly, preferrable 1.86 (not included in flake)
- Nix
rustc(Nightly, tested on 1.86; newer versions may work)
For other linux systems:
rustc(Nightly, tested on 1.86; newer versions may work)pkg-configgnumakeraylibxorg.libX11(this may or may not be needed, or may already be installed)
A rom:
My favorite from the Chip8 Archive.
,#+begin_src shell wget "https://johnearnest.github.io/chip8Archive/roms/slipperyslope.ch8"
#+end_src
Usage
NixOS or Nix-enabled linux distributions:
nix develop
make -B # optionally "make -B RELEASE=1" for release build
./build/debug/chip8
For other linux distributions:
make -B # optionally "make -B RELEASE=1" for release build
./build/debug/chip8
ROMs
ROMs are needed otherwise you won't be able to run the emulator.
Great resources: John Earnest Chip8 Archive
Acknowledgements
The following resources were a wealth of information, and a great help for testing the emulator for correctness.