Atari Keyboard Controller on MSX Joystick Port

بواسطة Danjovic

Champion (344)

صورة Danjovic

25-08-2022, 01:23

Following up the post about the joystick port, I wondered how to connect the Atari Keypad Controller (aka Video Touch Adapter or Kid's Controller) on the MSX.

Atari keypads are a 3x4 matrix that can be read by MSX by pulling down consecutively the pins 6, 7, 8 to select the rows while the colums are read on the pins 1, 2, 3, 4. A key pressed will appear as LOW.

Of course a rewire is necessary, along with one diode and one resistor to make an output collector from pin 8 (which are not essential but can prevent pin contention caused by a combination of wild code an many keys pressed at the same time. The pins 6 and 7 are already open collectors and does not require such expedient.

I have also wrote (and optimized) a raw scanning routine in assembly (72 bytes Code + 3 bytes Data) that can work in either joystick port as well as a BASIC program to demonstrate the code working (with a DIY keypad ;) ).

All sources are available at Github, and for the impacient there is a link to a video

Login أوregister لوضع تعليقاتك

بواسطة aoineko

Paragon (1138)

صورة aoineko

18-11-2022, 19:09

Do you have a method to detect such device against normal MSX joystick?

بواسطة Danjovic

Champion (344)

صورة Danjovic

18-11-2022, 23:44

aoineko wrote:

Do you have a method to detect such device against normal MSX joystick?

That would require to "press a button in keypad or move the joystick to any direction".

بواسطة aoineko

Paragon (1138)

صورة aoineko

19-11-2022, 00:38

Using X 4-bits matrix to get more buttons (like we do for mouse on MSX) seem to me the cleaner way to handle pad with more than 2 boutons, but I think we need to be able to detect them accurately.

A solution could be to return buttons pressed to 1 in the first matrix, to 0 in the second and to 1 in the third. This way, when idle, we could detect this device.

If I understand correctly, this means using the "MSX-HID" method to detect them.

بواسطة Danjovic

Champion (344)

صورة Danjovic

19-11-2022, 11:56

If I give up the simplicity and add an Integrated Circuit and a bunch of diodes it is possible to build an adapter that can support both the keyboard controller and a single button joystick, connected at the same time, using basically the same driver. And there's more: the joystick can still be read by Basic.

The rows of the keyboard connected at X2 are selected by the pins PULSE (8) and TRIGGER_B(7) (which is bidirectional). The default state of these pins are PULSE->0 and TRIGGER_B->1 which selects the common line of the joystick, thus allowing the single button joystick connected to X3 to be read using BASIC.

Detection is possible by Selecting the third keyboard ROW, then diode D5 will bring down the level on the TRIGGER_A line. The other keyboard rows will keep this line high.