logoalt Hacker News

JKCalhounyesterday at 9:41 PM2 repliesview on HN

I have read as well that the 555 was used in the game paddles for the Apple II. 555 + potentiometer (the part you turned) varied the length (duty cycle?) of a square wave which the Apple II used to determine the paddle position.


Replies

tmoerteltoday at 1:23 AM

The Apple II family did indeed use 555 timers, in either 558 or 556 chips, to drive the timing circuit used to read paddle and joystick positions. The following article explains both the circuit and the reading code:

https://www.applefritter.com/appleii-box/APPLE2/NibbelingAtT...

aidenn0yesterday at 11:04 PM

The port that was standardized on for PC joysticks was the dumbest possible one:

The joystick itself just had 1 potentiometer per axis, wired directly to the port. The port had no A/D, no timer, and no interrupt. Instead there was a GPIO and a capacitor. You discharged the capacitor with a GPIO write, and then polled the GPIO to measure when the capacitor was charged again. The number of iterations through your polling loop would be proportional to the position of the axis.

This is a pain to emulate if you aren't doing cycle-accurate emulation. IIRC Dosbox has a bunch of kludges and still doesn't get the joystick right for every game.

[edit]

To clarify the game port used a 558 (quad stripped-down version of a 555) as a schmitt trigger, so it generated pulses of a width proportional to the potentiometer position. I looked up the Apple II interface and it looks very similar, but with the caveat that accelerated versions (e.g. the IIgs) would always clock to 1MHz when reading the joystick port, compared to the PC that could run at a huge range of clocks (and CPI) over the lifetime of the port.

show 1 reply