PDA

View Full Version : Slowing Down Joystick Game Cards



Grandcheapskate
February 1st, 2015, 09:25 AM
Hi Guys,
I posted this also in the harware section (as Addison Game Cards), but maybe it should have gone here instead.

I have Addison 8 bit ISA game cards installed in a few of my 386 and 486 computers. These cards have two game ports to allow two joystick operation. The cards come with software which (supposedly) allows you to manually match the card to the speed of your CPU. The card is also supposed to be able to automatically detect the CPU speed of anything from a low of 4MHz (I believe) to a high of 80MHz and set the card speed accordingly.

Right now I am working on two true 486DX-50s with these cards. The cards detect the CPU speed as 25 MHz. However, the joystick is being read way too fast even when I manually set the game card speed at 80Mhz. Any press of a button acts as if I am pressing it multiple times. You know how some games (Raptor for example) ask to calibrate the joystick at the beginning of the game by moving the joystick center, left and right and pressing a button at each location? Well, one press of the button causes it to read multiple button presses so I can't calibrate it.

Is there a way to get these cards to work on anything but the slowest CPUs?

Thanks...Joe

deathshadow
February 1st, 2015, 02:22 PM
The speed adjustment on such joystick interfaces have NOTHING to do with button presses. Completely unrelated. Such 'adjustments' just change the range of the capacitor used to trigger the joystick position, so that older programs that don't use big enough a variable to track the position doesn't overflow.

The Joystick interface in a PC isn't really a DAC, it's a cheat. It's just a capacitor, transistor and the varistor in the joystick. You write to the port to discharge the capacitor, the position of the joystick changes the resistance and therein how long it takes for the Cap to charge. When the cap is charged the value at the port changes... so to read the joystick you write to discharge, and loop until it changes. the number of loops is the joystick position. Changing out the resistance increases or decreases the charge time. That's ALL those "speed adjustments" should be changing. Some older software only used 8 bits to store it, and faster machines could loop more than 255 times before the cap charges. I use word-width, which with my slower routine that checks all four axis the slowest delay on a 2.4ghz P4 is around ~11K loops -- but a theoretical "flat out" single axis reader can easily break past the 65K value limit on as little as a 486/33. That's what that "speed" adjustment is for.

Reading a button is just one of the high 4 bits on the port, it's either on or it's off -- there isn't a damned thing you could do on a game port to change the 'speed' of a button press.

It SOUNDS like you're running crappy software with no debounce delay or release detection. If you're trying to run older DOS software (at/earlier) you might want to look at something like ATSLOW to slow down the faster machine as if it's detecting button presses too fast, that's NOT a hardware problem, it's a software one.

deathshadow
February 1st, 2015, 02:34 PM
Oh, and laughably, that "speed adjustment" on those cards does NOT "slow them down" -- it actually lowers the charge threshold to speed up how long a stick position read takes... faster the system, the faster you need it to charge so the less loops that go by before the bit flips on the port.

But again, has nothing to do with button reads.

Grandcheapskate
February 1st, 2015, 06:58 PM
Thanks for the explaination, although I must confess I don't understand most of it. However I do get the jist of what you are saying - I need to either run these games on slower machines or find some software which slows down their reaction time.

Thanks...Joe

Great Hierophant
February 2nd, 2015, 09:22 AM
It sounds like either your game cards or your joystick has a turbo button feature. In this case, a transistor causes rapid pulses down the button line when the button is pushed. Thus instead of a single button press, your program sees a very fast series of button presses, even though you are just holding down the button. Your joystick should have a switch or a slider on it, and your game card could have a jumper or a switch but the issue is more likely the speed setting software.

Scali
February 2nd, 2015, 09:48 AM
It sounds like either your game cards or your joystick has a turbo button feature.

Yes, on some joysticks this is called 'auto-fire'. See any switches for that on your joystick?

Grandcheapskate
February 2nd, 2015, 11:07 AM
Yes, on some joysticks this is called 'auto-fire'. See any switches for that on your joystick?

No, neither joystick I tried has a turbo switch. One has no switches at all (not even trim settings) while the other only has a trim settings for the X and Y axis. I have used the same model joystick on a Cyrix Pentium class (120 MHz) machine with the joystick connected to a 16 bit sound card and usually have no issue (although I can sometimes get a double read).

So it seems the issue is worst when connected to the 8 bit game card. I think I will remove the gamecard, enable the joystick port on the 16 bit sound card (on the 486DX/50) and see if there is a difference.

Thanks...Joe

Trixter
February 2nd, 2015, 12:00 PM
Grandcheapskate: The TL;DR edition of "Why do games not work with joysticks on faster computers?" is this: Most programmers wrote their own code to interface with joysticks, and some programmers wrote better code than others. The worst code doesn't work on any system faster than what the original programmer was using when he wrote the joystick routine.

Some joystick cards had "speed switches" that scaled the card's ranges (ie. on slow systems, X and Y range is -100...100; on fast systems, range is -3000..3000) to help the user cope with bad software, but the cards can't fix everything. The only sure-fire solution is to slow down the system via hardware (go into the BIOS and disable caches, lower the CPU frequency, etc.)... or, track down the programmer and get him to rewrite the routine.

There is a standard BIOS API for reading the joystick, but nobody used it because it didn't exist until ~1984, it was not widely supported on compatibles, and it was very slow.

There is a way to write joystick code that works on every system regardless of speed, using the system timer as a timing source (rather than a tight software loop). Unfortunately, as you've found out, not many people used this method.

Scali
February 2nd, 2015, 12:19 PM
I think I will remove the gamecard, enable the joystick port on the 16 bit sound card (on the 486DX/50) and see if there is a difference.

From what I understood, the reason you want to use the 8-bit card is because it has two ports, right?
Most sound cards (at the very least the real Sound Blasters, probably most clones as well) actually have two joystick ports as well.
There is only one 15-pin connector on the back, because there's not enough room for a second one. The unused pins on the 15-pin connector are used for the second joystick. You can use a simple Y-cable to connect two joysticks.
Like this one for example: http://www.ebay.com/itm/like/321634300322
I bought one for my Sound Blaster Pro 2.0 back in the day, and it worked fine.

Grandcheapskate
February 2nd, 2015, 06:55 PM
From what I understood, the reason you want to use the 8-bit card is because it has two ports, right?
Most sound cards (at the very least the real Sound Blasters, probably most clones as well) actually have two joystick ports as well.
There is only one 15-pin connector on the back, because there's not enough room for a second one. The unused pins on the 15-pin connector are used for the second joystick. You can use a simple Y-cable to connect two joysticks.
Like this one for example: http://www.ebay.com/itm/like/321634300322
I bought one for my Sound Blaster Pro 2.0 back in the day, and it worked fine.

I don't need the second joystick port - at least I haven't found a reason for using one yet. I bought these cards long ago in case I wanted to use two joysticks, but also because I thought they would aid in slowing down the joystick in faster 486 machines. Oh well....

It is nice to know about using the "Y" cable on standard sounds cards.

Joe