Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 1.26 KB

README.md

File metadata and controls

45 lines (27 loc) · 1.26 KB

CHIP-8 emulator written in AssemblyScript

https://letmaik.github.io/chip8/

Keys:

1 2 3 4
Q W E R
A S D F
Z X C V

CHIP-8 resources

Docs

https://github.com/mattmikolay/chip-8/wiki/CHIP%E2%80%908-Technical-Reference

http://devernay.free.fr/hacks/chip8/C8TECH10.HTM

Unit tests

https://github.com/SnoozeTime/chip8/blob/master/test/opcode_test.cc

https://github.com/DavidJowett/chip8-emulator/blob/master/test/chip8_test.c

Roms

https://github.com/dmatlack/chip8

https://github.com/JohnEarnest/chip8Archive

https://github.com/corax89/chip8-test-rom

Development notes

TypedArray views

When AssemblyScript grows heap memory, then all TypedArray views returned to JS become unusable/detached. That's why a TypedArray view should be accessed directly before it is used in JS, without doing any other work in AssemblyScript that might grow memory. Keeping long-lived views is unsafe in general.

Note that as-bind avoids such potential issues by always returning copies instead of views. This is less efficient but safer for general usage, though also a bit confusing as it's not obvious that a copy happens. Updating the array inside AssemblyScript would obviously not be reflected in the copy. See also torch2424/as-bind#47.