typescript-chip8
v1.0.0
Published
A Chip8 Emulator, written in Typescript
Downloads
2
Readme
CHIP8 Typescript Implementation
Usage
import { createCpu } from "typescript-chip8";
let cpu = createCpu();
// Roms are buffers of big-endian 2-byte instructions. You can hard code these...
const rom = Buffer.from([0x60, 0xaa, 0x61, 0xbb, 0x62, 0xcc]);
/*
// Or fetch from a remote source somewhere...
const rom = await fetch(`http://example.com/roms/HelloWorld.ch8`)
.then((r) => r.arrayBuffer())
.then((data) => new Uint8Array(data));
*/
cpu.load(rom);
// perform 1 CPU cycle (you could put this in a loop/interval to "run" the cpu forever)
cpu.cycle();
Thank you
This would not have been possible if not for these excellent guides;