A potential project for RetroChallenge:

To adapt an old-style 15-pin PC analogue joystick to act as a SPARCstation mouse. The objective is to have a pointer device that has acceleration and full 360-degree graduation, rather like a mouse that you don’t have to lift up when you go too far (because it is in fact stationary). Altogether, this means that a four-pole digital joystick, such as an Amiga joystick, would not be suitable.

No host-resident software must be necessary – the device must be fully plug-compatible with a standard Sun mouse! If there is time, switchable firmware to allow it to be an SGI mouse or an archaic standard PC serial mouse, would also be good.

The device can be battery-powered or line-powered – and must not require an external power-brick or directly attach to mains power.

The resulting device must be usable to navigate and use the OpenWindows and CDE window-systems, as well as being the direction/speed/fire control for games of Quake on the SPARCstation.

Difficulty Rating: darned difficult, probably needs more time.

As Tomi Engdalh noted:

Provided that you can tolerate poor accuracy, poor repeatability, poor matching between channels, and poor temperature stability, you can use the joystick position inputs as general purpose analogue inputs, but don’t fart too close to them.

WARNING: There is lots of current (many ampreres) available on the PC joystick port without any built-in current limiting. Short circuit on the circuit connected to PC joystick port can cause wires heating, burn thin circuit board traces, crash your computer, damage your PC power supply and even catch fire. I have burnt one flatcable going from PC multi-IO-card to the joystick connector because of short in circuit connected to joystick port! So if you make mistakes your multi-IO-card or soundcard can be in the line to suffer sudden joystick port death. Usually you should be quite safe with if you do not short circuit +5V output to anything and do not apply any external signals to PC joystick port.

TIP: If you want to play with the joystick interface safely without danger of frying anything you should put some kinf of current limiting device in series with the +5V output on the connector which plugs to your joystick port. One way to do that is to put a 100mA..1A fuse in series with the +5V output. If somehing goes wrong, the fuse will blow and no damages are caused. Another possibility is to connect a current limiting resistor in line. A resistor of around 100-500 ohms (at least 1/4W power rating) soldered directly into the ‘D’-type solder bucket (short lead wire, sleeved and no solder-shorts to nearby pins!) will make no practical difference to the joystick circuit operation and bring the worst case circuit current down to the mA region.

Some have said that primary issue is that the PC analogue joystick interface uses fixed-voltage variable-current positional signals (I’m doubtful of this, but if so: ouch!) which will need to be converted into Logitech/Mouse-Systems 1200 baud digital RS-232 signalling 5-byte packet protocol. The button signals are easy – simple 5V on/off switches that can be directly passively routed through to the Sun mouse port.

Hardware-wise,  this would require a variable-current-to-variable-voltage circuit (discrete components), a prototype board, a programmable microcontroller with built-in ADC and UART (an AVR or PIC microcontroller would do), a power-supply (battery-pack with on/off switch), and finally a donor Sun mouse to provide the final cable/plug.

Designing the microcontroller program and figuring out exactly what pre-conversion circuit is needed are going to be hard – I haven’t had to deal with electronic circuit calculations since high-school, more than 30 years ago!
Physical assembly of the pre-conversion circuit will be pretty easy, if I ever get that far.