Close
0%
0%

(S)NES gamepad adapter for MSX computers

Works in Basic, uses no parts, no machine code!

Similar projects worth following
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.
Further details can be seen in the link below, but it is enough to know that 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.

Link to the article: https://goo.gl/3j3YLw

Due to the similarity from the similarity of the waveforms from MSX reading the digitizer using the PAD( ) function and the NES (SNES) controller protocol, the adapter circuit can solely consists of a straight cable.


The connections for the NES and SNES controllers are shown below. A wire connects the pin 1 to ground is also required since it tells the MSX BIOS routines that the digitizer is being touched.

A short patch cable was used to build the adapter.


A small code was used to test the interface


And here's a video showing the code at work

Here's a sample of  code that shows how to use the controller in BASIC programs.

10 a = pad(0) ' dummy
20 p = not pad(1) ' read X coordinate 
30 if (p & 1) then ….  ' Right
40 if (p & 2) then ….  ' Left
50 if (p & 4) then ….  ' Down
60 if (p & 8) then ….  ' Up
70 if (p & 16) then ….  ' Start
80 if (p & 32) then ….  ' Select
90 if (p & 64) then ….  '  B on NES, Y on SNES
100 if (p & 128) then ….  ' A on NES  B on SNES 

Limitations:

Since the MSX digitizer works with 8bit transfers, only the 8 first buttons from SNES controller are read.

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates