Chip 8 emulator written in C
Find a file
2026-03-29 00:31:20 -06:00
.idea Setup Project & Basics of init 2026-03-25 15:12:52 -06:00
games Add some superchip games 2026-03-28 01:41:01 -06:00
test-roms add new roms 2026-03-25 22:55:49 -06:00
CMakeLists.txt Basic SDL2 window creation 2026-03-25 22:13:57 -06:00
cpu.c Add some superchip games 2026-03-28 01:41:01 -06:00
cpu.h Start working on SCHIP expansion 2026-03-28 00:56:07 -06:00
main.c update cycles to allow more draws 2026-03-29 00:31:20 -06:00
README.md Add README.md 2026-03-28 01:57:45 -06:00

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)