(S)NES gamepad adapter for MSX computers

(S)NES gamepad adapter for MSX computers

by ro on 16-10-2017, 08:44
Topic: Hardware

A (S)NES gamepad adapter for MSX computers, works in Basic, uses no components, no machine code! Only wires, connectors and a deceive on BIOS pad() function.

The MSX computers have a built-in BASIC function for reading a touch-pad digitizer connected to the joystick port using the SPI protocol. The digitizer has two axes which are read whenever the function PAD(x) is called and the pen is touching the digitizer screen. A digitizing cycle consists of a bunch of byte transfers, each one initiated by a positive pulse on a given pin, then eight bits are serially read paced by a clock signal.

Such similarity with the NES/SNES controller protocol allows us to attach it directly to the MSX joystick port and read it using the function PAD( ) readily available in BASIC. And that is exactly what MRC user Danjovic did on his hackaday.io project page.

Relevant link: project page

Comments (2)

By Louthrax

Prophet (2406)

Louthrax's picture

16-10-2017, 11:01

Hey that's super interesting! So only 8 buttons (directions, A, B, Select and Start) can be read using the BASIC's PAD instructions, but maybe the other buttons could be read using some assembly?

By gdx

Enlighted (4693)

gdx's picture

16-10-2018, 13:53

The method used is a bit slow. It requires a NOT to read the value then an AND for each condition. Which is a lot of calculations to manage all 4 buttons and all directions for the Basic.