Hey guys,
So I am testing my CPU with nestest. If I hardcode the program counter to start at 0xC000 (like the golden log does), I get pretty good results. Not perfect, but way better than I expected for my first try! However, if I try to initialize the program counter from the reset vector, I always get 0xC004. Right now I have a really dumb romloader implementation that has just enough to load nestest basically. I just blindly load starting from byte 0x0010 of the rom, and starting from memory address 0x8000. I always load the current byte into the current memory address, and the current memory address + 0x4000, then iterate both. The loop runs 0x4000 times. Stupid, but should be good enough.
For loading the program counter on reset (which I also call on a "power on"), I set it equal to the value at memory location 0xFFFD left-shifted 8 bits and then i OR that with the value at memory location 0xFFFC.
Is there anything obviously wrong/problematic in the logic I've mentioned? If not, what else should I look at, or what other info can I provide to help me figure out where I've gone wrong?
Thanks in advance!
So I am testing my CPU with nestest. If I hardcode the program counter to start at 0xC000 (like the golden log does), I get pretty good results. Not perfect, but way better than I expected for my first try! However, if I try to initialize the program counter from the reset vector, I always get 0xC004. Right now I have a really dumb romloader implementation that has just enough to load nestest basically. I just blindly load starting from byte 0x0010 of the rom, and starting from memory address 0x8000. I always load the current byte into the current memory address, and the current memory address + 0x4000, then iterate both. The loop runs 0x4000 times. Stupid, but should be good enough.
For loading the program counter on reset (which I also call on a "power on"), I set it equal to the value at memory location 0xFFFD left-shifted 8 bits and then i OR that with the value at memory location 0xFFFC.
Is there anything obviously wrong/problematic in the logic I've mentioned? If not, what else should I look at, or what other info can I provide to help me figure out where I've gone wrong?
Thanks in advance!