Sorry I could not resist
But I have heard in the past that the for loops may not be fast enough to properly capture the data coming back from the PS2. So I personally at a minimum would change the code:
main
;DS2
low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8]
for index = 0 to 2
shiftin DAT,CLK,FASTLSBPOST,[DualShock(index)\8]
next
high SEL
pause 1
low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8,$0\8,$0\8,LargeMotor\8]
for index = 3 to 6
shiftin DAT,CLK,FASTLSBPOST,[DualShock(index)\8]
next
high SEL
pause 1
To something like:
main
;DS2
low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8]
shiftin DAT,CLK,FASTLSBPOST,[DualShock(0)\8, DualShock(1)\8, DualShock(2)\8]
high SEL
pause 1
low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8,$0\8,$0\8,LargeMotor\8]
shiftin DAT,CLK,FASTLSBPOST,[DualShock(3)\8, DualShock(4)\8, DualShock(5)\8, DualShock(6)\8]
high SEL
pause 1
That is assuming that still want to support the motor… Otherwise I would just combine the two shiftins… In fact I might do that anyway…
main
;DS2
low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8]
shiftin DAT,CLK,FASTLSBPOST,[DualShock(0)\8, DualShock(1)\8, DualShock(2)\8, |
DualShock(3)\8, DualShock(4)\8, DualShock(5)\8, DualShock(6)\8]
high SEL
pause 1
low SEL
shiftout CMD,CLK,FASTLSBPRE,$1\8,$42\8,$0\8,$0\8,LargeMotor\8]
high SEL
pause 1
Also aways down in the program is a nap statement.
[code]nap 2 ;internal sleep mode, approx 38ms, use value 3,4 or 5 with some slow wireless controller
LastButton(0) = DualShock(1)
LastButton(1) = DualShock(2)
goto main[/code]
I would probably change the nap 2 statement into a pause 50 statement.
That is all I see right now.
Kurt