An emulator of the Chip 8 interpreted language in Go.
Under MIT license.
gochip8 <flags> path/to/rom
Flags
-disassemble
instead of running the rom, print an explanation of each opcode to stdout-scaling 10
factor to scale from original Chip 8 resolution (64x32), defaults to 10 for a window size of 640x320-cycles 10
number of steps to attempt to emulate per loop
A collection of games, understood to be in the public domain are in the games
directory.
The Chip 8 has a hexidecimal keyboard which is bound to these keys:
1 2 3 4
Q W E R
A S D F
Z X C V
Go installation and C compiler required
Requries SDL2 library, usually available in your systems package manager,
Ubuntu
apt-get install libsdl2
Mac OSX
brew install sdl2
Windows
Install the MinGW development build of SDL2, ensure you have a 64bit MinGW toolchain.
The only Go dependency is the SDL2 bindings:
go get -v github.com/veandco/go-sdl2/sdl
go build
will build an executable, to run on Windows you must have the SDL2.dll in the same path as the executable or in the system path.
The aim for testing is to have at least one unit test per instruction to verify correctness of the program. Some instructions still require a unit test.
Run go test -cover ./chip8
.
Built using Reference.html found here, a copy is also included.
Wikipedia also has a good article on Chip 8.