Around some time last year I’ve decided to give Zig a try and the best way to learn a new language is to build a project with it. So after spending some time thinking about what to build, I’ve decided to build an emulator because I was always curious to know how emulators worked, thus NESkwik was born. I’ve decided to do a NES emulator because it uses an 8-bit CPU which is a simple CPU architecture to implement.

I’ve tried to use the least amount of dependencies as possible, this lead me to creating my own immediate mode UI library with Clay which turned out pretty great, if you’re curious to see how it looks to create some UI with it, you can take a look it here. The renderer of the project was built using SDL3.

Currently, the emulator has 5 types of cartridges implemented which gives around 1900 “playable” games, that’s the majority of the NES game library. Disclaimer: I’ve only tested a few games and did not play them from start to finish, so the 1900 number is very theoretical.

This was a very fun project to work on and is probably the first side project that I have finish, and it’s usable :slight_smile: .

So, if you ever need to play a NES game give NESkwik a try, it works on Linux, Windows, Android and maybe MacOS (haven’t tested it), here’s the link for it: https://github.com/LaBatata101/NESkwik.

Media

AI / LLM usage disclosure

I’ve used AI to help debug problems in the emulator code, there was a few typos in bitwise expressions that caused a lot of accuracy problems. And, to help increase the emulator accuracy to pass Blargg’s ROM tests.

As for using AI to write code, I mostly used to write the UI code, which I refactored most of it because the code was just too bad.

Awesome project! The integrated UI and ROM manager is a nice touch, and the aesthetic fits perfectly.

I was recently working on an NES emulator using Raylib and roughly following this Youtube series for learning how emulator works. Seeing your project makes me want to go back and finish it, as I kind of lost interest while implementing the PPU and chasing other project ideas.

While my actual experience writing emulators is technically only in Zig, I found it a to be the perfect language for this task.

I was recently working on an NES emulator using Raylib and roughly following this Youtube series

I’ve also watched this same series while making the emulator.

I kind of lost interest while implementing the PPU and chasing other project ideas.

The PPU is probably the hardest part of the emulator to get it right, I had to look at other emulators implementations to see what I was doing wrong.

But don’t give up, is very cool when you see the image of the game pop-up on the screen after all the work.