All systems that use the Atari 9 pin joystick standard make use of the following pins in consistent ways, with each direction and the fire button being connected to the ground pin when pushed.

1 - up
2 - down
3 - left
4 - right
6 - fire
8 - ground

However the Sega Master System also has a second fire button that connects pin 9 to ground.

In addition, the Kempston compatible interface available from ByteDelight for the ZX Spectrum (http://benophetinternet.nl/ebay/Kempston%20Joystick%202013%20manual%20small.jpg) can read a second button that connects pin 9 to ground.

Furthermore, (correct me if I'm wrong) the Commodore Amiga can also read a joystick button wired this way being pushed, as although it treats pin 9 as an analog input, the Amiga's analog pins are active low.

However, although the Cheetah Annihilator joystick used with the Commodore 64 GS (and compatible with a regular Commodore 64) was a 2 button joystick that used pin 9 for the second button, it connected it to the 5 volts on pin 7 instead as the Commodore 64 analog pins are active high.

Is there some circuit I could create (maybe using 74 series logic gates, transistors, capacitors and resistors) that could detect the absence of a voltage on pin 9 when plugged into a c64 that would allow me to create a 2 button joystick that would automatically work in all these scenarios? Or at least one with a switch that if it were set incorrectly would at least not cause any damage to any system it might be plugged into?

Edit: I understand that many other systems also use a variant of the Atari standard, but I'm primarily interested in building a joystick that only needs to support the ones I've mentioned in my question. It seems most systems with more than 1 joystick button connected a pin to ground somehow anyway (other than the C64), so a simple rewired pass through adapter might be usable elsewhere.

I guess the crux of my question involves how to detect the joystick is plugged into a C64 rather than something else and auto-switch accordingly without damaging any chips in the computer.

Furthermore, (correct me if I'm wrong) the Commodore Amiga can also read a joystick button wired this way being pushed, as although it treats pin 9 as an analog input, the Amiga's analog pins are active low.

All the "early" Atari-derived systems read pins 5 and 9 as analog. There may be later designs, like MSX, that work differently, but the Atari, C64 and Amiga all support this.

The standard used connect-to-ground for the "digital" functions, including both the joysticks and fire buttons on both the sticks and pretty much everything else. So, normally-high.

In the Atari, the only one I'm really familiar with, the paddle controllers were wired to send the +5 into the potentiometers in the paddle, and then into the I/O port where they connected to a capacitor. The resistance in the POT controlled the charging rate of the cap, and when it reached a certain threshold (3.7V?) it triggered an interrupt. That simply copied the value of the color clock, the current horizontal location of the TV beam, into a RAM "shadow register". Since the sprites used the same values for their horizontal position, simply copying that value to the sprite's X-axis register did all you needed.

So, in the Atari at least, the pins would be normally low. And you mention that the Amiga was the same. So the surprising thing about your post is that you state the C64 does not work this way. Are you sure? I ask for two reasons; one is that I know people who use Atari pot controllers on the C64, and two, it seems extremely odd they would change this, and then change it back.

In any event, I strongly suspect there is no possibility of "damage" caused by plugging in a joy with this button into any Atari or Commodore, but I am less clear on what you mean by "the systems you mention"? The ZX interface was designed to work with CX40s, so I assume that is also compatible.

UPDATE: According to the paddle page on the C64 wiki, the C64 is indeed normally low and works exactly like the Atari system with pots between pin 7 and 5/9 and caps to ground.

  • Oh, I should add that reading this second fire on the Atari should simply be a matter of turning on the POT scanner and looking for any value in the shadow register. I assume this would be almost identical on the C64 and Amiga. – Maury Markowitz May 28 at 14:59
  • Although I was aware that the Atari 2600 joystick ports were wired the same as in a C64, it's a good point that you make that it's everyone else that deviates from the Atari standard. As for the Amiga, I have been incorrect in stating how its joystick ports were wired. I've read that it could read the second button on a master system/megadrive joypad that connects pin 9 to ground. Indeed, some games such as the Amiga version of the game Flashback made use of this capability. Out of interest, would such a button between pins 8 and 9 cause any damage to the pots in the c64? – Paul Humphreys May 29 at 18:34
  • 1
    I really doubt connecting 8 to 9 would be a problem on the C64. The analog port is normally low, so connecting it to ground should do exactly nothing. But what of the Amiga? If the trigger was connect-to-ground, that does imply it was being held high, and thus different from the Atari and C64. Are you sure this is the way the port worked? I'd recommend looking that up in the Amiga hardware refs. – Maury Markowitz May 29 at 18:52
  • I'm not sure that how the Amiga's ports worked, only what was written in the manual for that game (search for "unmodified Mega Drive type"): lemonamiga.com/games/docs.php?id=653 – Paul Humphreys May 29 at 19:30
  • @MauryMarkowitz: On the Atari 2600, the paddle-pot hardware supports have five operations: 1. Reset four timers whose duration is proportional to resistances attached to the four paddle inputs (an open-circuit is a near-infinite resistance, yielding a near-infinite time); 2. Check whether the paddle 0 timer has expired yet; 3. Likewise for the paddle 1 timer; 4. ...paddle 2 timer; 5 ...paddle 3 timer. There is no "shadow register". – supercat May 29 at 20:13

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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