+Philsan Posted March 7, 2008 Share Posted March 7, 2008 (edited) I want to read VCS Keypad/Kid's Controller/Video touch pad (they are identical) in Turbo Basic XL. Here I have found this Compute's listing (also attached) but it only works in Atari Basic: 1 GRAPHICS 0 10 DIM ROW(3),I$(13),BUTTON$(1) 30 GOSUB 6000 60 POSITION 2,7:PRINT "CONTROLLER # 1:"; 80 GOSUB 7000:POSITION 19,7:PRINT BUTTON$; 120 GOTO 80 6000 REM 6010 POKE 54018,48:POKE 54016,255:POKE 54018,52:POKE 54016,221 6030 ROW(0)=238:ROW(1)=221:ROW(2)=187:ROW(3)=119 6040 I$=" 123456789*0#" 6050 RETURN 7000 PORT=54016 7010 P=1:PAD=0 7020 FOR J=0 TO 3 7030 POKE PORT, ROW(J) 7040 FOR I=1 TO 10:NEXT I 7050 IF PADDLE(PAD+1)>10 THEN P=J+J+J+2:GOTO 7090 7060 IF PADDLE(PAD)>10 THEN P=J+J+J+3:GOTO 7090 7070 IF STRIG(0)=0 THEN P=J+J+J+4:GOTO 7090 7080 NEXT J 7090 BUTTON$=I$(P,P) 7100 RETURN Can someone help me? I am programming a game for kids and I would like to use the Kid's controller with Cookie Monster Munch overlay (big direction buttons!). KIDSCONT.zip Edited March 8, 2008 by Philsan Quote Link to comment Share on other sites More sharing options...
+David_P Posted March 8, 2008 Share Posted March 8, 2008 It's been a while since I looked at the keypads, but you essentially have to strobe the joystick pins, then monitor the trigger and paddle lines. I'd suggest some sort of of interrupt routine to do the monitoring; unless the game can sit and wait for input, you'll miss too many button presses if you aren't constantly scanning. Quote Link to comment Share on other sites More sharing options...
Urchlay Posted March 8, 2008 Share Posted March 8, 2008 I want to read VCS Keypad/Kid's Controller/Video touch pad (they are identical) in Turbo Basic XL.I have found this complicated listing (also attached) but it only works in Atari Basic: Most likely it's not working in Turbo BASIC because of timing problems (Turbo being faster than Atari BASIC). Try increasing the delay in line 7040 from 10 to 30 or so... David_P is right though: it'd be better to write a VBI routine to handle the keypads, for anything like an interactive game. Quote Link to comment Share on other sites More sharing options...
+Philsan Posted March 8, 2008 Author Share Posted March 8, 2008 (edited) Urchlay, I too think the problem is in timing so I will try to change the delay in line 7040. David_P, I am programming a simple game for children (3 years), they are very slow in pushing buttons, so I don't need a faster routine (anyway I am not able to program in ML!). EDIT Urchlay, changing the 10 in 50 in line 7040 the routine works perfectly in Turbo-Basic XL. Thank you! Edited March 8, 2008 by Philsan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.