Chip8 disassembler and interpreter written in C99
The disassembler uses a recursive traveral algorithim to find all opcodes in the program, and labels all found branch loactions.
The disassembler has no dependencies and should compile as is on Linux / MacOS (Tested).
mkdir build
cd build
cmake ../disassembler && make
./chip8-dis /path/to/rom
-o print opcodes in hex
-a print the address of each opcode
A Lot of the chip8 programs I have encountered utilize self modifying code, so static disassembly is not perfect.
The interpreter uses opcode hashing with a table of function pointers for performance and is entirely functional with the exception of sound.
Install SDL2 through the package manager of your choice and then
mkdir build
cd build
cmake ../interpreter && make
Tested on MacOS but should work fine on Linux as well.
./chip8-emu /path/to/rom
Keys 0-f are mapped to each row of the first four keys on the left of a QWERTY keyboard. (0 -> 1, 4 -> q, 8-> a, etc.)
-c DESIRED_CYCLE_COUNT the number of opcodes to execute per second (default is 500)