Chip8 emulator written in C++ with SDL2 graphics library.
I made this project because I am interested in hardware emulation and I wanted to see how hard is it to make na emulator (even easy one like this).
Chip8 emulator can be installed simply by copying the following files anywhere you want.
- Chip8emu.exe
- Chip8lib.dll
- SDL2.dll
- SDL2_mixer.dll
- beepsfx.wav
You can download binaries from here: http://chip8.stibrany.com/Chip8emulator.zip
Original emulator had 16 keys which are mapped as follows:
CHIP8 KEYBOARD
1 2 3 C 7 8 9 W
4 5 6 D => 4 5 6 Q
7 8 9 E 1 2 3 E
A 0 B F A 0 S F
Every game may use different keys for control, but for example here is how to play the INVADERS:
Move Left = 4
Move Right = 6
Shoot = 5
However games nor programs are not included in this project, you can find some on the internet.
One such website is this:
http://www.zophar.net/pdroms/chip8/chip-8-games-pack.html
NOTE: Currently Chip8 emulator is compatible with Windows OS only.
To build the emulator, you need, apart from the source code, a open-source library called SDL (Simple DirectMedia Layer) of version 2.
This project has been developed using Visual Studio Community 2015 which is a free version of Visual Studio. For the most convenient way to build the emulator I recommend using Visual Studio.
- Go to https://www.libsdl.org/download-2.0.php
- Download Development Libraries
- Extract the ZIP somewhere. (My path is C:\Development\Dependencies)
If you haven't done so already, now we need to get the source code of the emulator.
Either:
- Download the ZIP archive
Or: - Open up git in console
- And type
git clone https://github.com/tstibro/chip8.git
Before we can build the solution, we need to setup Visual Studio so it knows
where our SDL2 library and it's source code is stored.
- Open Chip8emu.sln in Visual Studio
- Right-click on Chip8emu project
- Properties
- Select All Configurations in Configuration dropdown
- Go to Configuration Properties -> VC++ Directories
- Click on edit next to Include Directories
- And enter paths to SDL2 and SDL2mixer includes
My are:
C:\Development\Dependencies\SDL2_mixer-2.0.1\include
C:\Development\Dependencies\SDL2-2.0.4\include - Click on edit next to Library Directories
- And enter paths to SDL2 and SDL2mixer libraries
My are:
C:\Development\Dependencies\SDL2_mixer-2.0.1\lib\x86
C:\Development\Dependencies\SDL2-2.0.4\lib\x86 - Go to C/C++ -> General
- Click on edit next to Additional Include Directories
- And enter paths to SDL2 and SDL2mixer includes
My are:
C:\Development\Dependencies\SDL2_mixer-2.0.1\include
C:\Development\Dependencies\SDL2-2.0.4\include - Go To Linker -> Input
- Click on edit next to Additional Dependencies
- And add each on separate line like this:
SDL2.lib
SDL2main.lib
SDL2_mixer.lib - Done. Build the solution.
Beep Sound: https://www.freesound.org/people/unfa/sounds/215416
tiny file dialogs: Guillaume Vareille, http://tinyfiledialogs.sourceforge.net