3

Looking at the schematic and explanation of how the C64 joystick ports work, it seems clear that the stick direction and button lines (JOYA0, through JOYA3 for port 1 and JOYB0, through JOYB3 for port 2) can also be used as outputs by having the attached device sense the levels of those lines (5V and 0V) and programming the CIA to pull the levels high and low in the same way as is done for keyboard scanning. (Or, for that matter, manually pressing appropriate keys on the keyboard to bring the levels low.)

This should also work on the VIC-20, and perhaps other Commodore computers with joystick ports.

Were any devices that used this technique manufactured and sold? If so, what were they, and how did they deal with keyboard interference with the scanning?

(This question was inspired by a comment on the pagetable.com blog post NES and SNES Controllers on a 6502 (like the C64). It seems to me that you could use the same technique with NES/SNES controllers plugged into the joystick ports instead of the user port, albeit you'd need to deal with the issue of keys pressed on the keyboard interfering with the I/O.)

  • 1
    I recall a digital audio sampler for the Amiga using the (C64 compatible) joystick port to record line level input using 8 bit samples at ~8KHz. Most likely the data were sent 4-bits at a time. – Brian H Aug 13 at 13:14
  • Why not use the Userport instead? It was meant for that sort of things. – Janka Aug 14 at 7:31
  • @Janka Well, that's a quite different question only tangentally related to this one. But some reasons could be: 1) leaving the user port free for other peripherals, such as a modem; 2) lower hardware cost (due to cheaper connector and PC board); 3) connector wear (the user port edge connector is more fragile than the joystick connectors); and 4) non-technical users may feel more comfortable plugging and unplugging with the less intimidating joystick port and connector. – Curt J. Sampson Aug 14 at 7:44
  • 1
    I think the joystick ports are the ones you don't want to use for anything but joysticks as everyone had them. Plus, the internal circuitry didn't feature any EMI protection to the CIA, so most people outright refused to unplug their joysticks and expose the ports. (It was the same for the Userport, but a damaged joystick port meant the box was essentially bricked.) – Janka Aug 14 at 8:09
  • @Janka Even if "everyone had joysticks," non-game software that was more likely to use a modem, A/D or other user port device was less likely to use a joystick. Further, even fewer programs needed two joysticks, so a joystick, user port device and "dongle" could all be used together. But this is really not on topic at all for this question; if you want answers about this you should ask a separate question. – Curt J. Sampson Aug 14 at 8:14
4

The dongle for the PaperClip word processor plugged into joystick port 1. It read bits 0 and 1 from the dongle and wrote bits 2, 3 and 4 to control it.

Keyboard interference probably wasn't an issue with this use case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.