Author
Topic: CHIP-8 emulator (Read 6937 times)

So as some people lurking in IRC already know, I started work on a CHIP-8 emulator a little under a year and a half ago. I just picked it back up a couple days ago, and have made some major progress. It was originally written in C++, and I wanted to first write it for the computer using SDL, and then port it to the Nspire, hence the name "nCHIP-8." The C++ to C conversion was surprisingly easy! I'm not sure I did it the right way, but at least it works. Basically, I put all the data stuff in a struct, and renamed the functions to

chip8_blah()All the functions take a pointer to a chip8 struct as their first argument, and then just edit that.

I've ported it to the GBA, and it runs great, except for a few bugs in the actual core that I need to fix.

As the CHIP-8 has 16 buttons and the GBA only has 10, I have to make a keymap for each game. If you want to try out Space Invaders here's a ROM you can run on an emulator (or real hardware): https://sr.ht/MfIH.gbaI personally recommend mGBA

Next steps are (in no particular order):

Make a pretty border

Port to the CE (it'd be easier if I actually had a CE)

Port to the Nspire (the repo is called nCHIP-8 after all)

Fix emulation bugs so it can actually run everything.

Port to KOS (It might run too slowly for this)

Port to Arduino

The emulator core is pretty easy to use, and as such makes it a breeze to port to other platforms. The GBA port only took about an hour to go from SDL to GBA.Source for everything is here: https://github.com/Ivoah/nCHIP-8

Nice work Ivoah and the speed is impressive so far. There was a 83+ one by Benryves so I assume a CE version of your emulator would run fast enough. I remember there was also an HP Prime CHIP-8 emulator but it was much slower, partly due to being written in HP PPL (although still impressive per proprietary calculator language standards). Keep up the good work on this

Okay, @Ivoah . Here's the plan... you gotta think like a . Maybe a . Go to Walmart. Buy a CE. Use it to create a ROM. Do some testing and such. Eat food. 90 days later, delete the ROM. Return the CE. Buy another one. Keep being a . Create a new ROM. Think like a . Eat food. Repeat until you finish the CE port. It's the perfect plan!

Okay, @Ivoah . Here's the plan... you gotta think like a . Maybe a . Go to Walmart. Buy a CE. Use it to create a ROM. Do some testing and such. Eat food. 90 days later, delete the ROM. Return the CE. Buy another one. Keep being a . Create a new ROM. Think like a . Eat food. Repeat until you finish the CE port. It's the perfect plan!