Skip to content

KavinTheG/chip8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chip8

This repository contains my code for a CHIP-8 interpreter written in C. This project is capable of interpreting every chip8 instruction and executing the appropriate function. The following features are includes in this project:

  • 4K memory
  • 16 general purpose registers
  • 16-bit index register used to store memory addresses
  • delay and sound timers
  • 16-bit program counter register used to keep track of program instruction
  • 2048 element char array used to display graphics in conjunction with the SDL2 library.

Prerequisite

The following items are required for this program to function:

  • gcc/clang
  • SDL2

Usage

Proceed through the following steps to make use of this project and play some chip8 games!

Git clone the repository with the following command:

git clone https://github.com/KavinTheG/chip8.git

Change directory to my chip8 project directory

cd chip8

Enter the following command to build the project

Make

This will create a binary file capable of running chip8 games. You can view this in the ./bin/ folder. I have two chip8 rom files included in ./roms/ which may be ran by executing the following command.

bin/chip8 roms/Space\ Invaders\ \[David\ Winter\].ch8

Keyboard mapping

The two tables below display how I implemented the mapping from the chip8 keypad to a typical keyboard. Essentially the left half of the keyboard is used to play gammes.

CHIP-8 CHIP-8 CHIP-8 CHIP-8
1 2 3 C
4 5 6 D
7 8 9 E
A 0 B F
Keyboard Keyboard Keyboard Keyboard
1 2 3 4
Q W E R
A S D F
Z X C V

Demo images

Space Invaders

Tic-Tac-Toe Invaders

Credit

The following resources provided much guidance in implementing this project.

About

Chip8 Emulator using C

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published