CHIP-8 is an interpreted programming language, developed by Joseph Weisbecker. It was initially used on the COSMAC VIP and Telmac 1800 8-bit microcomputers in the mid-1970s. CHIP-8 programs are run on a CHIP-8 virtual machine. It was made to allow video games to be more easily programmed for these computers. Wiki
In order for you to compile, the SDL library must be defined on your computer. You must use mingw
compiler to building
for windows.
CGO_ENABLED=1 CGO_LDFLAGS="-lmingw32 -lSDL2" CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -tags static -ldflags "-s -w" -o ./bin/chip8.exe .
CGO_ENABLED=1 CGO_LDFLAGS="-lSDL2" GOOS=linux GOARCH=amd64 CC=gcc go build -tags static -ldflags -o ./bin/chip8 .
You can download here
To start a game, define the rom path to the first argument of the compiled binary.
Example:
./bin/chip8.exe games/PONG
PS: ROM files should be located under the directory where you run the binary file. Below is an example directory tree for the example above.
.
|-bin
|---chip8.exe <-- Binary file
|-chip8
|-games
|---PONG <-- ROM
Thank you very much to Mehmet Okan Taştan, who was with me during the development process.