Chip-8 was a virtual machine/programming language developed by RCA engineer Joseph Weisbecker in 1977 for the COSMAC VIP microcomputer. It was intended as a simple way to make small programs and games for the computer. Chip-8 soon spread to the other computers, like Finnish Telmac 1800, the Australian DREAM 6800, ETI-660 and MicroBee, and the Canadian ACE VDU.
The original Chip-8 was designed with the following specifications:
- Memory: Chip-8 has direct access to up 4KB RAM
- Display: 64x32 pixels monochrome, ie. Black or White
- Keypad: 16 keys, labelled
0
throughF
, and were arranged in a 4x4 grid. - A program counter, often called "PC", which point at the current instruction in memory
- One 16-bit index register called "I" which is used to point at locations in memory
- A stack for 16-bit addresses, which is used to call subroutines/functions and return from them
- An 8-bit delay timer which is decremented at a rate of 60Hz (60 times per second) until reaches 0
- An 8-bit sound timer which functions like the delay timer, but which also gives off a beeping sound as long as it's not 0
- 16 8-bit(one byte) general-purpose variable registers numbered
0
throughF
hexadecimal, ie. 0 through 15 in decimal, calledV0
throughVF
VF
is also used as a flag register; many instructions will set it to either1
or0
based on some rule, for example using it as a carry flag
- SDL2:
- Minimum version required: 2.24.2
- Required for rendering and input management.
- CMake:
- Minimum version requiered: 3.21
- Required for automatic build.
For building, you can use this procedure:
$ mkdir build
$ cmake -B build -DCMAKE_BUILD_TYPE=Release
$ cmake --build build
Note: Not tested, for while, there is no build procedure.
After building with above procedure, the binary will be located in build/bin/
directory.
Run the program using:
$ ./build/bin/Chip8 <path-to-rom>
I don't know.
There are some test roms located in roms
directory, you can use them. :)
long | short | value | description |
---|---|---|---|
clock | c | int | Set cpu clock speed(0-1000). |
width | int | Set window width to desired resolution | |
height | int | Set window height to desired resolution | |
help | h | Show help message and then exits. | |
verbose | v | Enable log output on terminal. | |
quiet | q | Disbale log ouput on terminal. |
Note: For while, the cpu screen will be stretched to the current resolution.
1
2
3
4
Q
W
E
R
A
S
D
F
Z
X
C
V
1
2
3
C
4
5
6
D
7
8
9
E
A
0
B
F
- Graphical user interface.
- Keyboard shortcuts for opening, reseting and exiting the emulator.
- Cowgod's Chip-8 Technical Reference v1.0
- Tobias V.Langhoff
- Chip-8 Extensions and compatibility
- Chip-8 Test Suite
This project is licensed under the MIT license, so you are free to do almost everything you want.
Anyone is welcome to contribute! Here is our contributors: