Difference between revisions of "Analog Joysticks"

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search
(CPC+ Software with Analog Joystick Support)
m (Analog PC Joysticks)
 
(19 intermediate revisions by 5 users not shown)
Line 10: Line 10:
  
 
The analog inputs are read from memory mapped ASIC registers:
 
The analog inputs are read from memory mapped ASIC registers:
   6808h  ADC0  Analogue Joystick 1, X-Axis (00h=Left=0 ohm, 3Fh=Right=180K ohm)
+
   6808h  ADC0  Analogue Joystick 1, X-Axis (00h=Left=0 ohm, 3Fh=Right=138K ohm)
   6809h  ADC1  Analogue Joystick 1, Y-Axis (00h=Up  =0 ohm, 3Fh=Down =180K ohm)
+
   6809h  ADC1  Analogue Joystick 1, Y-Axis (00h=Up  =0 ohm, 3Fh=Down =138K ohm)
   680Ah  ADC2  Analogue Joystick 2, X-Axis (00h=Left=0 ohm, 3Fh=Right=180K ohm)
+
   680Ah  ADC2  Analogue Joystick 2, X-Axis (00h=Left=0 ohm, 3Fh=Right=138K ohm)
   680Bh  ADC3  Analogue Joystick 2, Y-Axis (00h=Up  =0 ohm, 3Fh=Down =180K ohm)
+
   680Bh  ADC3  Analogue Joystick 2, Y-Axis (00h=Up  =0 ohm, 3Fh=Down =138K ohm)
 
   680Ch  ADC4  Unused, wired to +5V (twice the maximum of 2.5V)  (returns 3Fh)
 
   680Ch  ADC4  Unused, wired to +5V (twice the maximum of 2.5V)  (returns 3Fh)
 
   680Dh  ADC5  Unused, wired to GND (equivalent to 0 ohm)        (returns 00h)
 
   680Dh  ADC5  Unused, wired to GND (equivalent to 0 ohm)        (returns 00h)
Line 19: Line 19:
 
   680Fh  ADC7  Unused, wired to GND (equivalent to 0 ohm)        (returns 00h)
 
   680Fh  ADC7  Unused, wired to GND (equivalent to 0 ohm)        (returns 00h)
 
To read that registers: Unlock the ASIC, and then map its register to memory at 4000h..7FFFh.
 
To read that registers: Unlock the ASIC, and then map its register to memory at 4000h..7FFFh.
 +
 +
Values measured by Octoate:
 +
  ADC input at 00h..01h  =  0 Ohm    (left/up)
 +
  ADC input at 1Fh..20h  =  50 kOhm  (center) (that is, the center of ADC values, not of the resistor values)
 +
  ADC input at 3Eh..3Fh  =  138 kOhm  (right/down)
  
 
== Analog CPC+ Joysticks ==
 
== Analog CPC+ Joysticks ==
  
Currently, the only known CPC+ compatible analogue joysticks is the Sinclar SPJ-1.
+
Analogue joysticks confirmed to be compatible with the CPC+:
 +
* [[Amstrad Analogue Joystick AJ-5]]
 +
* [[Sinclair SPJ-1|Amstrad's Sinclair SPJ-1]]
  
<gallery caption="SPJ-1 Sinclar Professional Joystick">
+
Arnold 5 Diagnostic cart test results -
Image:Joystick SPJ-1 with Box.jpg|SPJ-1 with Box
+
Image:Joystick SPJ-1 Booklet.jpg|SPJ-1 Booklet
+
</gallery>
+
  
The SPJ-1 (Sinclair Professional Joystick) was produced to accompany [[Amstrad]]'s unsuccessful Sinclair PC200 (an old PC with 8086 processor). The SPJ-1 was a fully-fledged analogue joystick, with potentiometers used to measure input (rather than switches as in its digital precessors). It was probably a rebadged PC-standard device. The SPJ-1 was, like its host machine, a flop, and today appears to be exceptionally rare.
+
{| class="wikitable"
 +
|-
 +
! Manufacturer !! Model !! Fire Common !! Resistor !! Centre X !! Centre Y !! X Axis min !! X Axis max !! Y Axis min !! Y Axis max !! Ref !! Notes
 +
|-
 +
| Quickshot || QS-6219 || Pin 4 || TBC || &1a-&27 || &1c-2b || &00-&0f || &2c-&33 || &00-&12 || &31-&35 || dthrone || Ranges correspond to x and y axis adjust sliders
 +
|}
  
 
== Analog PC Joysticks ==
 
== Analog PC Joysticks ==
  
Analog PC Joysticks have a very similar 15pin connector. Theoretically, a few PC joysticks might be CPC+ compatible. However, in practice, this is rather unlikely - the potentiometers must have correct value, the button common pin must be correct, and the joystick may not contain additional electronics like auto-fire circuits, electrolyte capacitors, or digital-switch to analog-signal converters.  
+
Analog PC Joysticks have a very similar 15pin connector. But with some differences, which cause compatibility problems. Statistically, many people reported the analog PC joysticks '''do work''' with analog CPC+ software. Many other people reported it won't work - though it's quite possibly that they simply made some fundamental mistakes (like trying to use "digital" 15pin joysticks as "analog" joystick, or that they didn't even had proper CPC+ software for testing).
  
* '''Caution''' - compared with PCs, the CPC+/GX4000 do output '''reversed polarity on the joysticks power supply''' pins, so any special electronics in '''PC joysticks may get destroyed''' when connecting them to a CPC Plus/GX4000.'''
+
* '''Button Common Pin''' - In PCs, the button-common-pin can be at Pin4 or Pin5, on the CPC+ it must be Pin4 (or Pin12 for 3rd-4th button; if any). If necessary, rewire that pins.
  
If you want to use a PC joystick: Remove any electronics other than the potentiometers and buttons. Ensure that buttons are wired to correct common pin. And, probably you'd need to replace the potentiometers (if they aren't 180K) - however, this may be the complicated part: potentiometers in analog joysticks aren't necessarily matching standard mechanical dimensions.
+
* '''Reversed Supply Voltages''' - Compared with PC Gameports, the +5V and GND are connected vice-versa in the CPC+. This is no problem for the potentiometers (both PC and CPC+ use Pin1 as pot-common). However, it is a problem if the joystick contains '''additional electronics''' (auto-fire circuits, electrolyte capacitors, circuits inside of ''digital'' joysticks/gamepads that do emulate analog signals, etc.) These won't work (and may get damaged by the reversed voltages). If necessary, remove any such electronics before connected the joystick to the CPC+.
 +
 
 +
* '''Resistor Values''' - In PCs, the A/D conversion is done by software timings, meaning the PCs could handle joysticks with different potentiometer types (anything from 10 kiloohm to many megaohm should work). The CPC+ does the A/D conversion by hardware, this requires less CPU load, but it also means that it requires fixed potentiometer types (circa '''138k'''Ω).
 +
** Analog PC joysticks are reportedly most commonly using '''100k''', '''120k''', or '''150k'''Ω pots. These types should be more or less compatible with the CPC+ (100K/120K won't reach the ADC=3Fh max value, for example, resolution might be only ADC=00h..30h. And 150K would be clipped to ADC=3Fh for anything above 138kΩ).
 +
** To handle those different pot types, CPC+ software should include calibration options.
 +
** There are also some PC joysticks with incompatible pot types like '''300k'''Ω - these won't work (since values above 138k will be clipped).
  
 
== CPC+ Software with Analog Joystick Support ==
 
== CPC+ Software with Analog Joystick Support ==
  
* [[Tennis Cup 2 ( Cartridge )]] - allows to use Analog Joystick (as digital joystick replacement in two-player mode, selectable in options menu - the game merely emulate digital inputs, it doesn't actually support analog input)
+
* [[FutureOS]] - (Plus version)
 +
* [[Tennis Cup 2 ( Cartridge )]] - allows to use Analog Joystick (as digital joystick replacement in two-player mode, selectable in options menu - the game merely emulates digital inputs, it doesn't actually support analog input)
 
* RP11 Arnold V diagnostic ROM cartridge - allows to display the eight ADC inputs in numeric form
 
* RP11 Arnold V diagnostic ROM cartridge - allows to display the eight ADC inputs in numeric form
*[[FutureOS]] - homebrew operating system (Plus version)
 
  
[[Category:Hardware]][[Category:Peripherals]][[Category:CPC Plus]][[Category:Stub]]
+
 
 +
[[Category:CPC Plus]]
 +
[[Category:FutureOS]]
 +
[[Category:Games Programming]]
 +
[[Category:Input Device]]
 +
[[Category:Peripherals]]

Latest revision as of 19:27, 14 June 2018

The CPC+ and GX4000 contain an analog joystick port (additionally to the normal Digital Joystick port).

Technical

The connector is similar as PC/Soundblaster joystick ports, for details on the pin-outs (and differences between CPC and PC joysticks), see:

The buttons are accessed same ways as for Digital Joysticks (ie. as part of the keyboard matrix).

The analog inputs are read from memory mapped ASIC registers:

 6808h  ADC0  Analogue Joystick 1, X-Axis (00h=Left=0 ohm, 3Fh=Right=138K ohm)
 6809h  ADC1  Analogue Joystick 1, Y-Axis (00h=Up  =0 ohm, 3Fh=Down =138K ohm)
 680Ah  ADC2  Analogue Joystick 2, X-Axis (00h=Left=0 ohm, 3Fh=Right=138K ohm)
 680Bh  ADC3  Analogue Joystick 2, Y-Axis (00h=Up  =0 ohm, 3Fh=Down =138K ohm)
 680Ch  ADC4  Unused, wired to +5V (twice the maximum of 2.5V)   (returns 3Fh)
 680Dh  ADC5  Unused, wired to GND (equivalent to 0 ohm)         (returns 00h)
 680Eh  ADC6  Unused, wired to +5V (twice the maximum of 2.5V)   (returns 3Fh)
 680Fh  ADC7  Unused, wired to GND (equivalent to 0 ohm)         (returns 00h)

To read that registers: Unlock the ASIC, and then map its register to memory at 4000h..7FFFh.

Values measured by Octoate:

 ADC input at 00h..01h  =  0 Ohm     (left/up)
 ADC input at 1Fh..20h  =  50 kOhm   (center) (that is, the center of ADC values, not of the resistor values)
 ADC input at 3Eh..3Fh  =  138 kOhm  (right/down)

Analog CPC+ Joysticks

Analogue joysticks confirmed to be compatible with the CPC+:

Arnold 5 Diagnostic cart test results -

Manufacturer Model Fire Common Resistor Centre X Centre Y X Axis min X Axis max Y Axis min Y Axis max Ref Notes
Quickshot QS-6219 Pin 4 TBC &1a-&27 &1c-2b &00-&0f &2c-&33 &00-&12 &31-&35 dthrone Ranges correspond to x and y axis adjust sliders

Analog PC Joysticks

Analog PC Joysticks have a very similar 15pin connector. But with some differences, which cause compatibility problems. Statistically, many people reported the analog PC joysticks do work with analog CPC+ software. Many other people reported it won't work - though it's quite possibly that they simply made some fundamental mistakes (like trying to use "digital" 15pin joysticks as "analog" joystick, or that they didn't even had proper CPC+ software for testing).

  • Button Common Pin - In PCs, the button-common-pin can be at Pin4 or Pin5, on the CPC+ it must be Pin4 (or Pin12 for 3rd-4th button; if any). If necessary, rewire that pins.
  • Reversed Supply Voltages - Compared with PC Gameports, the +5V and GND are connected vice-versa in the CPC+. This is no problem for the potentiometers (both PC and CPC+ use Pin1 as pot-common). However, it is a problem if the joystick contains additional electronics (auto-fire circuits, electrolyte capacitors, circuits inside of digital joysticks/gamepads that do emulate analog signals, etc.) These won't work (and may get damaged by the reversed voltages). If necessary, remove any such electronics before connected the joystick to the CPC+.
  • Resistor Values - In PCs, the A/D conversion is done by software timings, meaning the PCs could handle joysticks with different potentiometer types (anything from 10 kiloohm to many megaohm should work). The CPC+ does the A/D conversion by hardware, this requires less CPU load, but it also means that it requires fixed potentiometer types (circa 138kΩ).
    • Analog PC joysticks are reportedly most commonly using 100k, 120k, or 150kΩ pots. These types should be more or less compatible with the CPC+ (100K/120K won't reach the ADC=3Fh max value, for example, resolution might be only ADC=00h..30h. And 150K would be clipped to ADC=3Fh for anything above 138kΩ).
    • To handle those different pot types, CPC+ software should include calibration options.
    • There are also some PC joysticks with incompatible pot types like 300kΩ - these won't work (since values above 138k will be clipped).

CPC+ Software with Analog Joystick Support

  • FutureOS - (Plus version)
  • Tennis Cup 2 ( Cartridge ) - allows to use Analog Joystick (as digital joystick replacement in two-player mode, selectable in options menu - the game merely emulates digital inputs, it doesn't actually support analog input)
  • RP11 Arnold V diagnostic ROM cartridge - allows to display the eight ADC inputs in numeric form