Chip 8 emulator written in C
- C 99%
- CMake 1%
| .idea | ||
| games | ||
| test-roms | ||
| CMakeLists.txt | ||
| cpu.c | ||
| cpu.h | ||
| main.c | ||
| README.md | ||
CCHIP-8
A Chip 8 emulator written in C.
Currently up to the standards of Super Chip 8 1.1. Next task is to get it up to standards for XOChip.
All Opcodes
CHIP-8
| Opcode | Description |
|---|---|
00E0 |
Clear the display |
00EE |
Return from subroutine |
1NNN |
Jump to address NNN |
2NNN |
Call subroutine at NNN |
3XKK |
Skip next instruction if VX == KK |
4XKK |
Skip next instruction if VX != KK |
5XY0 |
Skip next instruction if VX == VY |
6XKK |
Set VX = KK |
7XKK |
Set VX = VX + KK |
8XY0 |
Set VX = VY |
8XY1 |
Set VX = VX OR VY |
8XY2 |
Set VX = VX AND VY |
8XY3 |
Set VX = VX XOR VY |
8XY4 |
Set VX = VX + VY, VF = carry |
8XY5 |
Set VX = VX - VY, VF = NOT borrow |
8XY6 |
Shift VY right by 1, store in VX, VF = old bit 0 |
8XY7 |
Set VX = VY - VX, VF = NOT borrow |
8XYE |
Shift VY left by 1, store in VX, VF = old bit 7 |
9XY0 |
Skip next instruction if VX != VY |
ANNN |
Set I = NNN |
BNNN |
Jump to NNN + V0 |
CXKK |
Set VX = random byte AND KK |
DXYN |
Draw 8xN sprite at (VX, VY), VF = collision |
EX9E |
Skip next instruction if key VX is pressed |
EXA1 |
Skip next instruction if key VX is not pressed |
FX07 |
Set VX = delay timer |
FX0A |
Wait for key press, store in VX |
FX15 |
Set delay timer = VX |
FX18 |
Set sound timer = VX |
FX1E |
Set I = I + VX |
FX29 |
Set I = address of font sprite for digit VX |
FX33 |
Store BCD of VX at I, I+1, I+2 |
FX55 |
Store V0-VX in memory starting at I |
FX65 |
Load V0-VX from memory starting at I |
SUPER-CHIP 1.1
| Opcode | Description |
|---|---|
00CN |
Scroll display down by N pixels |
00FB |
Scroll display right by 4 pixels |
00FC |
Scroll display left by 4 pixels |
00FD |
Exit the interpreter |
00FE |
Disable high-res mode (64x32) |
00FF |
Enable high-res mode (128x64) |
DXY0 |
Draw 16x16 sprite at (VX, VY), VF = collision |
FX30 |
Set I = address of large font sprite for digit VX |
FX75 |
Store V0-VX in RPL user flags (X <= 7) |
FX85 |
Load V0-VX from RPL user flags (X <= 7) |