6502 CPU/NES Emulator (Project)

Been a long time since I’ve been on here (not that I’ve ever been very active), but thought I’d share a project I’ve been working on for a while. If it’s ever fully complete it will be a functioning NES emulator, but honestly that’s mostly an excuse to emulate the 6502 CPU. Here’s a screenshot I have of it and a link to the git (C++)

Currently I’m just working my way though completing the rest of the opcodes. I’m probably 1/3 of the way through them, but I had a lot of initial setup, both with just getting the code execution and testing that wasn’t verbose af.

Few interesting points of note:

  • Everything is in C++, only imported libraries are ncurses, and when I get to actual graphics, X11
  • Beyond just the functionality of each opcode, I also have to make sure I emulate the correct cycle count as well.

Didn’t really have any intent other than sharing my project (sadly I realize I’ve come back too late to win cool prizes). Would love to answer any questions or just generally talk about related topics.

6 Likes

What made you want to start on this type of project? It seems very niche so I’m intrigued what drew you to learning about the CPU and how it operates.

Generally that low level kind of stuff has always interested me. At one point I had Computer/Electrical engineering as my 2nd major before realizing I didn’t want to spend another year or two in college for something I wouldn’t use in the jobs I was looking for.

This project in specific had some inspirations from a series with a 6502 chip I watched from Ben Eater, along with a video I watched about half of from javidx9 building a NES emulator (hence seeing my opportunity). Both excellent channels, would check them out if you’re curious.

I also feel like it’s somewhat related to liking Formal Language and compilers, although that has yet to amount to more than doing some cool code analysis at work with Roslyn.

2 Likes

That’s so awesome to hear! Thank you for typing up such a detailed response it was really interesting to read.