Since I last posted I've done a bit of work. I released the current version of the code as of last week some time via Google Code. This is located here. I'll probably release on there once a week or so. Of course, it doesn't do anything really just yet, so there's very little reason to look at it, but it's there.
So far as the emulator goes, I'm starting to realize how huge of a project this is. I'm working exclusively on the CPU. The main function of the CPU is to do manipulations on values in memory, so getting memory to function properly has been a pretty big project lately. Right now I'm focusing mainly on the program memory, which is held in basically the last half of the total memory that the NES has. I really need to get the front half working.
That said, I've begun a small amount of work on the CPU itself. I've only written one of the 50 or so commands that the 6502 supports. I started with AND. I started alphabetically and skipped ADD because ADD is actually pretty complicated. AND was a much nicer starting point. I need to take a look at the flags. I don't understand all of them very well. The 6502 supports 13 different memory addressing modes. I've implemented something like the first two addressing modes.
The problem I'm having so far is that I need to find some means of writing test cases for the CPU based on the way the CPU really functions. I can write test cases, but these test cases will be based on my understanding of the CPU, which is limited. Testing of the CPU is going to need to be pretty thorough.
I've found a couple of documents pretty useful:
http://nesdev.parodius.com/6502guid.txt
http://nesdev.parodius.com/6502jsm.zip
They both describe the available instructions. 6502guid.txt was really helpful in understanding the memory addressing modes.
No comments:
Post a Comment