A Chip-8 interpreter for the browser!
- Fix scroll-bar on Firefox
- Fix select rom style
- Keypad should show the keyboward mapping
- Test more ROM's
- Make the emulator color configurable
Runs the app in the development mode.
The interpreter will be available at http://localhost:3000.
The page will reload if you make edits.
Launches the test runner in the interactive watch mode.
Each test compares the Chip-8 state after an instruction against an expected state. This approach was chosen because we want to be sure that an instruction only alter the involved properties.
For instance, a instruction that perform a jump should only change the PC - any other change would be a bug.
A typical test looks like this:
...
chip8 = createChip8(); // Create a chip-8 instance
writeWord(chip8, 0x200, 0x1EEE); // Load an instruction
const snapshot = chip8Snapshot(chip8); // Create a copy of the current state
// Change the copy to reflect our expected state for the instruction
snapshot.PC = 0xEEE;
// Perform the instruction
chip8.cycle();
// Compares the state of the actual chip-8 after
// the instruction vs our expectation.
// If the instruction wrongly changed V[0], for example,
// the test would fail warning that the register doesn't match
const equals = isChip8Equal(chip8, snapshot);
expect(equals).toBe(true);
...
Builds the app for production to the build
folder.
- Mastering CHIP-8 - by Matthew Mikolay
- Cowgod's Chip-8 Technical Reference v1.0 - by Thomas P. Greene
- Using CSS To Create A CRT - by Alec Lownes