Major Refactor: Make invalid states unrepresentable™️

- Rewrote the instruction decoder as an enum
- Used imperative_rs to auto-generate the bit twiddling logic
- Implemented Display on that enum, for disassembly
- Rewrote CPU::tick
  - Now >10x faster
  - Disassembly mode is still 5x slower though
- Implemented time-based benchmarking
  - (use option -S to set the number of instructions per epoch)
This commit is contained in:
2023-03-30 08:27:06 -05:00
parent 8ab9799913
commit cc3bc3a7fe
11 changed files with 200 additions and 661 deletions

View File

@@ -4,7 +4,7 @@ test:
cargo test --doc && cargo nextest run
chirp:
cargo run --bin chirp -- tests/chip8-test-suite/bin/chip8-test-suite.ch8
cargo run --bin chirp-minifb -- tests/chip8-test-suite/bin/chip8-test-suite.ch8
cover:
cargo llvm-cov --open --doctests