In my attempt to learn more C and get my feet wet with Emulator Development I started writing a Gameboy Emulator...which ended in this project. Realizing that the Gameboy was too ambitious initially I started cretro, a fully featured chip 8 emulator which also includes keybindings and sound.
Here is the Emulator running snake!
As this project uses Linux/POSIX APIs, namely pthread.h
and sys/time.h
the project will only work on Linux right now.
However, if you are using Windows, using WSL2 works fine.
This project uses gcc, make and SDL2. Go check them out if you don't have them locally installed.
On Debian-based systems you can run the following to install the dependencies
$ sudo apt update
$ sudo apt install -y build-essential libsdl2-dev make
git clone https://github.com/benzammour/cretro.git
mkdir build
cd build
cmake -G Ninja ..
ninja
ninja install-bin
It can be removed using ninja uninstall-bin
.
To run a ROM, pass the path into cretro
, right after your configured clock-delay (in milliseconds):
./cretro [-d <0..4>] [-f <FREQUENCY>] <ROM>
An example would be
./cretro roms/bat.ch8
To initially test the emulator, I created the bat.ch8 ROM for you:
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/cool-feature
)git commit -am 'Add some cool-feature'
)git push origin feature/cool-feature
)Distributed under the MIT License. See LICENSE
for more information.
Samir Benzammour - @benzammour - hi (at) benzammour (dot) com