I've been going through the tutorial (amazing resource btw) and have managed to suss out how to rebind all four sprites to move with the directional buttons. Figuring out that everything as a specific registry port in a specific order was a bit of a learning experience. But I'm starting to get it.
My question is... I know this works...
ReadR:
LDA $4016 ; player 1 - Right
AND #%00000001 ; only look at bit 0
BEQ ReadRDone ; branch to ReadBDone if button is NOT pressed (0)
; add instructions here to do something when button IS pressed (1)
LDA $0203 ; load sprite0 X position
CLC ; make sure carry flag is set
ADC #$01 ; A = A + 1
STA $0203 ; save sprite0 X position
LDA $0207 ; load sprite1 X position
CLC
ADC #$01
STA $0207
LDA $020B ; load sprite2 X position
CLC
ADC #$01
STA $020B
LDA $020F ; load sprite3 X position
CLC
ADC #$01
STA $020F
ReadRDone: ; handling this button is done
But... why doesn't this work?
ReadRight:
LDA $4016 ; player 1 - Right
AND #%00000001 ; only look at bit 0
BEQ ReadRightDone ; branch to ReadBDone if button is NOT pressed (0)
; add instructions here to do something when button IS pressed (1)
LDA $0203
LDA $0207
LDA $020B
LDA $020F
CLC
ADC #$01
STA $0203
STA $0207
STA $020B
STA $020F
ReadRightDone: ; handling this button is done
I mean... it sort of works. It will move the entire sprite around the screen. BUT. It garbles the sprites themselves (it kinda reverses them front to back on the first button press) Is there anything at a glance that would cause this strangeness? Because it sure cuts down on a few lines of code, and makes it look neater.