Devlog #2 - NES emulation
Published date: 30-03-2026
This month, I finished all my exams and had some time before the next semester started. I finally had the chance to work on one of my favorite emulators of all time. I was wondering if I should write the emulator in C or Zig. I initially started off with zig, but decided to switch to C since I was more comfortable with it and would be spending with the language more in the future, though I may use zig in some other future projects. I’ve been working on a NES emulator this month using C and raylib. It has been a fun and challenging experience. The main part that has been finished is the 6502 cpu. I decided to write a cycle-accurate NES emulator. I wanted to make sure that the CPU was able to pass the nestest.nes ROM, which covers all the official opcodes (+ a few unofficial ones).
During this i discovered that nvim has a diff tool that allows me to see the diffs in my output log and the log nestest.nes expects. What I like about the nvim diff tool is that I can view it side by side. After I got the NES CPU to work, i started work on the PPU. I thought that when I started, I did feel the burnout after finishing writing all the opcodes. For the PPU part, I managed to at least get the data from the name tables.
This is the sprite data from Donkey Kong. It’s interesting to see how the PPU actually reads the data from the cartridge.
