I am confused about the sprite_ram.nes tests.
Specifically, I didn't have anything implemented in my emulator to mask bytes of the OAM read with E3, yet I passed that portion of the test. The original code points to "third sprite bytes" which, if I interpret correctly is the sprite's X coordinate.
Original code:
The above will never fail on a halfway decent emulator or a real NES. Reason: it is the attributes (byte 2) that is masked not the sprite X.
What I *think* was meant:
Is this right?
Specifically, I didn't have anything implemented in my emulator to mask bytes of the OAM read with E3, yet I passed that portion of the test. The original code points to "third sprite bytes" which, if I interpret correctly is the sprite's X coordinate.
Original code:
Code:
lda #5;) Third sprite bytes should be masked with $e3 on read
sta result
lda #3
sta $2003
lda #$ff
sta $2004
lda #3
sta $2003
lda $2004
cmp #$e3
jsr error_if_eq
sta result
lda #3
sta $2003
lda #$ff
sta $2004
lda #3
sta $2003
lda $2004
cmp #$e3
jsr error_if_eq
The above will never fail on a halfway decent emulator or a real NES. Reason: it is the attributes (byte 2) that is masked not the sprite X.
What I *think* was meant:
Code:
lda #5;) Second sprite bytes should be masked with $e3 on read
sta result
lda #2
sta $2003
lda #$ff
sta $2004
lda #2
sta $2003
lda $2004
cmp #$ff
jsr error_if_eq
sta result
lda #2
sta $2003
lda #$ff
sta $2004
lda #2
sta $2003
lda $2004
cmp #$ff
jsr error_if_eq
Is this right?