nestest "known-correct log"

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
nestest "known-correct log"
by on (#86240)
I'm doing a comparison between my emu and this nestest log, found here. I'd like some advice.

2. At power-up, CPU P register should be $34, but it starts with $24.

(removed questions 1 and 3, my bad)

Could someone clarify it?

Thanks.

by on (#86242)
The difference between $24 and $34 does not exist in the 6502. Bits 5 and 4 are created when P is pushed, not stored in flip-flops.

by on (#86244)
tepples wrote:
The difference between $24 and $34 does not exist in the 6502. Bits 5 and 4 are created when P is pushed, not stored in flip-flops.


Well, yes, but it's what the wiki says. At power-up, P = $34. That was the first difference I've spotted.

by on (#86246)
Zepper wrote:
tepples wrote:
The difference between $24 and $34 does not exist in the 6502. Bits 5 and 4 are created when P is pushed, not stored in flip-flops.

Well, yes, but it's what the wiki says.

Which page? The wiki also says that $04, $14, $24, and $34 are equivalent on CPU status flag behavior.

Quote:
Well, what about the scanline numbers?

When the scanline number is different from the previous scanline number, you've passed a multiple of 341 dots. That's all you really need from the golden log.

by on (#86248)
tepples wrote:
Which page?


Here, power-up state.

Plus, the "golden log" assumes that all RAM is initialized with $00, but the wiki says $FF, except for a few locations.

EDIT: my emulator log matches the "golden log", for the first 5003 lines, since a few unofficial opcodes are used, but RockNES doesn't support them.

by on (#86249)
The page has been updated to reiterate the irrelevance of some P bits.

Which specific instructions in nestest rely on reading specific initial values of RAM before writing them?

by on (#86250)
tepples wrote:
Which specific instructions in nestest rely on reading specific initial values of RAM before writing them?


Quick answer: none.
Long answer: I just trapped such case in a few instructions.

Code:
C000  4C F5 C5  JMP $C5F5                       A:00 X:00 Y:00 P:24 SP:FD CYC:  0 SL:241
C5F5  A2 00     LDX #$00                        A:00 X:00 Y:00 P:24 SP:FD CYC:  9 SL:241
C5F7  86 00     STX $00 = 00                    A:00 X:00 Y:00 P:26 SP:FD CYC: 15 SL:241
C5F9  86 10     STX $10 = 00                    A:00 X:00 Y:00 P:26 SP:FD CYC: 24 SL:241
C5FB  86 11     STX $11 = 00 ; it should be $FF according to the wiki.

by on (#86289)
The golden log is not really a golden log. It's just a dump of the log as it runs in FCEUX (which mostly works).

As you noticed, FCEUX does not fill memory with FF on startup as the wiki suggests. Instead it fills with 00 00 00 00 FF FF FF FF repeating pattern.

I wouldn't worry about those minor diffs. Just use the log to make sure the CPU is working. Don't use it to check things like system power up.