MSX Paddle Controller
This page was last modified 09:28, 9 December 2016 by Mars2000you. Based on work by Gdx and Sd snatcher and others.

MSX paddle controller is quite a simple device, but there are not so many commercial implementations for MSX.

Paddle controller status can be read from BASIC by using PDL() instruction or by calling GTPDL (#00DE) BIOS routine. These will return asked paddle status as value between 0-255

Each joystick port can have up to 6 paddle controllers connected without any button :

VALUE PORT PIN NAME
1 1 1 Joy1 UP
2 2 1 Joy2 UP
3 1 2 Joy1 DOWN
4 2 2 Joy2 DOWN
7 1 3 Joy1 LEFT
8 2 3 Joy2 LEFT
9 1 4 Joy1 RIGHT
10 2 4 Joy2 RIGHT
11 1 6 Joy1 BUTTON A
12 2 6 Joy2 BUTTON A
13 1 7 Joy1 BUTTON B
14 2 7 Joy2 BUTTON B


PLEASE NOTE: the MSX Turbo R does not support paddle any more. In order to use paddle controllers on an MSX turbo R you can use this compatible code:

GTPDL:
	INC	A
	AND	A
	RRA
	PUSH	AF
	LD	B,A
	XOR	A
	SCF
.LOOP:	RLA
	DJNZ	.LOOP
	LD	B,A
	POP	AF
	LD	C,10H
	LD	DE,03AFH
	JR	NC,.PORT1
	LD	C,20H
	LD	DE,4C9FH
.PORT1:	LD	A,0FH
	DI
	OUT     (0A0H),A
	IN      A,(0A2H)
	AND	E
	OR	D
	OR	C
	OUT	(0A1H),A
	XOR	C
	OUT	(0A1H),A
	LD	A,0EH
	OUT	(0A0H),A
	LD	C,00H
.WAIT:	IN	A,(0A2H)
	AND	B
	JR	Z,.DONE
	INC	C
	JP	NZ,.WAIT
	DEC	C
.DONE:	EI
	LD	A,C
	RET

The interesting part is: the paddle controller interface was designed in a way to allow analog and digital signals to be compatible for all pins. This way, an analog joystick could be built this way and read by the GTPDL BIOS function, even with fancy analog buttons like the Playstation-2 controller. Such analog joystick will return progressive analog values accordingly. But, if a standard MSX digital joystick is connected instead, the very same software will still be compatible, as GTPDL will only return 0 or 255 (min and max) values, without graduation. Very similar to the behavior when someone uses a Playstation-1 controller on Playstation-2 games.


The reference paddle controller implementation shown on the official MSX documentation:

MSXpaddle.png