Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site amiga.amiga.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!pyramid!amiga!bruceb From: bruceb@amiga.UUCP (Bruce Barrett) Newsgroups: net.micro.amiga Subject: Re: mouse vs. joystick Message-ID: <898@amiga.amiga.UUCP> Date: Tue, 25-Mar-86 12:41:13 EST Article-I.D.: amiga.898 Posted: Tue Mar 25 12:41:13 1986 Date-Received: Thu, 27-Mar-86 01:15:11 EST References: <1574@gitpyr.UUCP> Reply-To: bruceb@hunter.UUCP (Bruce Barrett) Distribution: net Organization: Commodore-Amiga Inc., 983 University Ave #D, Los Gatos CA 95030 Lines: 99 In article <1574@gitpyr.UUCP> lbg@gitpyr.UUCP (Lee B Grey) writes: >I am curious about the difference between a joystick and a mouse.[...] >The inspiration for this question is the rotating amiga3d demo [...] OK, lets look at this. Game port Track ball pin # Joystick or Mouse 1 Forward V-Pulse 2 Backward H-Pulse 3 Left VQ-Pulse 4 Right HD-Pulse 6 button 1 button 1 CIAB, bit 6 or 7 9 button 2 button 2 At the connection of the mouse to the main Amiga box the signals look like this: Joystick: Imagine 4 simple switches (X) arranged in the following pattern: X Forward Left X o X Right X Backward As the joystick handle is moved closer to a switch contact is made with that switch. (Imagine that they are buttons.) There are 9 unique positions that the joystick can produce: Forward Left Right Backward ------- ---- ----- -------- "At rest" Up Up Up Up "North" Down Up Up Up "South" Up Up Up Down "West" Up Down Up Up "East" Up Up Down Up "NW" Down Down Up Up "SW" Up Down Up Down "NE" Down Up Down Up "SE" Up Up Down Down The normal state of each switch is open (state is logic 1). When closed input is grounded and the state becomes a logic 0. For a forward movement of the joystick the signals would look like this: Start End | | V V ________ ________ Forward \_______/ _________________________ Back _________________________ Left _________________________ Right A mouse generates 2 out of phase signals foe each axis. The way that these are out of phase determines the direction. The number of transitions determines th "distance", or "speed". For example: ____ ____ ____ ____ V pulse |___| |___| |___| ____ ____ ____ ____ V quad |___| |___| |___| might indicate "forward" and: ____ ____ ____ ____ V pulse |___| |___| |___| ____ ____ ____ ____ V quad |___| |___| |___| might indicate backward. Look at the up transitions of V-pulse with respect to the signal value of V-quad. In the first case they occur when V-quad is low, in the second they occur when V-quad is high. This is an example only, I don't have the exact phase information in front of me. Conclusion: =========== If you plug a mouse into a port that is expecting a joystick you will get lots of up/down transitions which look like button presses. Moving vertically should cause forward and left "button presses", moving horizontally should cause back and right "button presses". It should be possible (but quite difficult) to position a mouse such that all 4 of the pulse signals are high and the "joystick port" thinks that it is at rest. Hope this helps. --Bruce Barrett