Show HN: Chip-8 emulator in WebAssembly (JS –> WASM)

chip8.cool.omg.lol

1 points by kbatdorf 15 hours ago

I've been learning more about WebAssembly and a bucket list project I've always wanted to complete was to write an emulator. I chose the chip-8 vm as it's popular as a stepping stone project and pretty straight-forward. Only the display opcodes really gave me some trouble, specific to clipping/wrapping and tracking collisions.

The demo includes some test roms as well as some roms from various octojams. The source is on GitHub.

https://github.com/KevinBatdorf/chip8-wasm

I orchestrated the project with TypeScript as I'm used to it and prefer the DX there, I created wrapper functions around the wasm op codes designed in a way similar to how you would write WebAssembly in wat format. So technically it's generated bytecode.