Hi I have been trying to develop a nes emulator for fun and I'm working on the CPU currently. I'm using the nestest.nes file and comparing against the log from Nintendulator (http://www.qmtpro.com/~nes/misc/nestest.log). I know a lot of others have also used this for testing, but I'm stuck on a few lines of the log file and I'm not seeing what I'm doing wrong.

From my understanding the instruction at C7E7 pushes the processor status (6F) into the stack, then C7E8 pulls this value into the accumulator (i.e. A = 6F, but I assume the 00 value shown for A is from before this instruction is executed). Then C7E9 does a logical AND between 6F & EF (which is 6F). My question is this: why does the Nintendulator log file show an accumulator value 7F? No one else seems to have this issue so I must be wrong, but I can't figure out where.

If it's not clear to you: $6f = %01101111 while $7f = %01111111 -- the difference in this case is bit 4 (the "5th bit"), or the B flag, and said link should make it clear why. It should also help explain how to properly implement how those bits, as well as other bits in P, are affected by certain instructions, vs. IRQ vs. NMI. You'll probably learn a few other things while reading that section.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum