Here's my code to move my spaceship up. Just wondering in there's 'cleaner' way to perform INX four times in a row? It works obviously but it just feels and looks wrong to me. LOL. I reralise I can nest another loop but that's a heap more code than just writing INX four times and I'm guessing less efficient? I really don't know when it comes to this stuff...
Code: Select all
ReadUp:
LDA $4016
AND #%00000001
BEQ ReadUpDone
LDX #$0000
.MoveUp:
LDA $0200, X
SEC
SBC #player_speed
STA $0200, X
INX
INX
INX
INX
CPX #$18
BNE .MoveUp
ReadUpDone: