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.
C7E7 08 PHP A:00 X:00 Y:00 P:6F SP:FB CYC:193
C7E8 68 PLA A:00 X:00 Y:00 P:6F SP:FA CYC:202
C7E9 29 EF AND #$EF A:7F X:00 Y:00 P:6D SP:FB CYC:214
C7EB C9 6F CMP #$6F A:6F X:00 Y:00 P:6D SP:FB CYC:220
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.
C7E7 08 PHP A:00 X:00 Y:00 P:6F SP:FB CYC:193
C7E8 68 PLA A:00 X:00 Y:00 P:6F SP:FA CYC:202
C7E9 29 EF AND #$EF A:7F X:00 Y:00 P:6D SP:FB CYC:214
C7EB C9 6F CMP #$6F A:6F X:00 Y:00 P:6D SP:FB CYC:220
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.