Skip to content

mahsumurebe/chip-8-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CHIP-8 Interpreter/Emulator

GitHub go.mod Go version GitHub all releases

issues-open issues-closed license

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

Building

Requiretments

In order for you to compile, the SDL library must be defined on your computer. You must use mingw compiler to building for windows.

Install SDL

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 .

Linux

CGO_ENABLED=1 CGO_LDFLAGS="-lSDL2" GOOS=linux GOARCH=amd64 CC=gcc go build -tags static -ldflags -o ./bin/chip8 .

Games

You can download here

How To Run ?

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

Thanks

Thank you very much to Mehmet Okan Taştan, who was with me during the development process.