Parallel interface using a chip MHB8255 (any 82C55) and is is based on schematic of the old ZX interface UR-4.
The Kempston joystick is connected to gate A of the parallel chip activated by port 31 so the joystick is usable as kempston in ZX Spectrum games.
From Facebook