Sunday 7 August 2022

Commodore PET Dual Userport Joystick

There is a a new product, available now from The Future Was 8 bit - Dual Joystick Adapter for Commodore PET  and Mini PET- https://www.thefuturewas8bit.com/shop/tynemouth-products/pet-joystick-adaptor.html

Plugged into the user port of a Commodore PET or Mini PET, this gives you two 9 way D Atari / Commodore compatible joystick ports.

These are supported in some programs, and easy to add to your own code.

The joysticks are connected to the 6522 VIA port A. This can be read from either address 59457 (0xE841) or 59471 (0xE84F), although the former seems to be more commonly used. (the difference is E84F does not alter the handshaking lines, although those are not used in this case)

The signals are low when activated, so it is best to use 255-PEEK(59457) to check the value. 0 means nothing is moving, other values indicate movement.

Value (decimal)
Value (hex)
Port1
Port2
0
0x00
None
None
1
0x01
Up
None
2
0x02
Down
None
4
0x04
Left
None
8
0x08
Right
None
3
0x03
Fire
None
16
0x10
None
Up
32
0x20
None
Down
64
0x40
None
Left
128
0x80
None
Right
48
0x30
None
Fire

It's easier to see in the hexadecimal view, Port1 affects the lower nibble, Port2 the upper nibble. If both are moving, it will be a combination of the two (i.e. 0x41 is port 2 left, port 1 up).

It can also be seen that this is only 8 bits and there are 8 directions and 2 fire buttons. There are not another two inputs that can easily be used so it has become a standard on these things to use the combination of up and down at the same time to represent fire (1 is up, 2 is down, 1+2=3 is fire). That is slightly limiting in that you can't check for a combination of up and fire etc., but it does the job.

In case you forget, all those numbers and the test program are printed on the back of the PCB.

As it states on the back, there is no 5V power to the joystick ports, so autofire type circuits will not work. There is also no support for paddles, mice, light pens, light sabres, toasters or anything else you might try to plug into those ports. Simple directional joysticks only.

This version is using surface mounted parts, which looks a lot neater than my prototype.

Which, although it worked, was a little flimsy. This was built to test the userport on the original Mini PET, and the PCB version to test the Mini PET 40/80. This product has unfortunately been waiting in the wings for a long time.

This arrangement is supported in the Vice emulator. You first need to turn on Userport Joysticks under Input devices / Control port.

Only then is the drop down enabled under Input devices / Joystick

Select the type "PET" from the list.

In the previous blog post, the thing which caused the most interest was a photograph of a mains plug, so I thought I had better include one in here as well.

Joysticks are supported in the three PET titles from The Future Was 8 bit. My two remakes, Tut-Tut and 3D Monster Maze, and Misfit's Cheese and Chive.

Advertisements

The PET Dual Joystick Adapters and games on cassette are available from The Future Was 8 bit:

Update

The TFW8b version is no longer available, but I have designed a new version.

This is available from my SellMyRetro store, as assembled, kit and PCB only versions.


Patreon

You can support me via Patreon, and get access to advance previews of projects and behind the scenes updates. This now also includes access to my new Patreon only Discord server for even more regular updates.

https://www.patreon.com/tynemouthsoftware