CHIP-8 Emulator
8-bit cpu simulator in c++.
CHIP-8 Emulator
CHIP-8 emulator inspired by Austin Morlan’s CHIP-8 emulator.
A takeaway from this project:
-
Always check datatypes and how much data they can store
uint8_tonly stores 8 bits, so when I diduint8_t x = opcode & 0x0F00u; x = x >> 8u;xends up only storing 0 since it can only save the first byte. Hence, the variable’s datatype should be bigger than 8 bits or do all of operation in one line like belowuint8_t x = (opcode & 0x0F00u) >> 8u;

Usage
Required library: SDL2
Use makefile within source directory to build the emulator
cd source
make
Run the emulator
./chip8 <Scale> <Delay> <ROM>
- Scale: Multiplier for the window. Scale of 1 is 64 x 32 pixles
- Delay: Delay between each instruction. Use this to control speed of a program execution
- ROM: ROM file name. I recommend downloading from this repo