I tried to figure out what magazine I got my joystick code from, and the only hit in Archive.org was some Toronto Pet (The TORPET) newsletter. It was so early in the VIC-20 era that they had an article mention that "15,000" had been sold so far

https://archive.org/details/TORPET_The_ ... 0++4+%2B32
And their code:
Code: Select all
9000 POKE 37154,127
9010 JO= (NOT((PEEK(37152)AND128) /8+( PEEK(37151)AND60)/4)) +32
9020 POKE 37154,255
9030 RETURN
BUT, as I searched to figure out the problem, I found an Atari Magazine reference to reading these two values:
Code: Select all
10 PRINT PEEK(37137), PEEK(37152) : GOTO 10
37151 is listed as "Port A (Sense cassette switch)" and I don't see anything about the joystick there.
BUT ... the code works when using these two locations, OR the 37151/37152 locations. My test:
Code: Select all
10 rem fixed torpet code
20 gosub 9000
30 if jo and 1 then print "up ";
40 if jo and 2 then print "down ";
50 if jo and 4 then print "left ";
60 if jo and 8 then print "fire ";
70 if jo and 16 then print "right";
80 if jo<>0 then print
90 goto 20
9000 poke 37154,127
9010 rem jo=(not((peek(37152)and128)/8+(peek(37137)and60)/4))+32
9015 jo=(not((peek(37152)and128)/8+(peek(37151)and60)/4))+32
9020 poke 37154,255
9030 return
http://sleepingelephant.com/denial/wiki ... p/Joystick
Code: Select all
1 S=PEEK(37151):POKE37154,127:T=PEEK(37152):POKE37154,255
2 IF (128ANDT)=0 THEN PRINT "RIGHT"
3 IF (16ANDS)=0 THEN PRINT "LEFT"
4 IF (8ANDS)=0 THEN PRINT "DOWN"
5 IF (4ANDS)=0 THEN PRINT "UP"
6 IF (32ANDS)=0 THEN PRINT "FIRE"
7 GOTO 1
After finding so many places saying "use A and B" and other places saying "use A and C" and they both work, I'm a bit confused

Thanks, much.