- Notifications
You must be signed in to change notification settings - Fork0
Chip-8 / Super-Chip emulator
ajor/chip8
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Play online athttp://ajor.co.uk/chip8
This code has only been tested on Linux, although it may work on other platforms provided the required dependencies are available.
- A C++11 compiler
- GLFW3
- GLEW (OpenGL Extension Wrangler)
Then compile using CMake:
mkdir buildcd buildcmake ../make
or just run:
g++ main.cpp chip8.cpp font_loader.cpp -std=c++11 -lglfw -lGLEW -lGL -lGLU -pthread -O3 -Wall -pedantic
- Emscripten SDK
- Node.js
Compile using CMake, substituting the path to the Emscripten.cmake toolchain file on your system:
mkdir buildcd buildcmake ../ -DCMAKE_TOOLCHAIN_FILE=/usr/lib/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Releasemake
./chip8 [options] romOptions: -i Instructions per step (default: 10) -s Screen scale factor (default: 20)
Place chip8.html and the generated chip8.js and chip8.js.mem files in the same directory and open in a web browser.
You can adjust the speed of the emulator by changinginstructions_per_step
(defaults to 10). This parameter represents the number of Chip-8 instructions executed per frame.
Assuming a frame rate of 60fps, aninstructions_per_step
value of 10 (or a little higher) works well for most Chip-8 games tested, but Connect4 needsinstructions_per_step=1
to be playable. Super-Chip games generally need to be run a bit faster - somewhere in the 20-60 range seems to work well.
Chip-8: QWERTY keyboard:1 2 3 C 1 2 3 44 5 6 D Q W E R7 8 9 E A S D FA 0 B F Z X C V
Pressing Enter resets the emulator.
- All Chip-8 and Super-Chip games tested appear to work correctly
- Stop using abort() everywhere
- Fix threading