The CHIP-8 is a virtual machine designed in the 1970s for creating simple games. I tried making a quick port of an existing CHIP-8 interpreter, and I partially succeeded. Here is it running the Trip-8 demo rom:
I can run CHIP-8 roms successfully, but after a seemingly random delay the simulator freezes completely. I can only imagine this being a threading issue, so I’m not sure if there’s something in the CHIP-8 interpreter I ported causing problems, an issue with how I used the APIs, or whether there’s a bug in the simulator. I may also still be using some libraries that the interpreter originally used that the Pokitto won’t have, which means it might not work on hardware without minor modification. That said, I feel fairly confident that this will work on a Pokitto without too much trouble because I managed to port the interpreter to the Gamebuino with much more effort and this should be easier. With the Pokitto’s specs, I think the limited resources of the CHIP-8 shouldn’t be much trouble to handle at full speed.
Here are the files. I simply modified the example Hello World simulator project by adding chip8.c, modifying Hello.cpp, and adding the two header files chip8.h and trip8.h. Since this project was a quick experiment I didn’t set up a proper git repo yet, so I just added the files to a gist for now:
Yes, it is a threading issue and it has something to do with SDL2. And it only appears with some programs, not all. I have been trying to find it like crazy but have not managed to trace it to any specific cause.
Edit: does it happen at random or exactly at same time if you run the same program exactly?
It happens at random. It can run only a couple seconds or up to about a minute before freezing on the same program, but it never seems to freeze in the same place. I added a counter that increments every frame and it usually doesn’t make it to 1500 before a freeze.
While I’m honored you thought of my topic when tagging the CHIP-8 interpreter, the gif demoing the interpreter is from @Initgraph’s arguably superior version that I think is completely unrelated to mine. His topic might be more deserving than mine to be tagged as a full game, since my version didn’t progress past a proof-of-concept.
By the way, I tried finding the source of Initgraph’s interpreter, but I wasn’t able to find it. Is there a link?
Thank you for your remark Wuuf. My Chip-8 editor is not finished too, you can download a WIP version here if you want : http://www.initgraph.com/download/Chip8_20170712.zip.
Please keep in mind that the source is dirty and the project still experimental, I have to finish it when I will have time
Wait, this post was originally mine though. Initgraph made another thread posting his CHIP-8 interpreter, but this thread really did show mine originally.