I kind of went down a deep rebbit hole.
As I started to implement the ppu_mmu, I realized that I needed to
finish my mapper, and when I did that, I realized that I didn't
fully understand how VRAM worked, and once I figured that out I
realized that to make my life simpler, I had to rework how some
interfaces works.
I could keep going, but you get the point.
But hey, I think the code is a lot more robust now, so that's good!
honestly, this is just procrastination before I start the PPU.
Golly, that's going to be difficuly, er, that is... fun! Yeah!
It's gonna be so fun! so much fun...
Yeah, the fancy way of handling instructions looked annoying to
deal with. Maybe i'll revisit the concept at a later date, but
for now, using a classic instruction lookup table aughta do fine.
In terms of CPU architecture, I think i'm pretty happy with how I
set things up. Sure, there are some parts of the code that i'm not
super happy about, but as a first draft, I think it's not bad. I'm
sure that after implementing more of the 6502, i'll get a better
idea of how to clean up the code.
What's left to do with the CPU?
- Implement the rest of the instructions (duh)
- Implement interruprs (aaaahhh)
And hopefully, once the CPU is passing nestest.nes, I can start
working on the rest of the NES 😄
Also, added a unified Memory interface.
It's pretty basic (just two read / write methods), but it lets me
do some pretty neat stuff with polymorphism.
Eg: I added a Debug object called Memory_Sniffer, which can wrap
any Memory* compliant object, and it will transparently log all
memory operations going across it! Pretty useful IMHO!