Feel free to post any significant developments here too - you may well spark some interesting discussions.
I took a little detour from writing the emulator, because I found out that one of my own CHIP-8 games wouldn’t run in it anyway. CHIPOS, the monitor program and CHIP-8 interpreter used by the DREAM 6800 computer, was missing four CHIP-8 instructions that were initially undocumented on the COSMAC VIP, and my game used those instructions.
So I ended up with a secondary RetroChallenge: I learned 6800 assembly, rewrote CHIPOS to add the four missing instructions, while both keeping the ROM under 1K and not moving any of the routines that the CHIPOS manual exposes to users.
I wrote a somewhat lengthy blog post about the process: https://tobiasvl.github.io/blog/chipos-hacking/
But the short version is that I ended up changing a simple “switch statement-like” routine into something that builds a routine in RAM and then jumps there, in order to not have to repeat boilerplate code for a jump table. It feels a little over-engineered – I’m sure it’s possible to cram in a jump table, or maybe even to extend the original routine (although I might have to move some of the CHIPOS routines, which I don’t really want to do).
OK, now that I can test my own games in it, it’s back to the emulator.
Edit: I put the code up on GitHub: https://github.com/tobiasvl/chiposlo