A suckless complete CHIP-8 emulator written in C!
What is in it?
- All instructions the original CHIP-8 architecture supported
- Graphical output to the terminal using (my beloved) ncurses
- Loading .ch8 roms
- Error handling with stderr
What am I proud of?
I am really proud of the optimizations i did for the project after pretty much finishing it. I am also proud of the way i implemented the keyboard (which was really hard) and the way it turned out. I am also proud of the error handling because it helped me level up in my overall knowledge in knowing how to handle errors.
How is it built?
It’s built in C using ncurses, following the suckless philosophy (optimized and only one source file) and most of the suckless style guide. There is a precompiled binary that was built with GitHub workflows using Ubuntu. The binary can be directly downloaded from the repo’s release page and can be used on (most) glibc-based Linux distros (build is compiled for Ubuntu and ncurses-v6 has to be installed on your system, original project was made with NixOS, which will also work).
What I learned
I learned how CPU’s operate (fetch, decode, execute), i learned about opcodes and parsing and i learned using bitwise operators effectively. It also taught me the importance of hexadecimal in programming. The project overall brought me closer to CompEng and how CPU’s work on a rudimentary level. It also taught me (as said) how to handle errors better and i think because of trying to make the project as suckless as possible the project also made me an overall better programmer.
Known limitations / plans for the future
Bugs can occur, even though no error that isn’t being handled by the program itself has been recorded. Still look out for bugs and if any are found write it to me as feedback please.
As this project is a full emulator for CHIP-8 there isn’t that much to be done anymore which i am really proud of :)
Closing word
This project was pretty fun to make and it taught me a bunch. It is also my final project for Stardance which is a bit sad but i don’t/didn’t have enough time to start a new project which is why i will stop with this. Still i loved Stardance and it brought me closer to CE/SE than i would ever think i would get (before hearing of Stardance i wasn’t really fond of coding). To anyone reading this whole thing: Love y’all :)))
- 5 devlogs
- 12h