“If I can be the best in the world at something, then I think it's worth a shot.” - Chihaya Ayase
A CHIP-8 emulator written in Clojure.
- CPU
- Display
- Input
- Sound
- Timers
- Sound timer is implemented but the buzzer doesn't work.
- CPU is missing the following instructions:
- SUBN Vx, Vy
- JP V0, addr
- LD Vx, K
- JDK 8
- Clojure
- Chip-8 font: follow instructions here.
$ clj -Auberjar
[uberdeps] Packaged target/chihaya-0.1.0.jar in 2786 ms
Pong: (SHA1: a60611339661e3ab2d8af024ad1da5880a6f8665)
$ java -cp target/chihaya-0.1.0.jar clojure.main -m com.unsafepointer.chihaya.core
Usage: chihaya [OPTION] ... <romfile>
-i, --instructions Output instructions to stdout
-f, --frequency FREQ 800 CPU clock rate
-h, --help
Chip-8 has no formally defined processor speed at all. Chihaya renderer is locked at 60 Hz, running whatever number of instructions have been defined using the --frequency
flag, which defaults to 800 Hz. Most games do best when you are running around 400-800Hz, but you have to check documentation per game.
corax89/chip8-test-rom: test_opcode.ch8 (SHA1: f1cfcffe1937ed6dd6eeed1a7f85dfc777bda700)
This emulator, like many others, is based on the Cowgod's Chip-8 Technical Reference v1.0. For ease of access and review purposes, relevant parts of the specification are pasted before the implementation.