Kempston Joystick: Difference between revisions

From SpecNext Wiki
Jump to: navigation, search
No edit summary
Ped7g (talk | contribs)
mNo edit summary
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Port
{{Port
|Number=$xx1f
|Number=$xx1F
|NumberDec=31
|PortMask=%---- ---- 0001 1111
|ShortDesc=Reads movement of joysticks using Kempston interface.
|ShortDesc=Reads movement of joysticks using Kempston interface.
|PortMask=%--------000----c
|Readable=Yes
|Readable=Yes
|Writable=No
|Writable=No
|Subsystem=Input
|Subsystem=Input
}}
}}
{| class="wikitable"
!rowspan="2"| Bit !!colspan="2"| Function
|-
! Kempston joystick !! MD controller
|-
| 7 || 0 || start button
|-
| 6 || 0 || A button
|-
| 5 || Fire 2 || C button
|-
| 4 || Fire 1 || B button
|-
| 3 ||colspan="2"| up
|-
| 2 ||colspan="2"| down
|-
| 1 ||colspan="2"| left
|-
| 0 ||colspan="2"| right
|}
For all bits 0 = not pressed / 1 = pressed
since core3.1.4 the X/Y/Z/mode buttons of 6-button controllers are not read by the FPGA (and Fire 1 is "B" button, this page and some other documentation was mentioning button "C", but seems like it was "B" all the time, or got remapped in core3.1.4).
Note for non-programmers: the Next board does read fire1(B)/fire2(C)/A/start buttons of controller and provide the state for SW through this port, but that does not imply the SW will react to the extra buttons. Actually majority of legacy SW was not aware of existence of joysticks with more than one fire button, the "fire2" input in Kempston interface did appear very late in the life cycle of ZX when game producers already moved onto more modern platforms. So support for second fire button or full four button of MD pads needs to be present also in the code of the particular game, either patched version of legacy game, or new production designed for ZX Next.

Revision as of 11:13, 4 May 2020

Port Number $xx1F
Decimal 31
Short desc. Reads movement of joysticks using Kempston interface.
Bit Mask %---- ---- 0001 1111
Readable Yes
Writable No
Subsystem Input
Bit Function
Kempston joystick MD controller
7 0 start button
6 0 A button
5 Fire 2 C button
4 Fire 1 B button
3 up
2 down
1 left
0 right

For all bits 0 = not pressed / 1 = pressed

since core3.1.4 the X/Y/Z/mode buttons of 6-button controllers are not read by the FPGA (and Fire 1 is "B" button, this page and some other documentation was mentioning button "C", but seems like it was "B" all the time, or got remapped in core3.1.4).

Note for non-programmers: the Next board does read fire1(B)/fire2(C)/A/start buttons of controller and provide the state for SW through this port, but that does not imply the SW will react to the extra buttons. Actually majority of legacy SW was not aware of existence of joysticks with more than one fire button, the "fire2" input in Kempston interface did appear very late in the life cycle of ZX when game producers already moved onto more modern platforms. So support for second fire button or full four button of MD pads needs to be present also in the code of the particular game, either patched version of legacy game, or new production designed for ZX Next.