Hello everyone! It’s been a minute, and I’m finally ready to present to you my CHIP-8 Emulator for Makecode Arcade.
Features:
4 KB RAM
Full CPU implementation.
16 general-purpose registers
Stack and timers
Sprite drawing with collision detection
Configurable display palette
Native Arcade controller support
Runs at decent speed on most real Arcade hardwares
JSBin ROM converter for converting .ch8 files into MakeCode arrays
I tested it with a couple roms and they all worked fine, I included David Winter’s Space Invaders rom because it’s pretty fancy for a CHIP-8 game though.
Convert CH8 roms to a code that you can paste into the main.ts file in the project to run your own roms! You can grab some from the Github link included on the jsbin site.
I’m curious, Abstract: What was your design process for this implementation? It’s gorgeous … and I’d love to know how you went about developing it.
Premise: One of my long-term projects is a course on computer organization and computer architecture. Simulators and emulators are great projects for that kind of a course, and I’m planning on at least one of the projects being a software emulator written for MakeCode Arcade. I love “simple” architectures like the CHIP-8 for this kind of a project.
Really cool project and really nice work, Abstract!
I treated the emulator as if I were implementing a tiny computer. I separated memory, registers, timers, input, display, and the fetch-decode-execute loop into distinct parts. Once the framework was in place, implementing new opcodes became much easier because I could compare the ROM’s expected behavior against what my emulator was actually doing.
You don’t need to read the rest of this reply but it’s some useful notes in case you need them.
For Chip-8 I embedded the ROM directly as a constant because the programs are so small. For larger systems like a Game Boy (which somebody has made a GB emulator for Arcade), it makes more sense to load ROM data from image or hex rather than hard-coding it.
I’d also recommend using debug logs a lot too, even for tiny things like when the project starts, because in a bigger project where you emulate an actual CPU, you want to know the status of the PC and such.
Hoping to see that emulator for whatever it might be someday, just remember that Arcade is a fantasy console limited by constraints after-all.