SingleStepTests / ProcessorTests

A language-agnostic JSON-encoded instruction-by-instruction test suite for the 8088, 68000, 65816, 65[c]02 and SPC700 that includes bus activity.
188 stars 14 forks source link

NES 6502 Incorrect Cycles test #35

Closed ShlomiRex closed 1 year ago

ShlomiRex commented 1 year ago

Reddit post: https://www.reddit.com/r/EmuDev/comments/13vyfug/nes_test_lda_i_think_the_test_rom_is_wrong/

Basically the test:

{
    "name": "b5 6d 7e",
    "initial": {
        "pc": 27808,
        "s": 113,
        "a": 156,
        "x": 116,
        "y": 192,
        "p": 233,
        "ram": [
            [
                27808,
                181
            ],
            [
                27809,
                109
            ],
            [
                27810,
                126
            ],
            [
                109,
                139
            ],
            [
                225,
                49
            ]
        ]
    },
    "final": {
        "pc": 27810,
        "s": 113,
        "a": 49,
        "x": 116,
        "y": 192,
        "p": 105,
        "ram": [
            [
                109,
                139
            ],
            [
                225,
                49
            ],
            [
                27808,
                181
            ],
            [
                27809,
                109
            ],
            [
                27810,
                126
            ]
        ]
    },
    "cycles": [
        [
            27808,
            181,
            "read"
        ],
        [
            27809,
            109,
            "read"
        ],
        [
            109,
            139,
            "read"
        ],
        [
            225,
            49,
            "read"
        ]
    ]
}

has 4 reads, while I have 3 reads. If you do this by hand you'll see that indeed, the 0xB5 instruction should only read from 3 places: opcode, operand and the RAM[] where the RAM[] is what the A register should be. Nothing more. Is this correct or am I wrong?

ShlomiRex commented 1 year ago

Never mind.