Addresses are not wrapping within zeropage as they do on a real 6502.
When running LDA ($FF), Y with Y = 0, the 6502 simulator takes the low byte from $FF and the high byte from $0100.
It can be seen when running this code:
LDA #$00
STA $00
LDA #$02
STA $FF
LDA #$04
STA $0100
LDA #$AC
STA $0402
LDA #$c2
STA $02
LDY #$00
LDA ($FF), Y
After executing this code, A should be equal to C2 and not AC.
PinoBatch, on the Nesdev wiki figured out that it is due to getWord() which does not handle wrapping:
|
i11: function () { |
|
var zp = popByte(); |
|
var value = memory.getWord(zp) + regY; |
|
regA |= memory.get(value); |
|
ORA(); |
|
}, |
|
|