I think these are the pertinent bits of code
Code: Select all
;-----------------------------------------
; Sprite direction check subroutines start
spritemovecheck
LDA spritedir
test0
CMP #0
BNE test1
JMP done
test1
CMP #1
BNE test2
JSR up
JSR left
JMP done
test2
CMP #2
BNE test3
JSR up
JSR right
JMP done
test3
CMP #3
BNE test4
JSR left
JSR down
JMP done
test4
CMP #4
JSR right
JSR down
JMP done
done
RTSCode: Select all
;------------------------------
; Sprite move subroutines start
up
LDX #0
LDY #0
-
CLC
LDA spriteram,x
SBC speed,y
STA spriteram,x
STA $0200,x
INY
INX
INX
INX
INX
CPX #0
BNE -
LDX #0
LDY #0
-
CLC
LDA spriteram,x
ADC speed,y
STA spriteram,x
STA $0200,x
INY
INX
INX
INX
INX
CPX #0
BNE -
RTS
RTS
down
LDX #0
LDY #0
-
CLC
LDA spriteram,x
ADC speed,y
STA spriteram,x
STA $0200,x
INY
INX
INX
INX
INX
CPX #0
BNE -
RTS
right:
LDX #0
LDY #0
-
CLC
LDA spriteram+3,x
ADC speed,y
STA spriteram+3,x
STA $0203,x
INY
INX
INX
INX
INX
CPX #0
BNE -
RTS
left
LDX #0
LDY #0
-
CLC
LDA spriteram+3,x
SBC speed,y
STA spriteram+3,x
STA $0203,x
INY
INX
INX
INX
INX
CPX #0
BNE -
RTS
; Sprite direction subroutines end
;---------------------------------rather thantest1
CMP #1
BNE test2
JSR up
JSR up
JSR up
JSR up
JSR left
JMP done
But that doesnt seem like a great solution. If anyone would be kind enough to take a quick look at it I would be most greatful. Thanks a lot!test1
CMP #1
BNE test2
JSR up
JSR left
JMP done
I included the pastebin of the full code just in case and a compiled rom
http://pastebin.com/8N3QUJwp