Skip to content

shadeyg56/chip8-emulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chip8-emulator

A simple CHIP-8 Emulator in pure C + SDL2

What is CHIP-8?

CHIP-8 is an interpreted programming language that can only run on a CHIP8 virtual machine. In theory, this is more of an interpreter than an emulator, but they always get called emulators.

CHIP-8 Architecture

  • Memory: 4 KB of RAM
  • Display: 64 x 32 monochrome (the emulator scales up to 8x)
  • 16 general purpose 8-bit register VF - V0
  • 1 index register "I" to point to memory addresses
  • A stack of up to 16 16-bit values
  • Delay timer
  • Sound timer
  • Psuedo register program counter that points at current instruction in memory
  • Psuedo register stack pointer that points at current location in the stack

Important Info

This emulator can run any .ch8 ROMS.

Please note that due to discrepancies in interpreters some ROMS may not run as intended.

Build

Code can be compiled using

gcc main.c chip-8.c screen.c "-ISDL2\include" "-Iheaders" "-LSDL2\lib" -lmingw32 -lSDL2main -lSDL2 -o main.exe

Run

Run the program using

main.exe /path/to/rom

TODO

  • Audio

Acknowledements

I used this guide for all of the info on the architexture and CPU instructions

About

A simple CHIP8 Emulator in pure C + SDL2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages