If I use sprite auto-DMA ($4014) my sprites update fine. However, I only need 2 sprites so I thought I'd manage them manually to save having to have 256 byte sprite buffer.
But something weird seems to happen. The first sprite updates OK but when I try to update the second one, both of them disappear.
I stripped down the code to the bone to debug;
This makes the sprites disappear but if I comment out the last write to $2004, the first sprite is drawn.
I'm calling this in the NMI during VBLANK with the screen off.
What's happening?
But something weird seems to happen. The first sprite updates OK but when I try to update the second one, both of them disappear.
I stripped down the code to the bone to debug;
Code:
updateSprite
lda #$00
sta $2003
sta $2003
lda #$34
sta $2004
lda #$11
sta $2004
lda #$00
sta $2004
lda #$34
sta $2004
lda #$44
sta $2004
lda #$12
sta $2004
lda #$00
sta $2004
lda #$44
sta $2004
rts
lda #$00
sta $2003
sta $2003
lda #$34
sta $2004
lda #$11
sta $2004
lda #$00
sta $2004
lda #$34
sta $2004
lda #$44
sta $2004
lda #$12
sta $2004
lda #$00
sta $2004
lda #$44
sta $2004
rts
This makes the sprites disappear but if I comment out the last write to $2004, the first sprite is drawn.
I'm calling this in the NMI during VBLANK with the screen off.
What's happening?