[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IIc joystick port problem



In article <4vvi70$hj1@abel.richland.cc.il.us> s49175@abel.richland.cc.il.us
(Chris Michael Tribout) writes:
>I bought an Apple //c about 3 years ago. I haven't had any problems up
>until now... I have tried 2 joysticks and have come up with the same
>problem with each:
>
>When the joystick is plugged in, the horizontal works fine, but the
>vertical seems to be stuck in the "up" position.  I wrote a quick BASIC
>program to spit out the values... the Y value ranges from 0 in the "up"
>position to 3 in the "down" position instead of the normal 255.
>
>Has anyone else heard of this problem? I still use my Apple regularly, and
>since Publish It! 4 requires a mouse or joystick, I need that port to
>work. Anything I can do outside of shipping it off to have the motherboard
>replaced?

Is your test program the only thing displays the strange behavior, or does
the joystick have problems in other programs too?

If it's just the test program, did you remember to put a delay between the
PDL(0) and the PDL(1)?  Without that delay, you'll get strange results from
PDL(1).

     10  HOME
     20 X =  PDL (0): FOR I = 0 TO 100: NEXT :Y =  PDL (1)
     30  VTAB 10: IF  PEEK (49249) > 127 THEN  INVERSE
     40  PRINT  RIGHT$ ("  " +  STR$ (X),3);: NORMAL
     50  PRINT ,: IF  PEEK (49250) > 127 THEN  INVERSE
     60  PRINT  RIGHT$ ("  " +  STR$ (Y),3): NORMAL
     70  IF  PEEK (49152) > 127 THEN  POKE 49168,0: END
     80  GOTO 20

or, if you don't mind having a program that hangs when no joystick at all
is plugged in:

     10  HOME
     20 X =  PDL (0): WAIT 49253,128,128:Y =  PDL (1)
     30  VTAB 10: IF  PEEK (49249) > 127 THEN  INVERSE
     40  PRINT  RIGHT$ ("  " +  STR$ (X),3);: NORMAL
     50  PRINT ,: IF  PEEK (49250) > 127 THEN  INVERSE
     60  PRINT  RIGHT$ ("  " +  STR$ (Y),3): NORMAL
     70  IF  PEEK (49152) > 127 THEN  POKE 49168,0: END
     80  WAIT 49252,128,128: GOTO 20


If the joystick fails under program other than the test program, then you
might have something wrong on your motherboard.

               - Neil Parker
-- 
Neil Parker, nparker@{cie-2,cie}.uoregon.edu, http://cie-2.uoregon.edu/~nparker

     "I was going to be a neo-deconstructivist but Mom wouldn't let me."
                                     -- Calvin and Hobbes, 7/13/1995