• Please review our updated Terms and Rules here

Game port cards

Great Hierophant

Veteran Member
Joined
Mar 22, 2006
Messages
1,928
Location
Massachusetts, USA
One thing I have difficulty understanding is the rather extreme sensitivity of joysticks to system speed. I have heard that certain gameports are not "386 aware". I have also seen other gameports with a little knob to turn on the card to adjust for machine speed.

I don't understand what speed adjustments are made and why they are necessary. Normally, transfers on the ISA bus, where the gameport cards are plugged into, occur at a speed of 4.77MHz to 8.33MHz, depending on whether the bus is 8-bit or 16-bit. That being the case, the programmer should be aware of how quickly the CPU can poll the joystick, and very few adjustments need be made. It should be the responsibility of the programmer to adjust accordingly. So, that being said, why the knobs and headaches?
 
Because not all programmers were as savvy as they should have been.

The speed-adjusting cards were made specifically for games that were written before the AT existed. To those programmers, no faster machine existed or would exist, so they programmed for a machine whose speed would never change. Obviously, this timing is thrown completely off on later machines.

There are two basic ways to code for a joystick: The first is to fire off the one-shots, then loop in a tight loop incrementing a register and testing the bit you're interested in (or all bits, but this is slower and has less resolution). When your bit fires, you stop counting and there's your value. The second is to do the same thing, but use the system timer instead to do the counting. The former method is machine speed-sensitive, but has the smoothest resolution. The latter is not machine speed-sensitive, but has a somewhat coarser resolution.

Optimized documented example code for both methods is in ftp://ftp.oldskool.org/pub/misc/xtfiles.rar in the developr/program/joystick directory in joystick.pas.
 
I have seen gameport cards that advertise the following:

http://cgi.ebay.com/Game-Card-2-Por...76QQihZ015QQcategoryZ4193QQrdZ1QQcmdZViewItem

http://cgi.ebay.com/GamePort-2-Plus...ryZ41993QQrdZ1QQssPageNameZWD1VQQcmdZViewItem

The first card has three positions on its speed knob, but I really don't understand the need for the 66MHz+ speed. The ISA bus should run at 4.77MHz for all 8-bit devices, but if the device is 16-bit, then the maximum any decent motherboard will run the ISA bus at is 8.33MHz.

I believe that when you say the "computer" runs the ISA bus, you really mean that the CPU is running the bus, because the ISA bus is an extention of the 8088 & 80286's I/O bus. The CPU communicates to the bus through in and out commands. In machines faster than 8MHz, those commands must be delayed somehow. In short, because the programmer cannot read the joystick faster than what the bus allows, the speed at which the processort performs other tasks is irrelevant when considering gameport design.

Also, I read once that early Sound Blaster cards' gamports were not "386-aware." The second card I point out advertises it works on the 386. Is this meaningful?
 
trixter is right on with his explanation. on the topic, a buddy of mine at work recently gave me an old 8-bit ISA game port card (unopened in box. there was a sticker that said EGGHEAD $19.99) that has switches for changing the speed. it ranges from 4.77 to 35 mhz i believe.

i am going to stick it in my BMI XT clone and play marble madness when i get around to it! :p
 
The first card has three positions on its speed knob, but I really don't understand the need for the 66MHz+ speed. The ISA bus should run at 4.77MHz for all 8-bit devices, but if the device is 16-bit, then the maximum any decent motherboard will run the ISA bus at is 8.33MHz.

Correct, but those are labeled that way not because actual bus speeds differ, but because the speed of the software differs. When you switch to "higher" machine speeds on the card, it introduces delays in returning the values, so higher-speed software doesn't roll its counters over $FFFF (the reason most joystick routines fail on faster machines). The only reason it's marked "66Mhz" is because, on 66MHz machines, that particular setting worked the best as tested by the manufacturer.

Also, I read once that early Sound Blaster cards' gamports were not "386-aware." The second card I point out advertises it works on the 386. Is this meaningful?

Not being "386-aware" is a very poor choice of marketingspeak, trying to say that the port doesn't have any way to introduce delays to compensate software running on faster machines.
 
Back
Top