This project is a CHIP-8 emulator written in Go. The CHIP-8 is an interpreted programming language, developed by Joseph Weisbecker, used on some early computers. This emulator can load and run CHIP-8 ROMs, providing a graphical and audio interface for the games.
- Emulates the CHIP-8 CPU and its instructions.
- Loads and runs CHIP-8 ROMs.
- Provides graphical output using SDL2.
- Handles input from the keyboard.
- Plays sound using SDL2.
- Go (version 1.13 or higher)
- SDL2 library
- Clone the repository:
git clone https://github.com/rinald/chip8.git
cd chip8
- Install SDL2:
- macOS:
brew install sdl2
- Ubuntu:
sudo apt-get install libsdl2-dev
- Windows: Download and install from the SDL2 website.
- Build the project:
go build -o chip8 main.go
- Run the emulator with a CHIP-8 ROM:
./chip8 -rom roms/pong.ch8 -delay 2
- Use the following keys to interact with the emulator:
1 2 3 4
Q W E R
A S D F
Z X C V
- Press
ESC
to quit the emulator.
chip8/
├── cpu/
│ ├── cpu.go
│ ├── decode.go
│ └── instructions.go
├── graphics/
│ ├── audio.go
│ ├── graphics.go
│ └── render.go
├── rom/
│ └── rom.go
├── main.go
└── README.md
- cpu/: Contains the CPU implementation and instruction decoding.
- graphics/: Handles graphics rendering and audio playback using SDL2.
- rom/: Manages loading of CHIP-8 ROM files.
- main.go: The entry point of the emulator.