A simple CHIP-8 emulator written in C.
- All instructions are 2 bytes long and are stored most-significant-byte first.
- 4K RAM (
0x0 ~ 0xfff
)0x0 ~ 0x1ff
: reserverd for system0x200 ~ 0xe9f
: freely used RAM0xea0 ~ 0xeff
: reserved for stack, internal use and other variables0xf00 ~ 0xfff
: for display
- 64x32 resolution display (1 bit per pixel)
- Font sprite starts at
0x000
, see details below - 8-bit delay and sound timer
- 16 8-bit registers
V0
~VF
- A 16-bit program counter (
PC
) - A 8-bit stack pointer (
SP
) - One 16-bit address register
I
- Instruction set
8XYE
:VF
should be the most significant bit ofVX
notVY
prior to the shift8XY6
: Same as aboveFX55
: Don't incresetI
FX65
: Same as above
1 2 3 C 1 2 3 4
4 5 6 D -> Q W E R
7 8 9 E A S D F
A 0 B F Z X C V
This emulator uses SDL2 to do the rendering, so you need to install SDL2 first.
$ git clone https://github.com/cj1128/chip8-emulator
$ cd chip8-emulator
$ make build
$ make run
There are a few roms in the rom
directory of repo.
BC_Test.ch8
and test_opcode.ch8
are used for testing the fundamental functions of our emulator.
test.ch8
is used for testing arbitrary instructions written by ourself.
All others are games for fully testing our emulator ๐ฎ.