Skip to content

brunohkbx/Chip8

Repository files navigation

Chip8

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.

Dependencies for Running Locally

Basic Build Instructions

  1. Clone this repo.

Linux/Mac

  1. Make a build directory in the top level directory: mkdir build && cd build
  2. Compile: cmake .. && make
  3. Run it: ./Chip8 <rom_name>. You can choose one from the 23 public domain ROMs in the roms directory.

Windows

  1. Import the project on Visual Studio
  2. Run it passing a rom file as param

Controls

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

Testing the implementation

There are two roms that can be used to check the CPU:

./Chip8 ../roms/test/BC_test.ch8

./Chip8 ../roms/test/chip8-test-rom.ch8

Rubric points addressed

Loops, Functions, I/O

Rubric point Location
The project demonstrates an understanding of C++ functions and control structures. Yes, check all the files
The project reads data from a file and process the data, or the program writes data to a file. Memory and Beeper
The project accepts user input and processes the input. main

Object Oriented Programming

Rubric point Location
The project uses Object Oriented Programming techniques. Yes, check all the files
Classes use appropriate access specifiers for class members. Yes, check all the files
Class constructors utilize member initialization lists. Yes, check all the files
Classes abstract implementation details from their interfaces. Yes, check all the files
Classes encapsulate behavior. Yes, check all the files

Memory Management

Rubric point Location
The project makes use of references in function declarations. CPU
The project uses destructors appropriately. Renderer and Beeper
The project uses scope / Resource Acquisition Is Initialization (RAII) where appropriate. Yes, check all the files
The project follows the Rule of 5. Yes, check all the files

References

http://devernay.free.fr/hacks/chip8/C8TECH10.HTM#Ex9E

http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/

https://www.youtube.com/watch?v=rpLoS7B6T94

https://austinmorlan.com/posts/chip8_emulator/

Screenshots

Space Invaders

Space Invaders

BLINKY

BLINKY

About

Udacity C++ nanodegree capstone project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published