dbk@fbog.UUCP (Dave B. Kinzer @ Price Rd. GEG) (11/06/88)
[I just don't get those lineeater jokes. heh heh heh] OK, here is the summary so far. As a response to a challenge issued right here on the net, I decided to write an article to advance the state of the Amiga. I chose a topic, an analog joystick. I then designed a circuit to adapt IBM and Apple joysticks to work with the Amiga (I understood how the hardware works, so this part wasn't hard), writing the article as I went along. I then got to the point of writing a sample program, to demonstrate the software interface. What software interface you say? Imagine my surprise! I had ASSUMED it existed. Well, I resolved to fix this shortcoming and do so in a proper manner. I am writing a *device-driver* to take care of analog joysticks. It will be a logical extension of the present gameport device so little revamping of the application programs will be necessary if C-A picks it up. (Hopefully only the device name will have to change.) My current plan is to make the device driver freely available (I owe the public domain that much), publish an article on how to make the joystick adapter (for those who like these kinds of things), make a pc-board available for those who don't want to hack their own, and *sell* an adapter for those who do not want to mess with it at all. Also in the article will be the example program with text as to how to call the driver, using center deadbands and dead end zones. The driver and sales ideas have come late in this development, but seem necessary to assure software vendors will pick up on the idea. I am sure I will need some help doing this driver, many many holes exist in the RKM documentation of this. Some people on the net have been proposing that a capacitor paralleling the internal Amiga joyport capacitors will fix the joysticks. This is essentially true and a very low cost way of adapting the controller, but unless you know what is going on inside the Janus chip (I know I don't have the max power specs), it seems a little dangerous (as explained in the article). Of course, since apparently you can connect +5 directly to the pin (joystick in zero ohm position), it should work. -- | // You've heard of CATS and DOGS, I'm from GOATS, Dave Kinzer | | // Gladly Offering All Their Support! noao!nud!fbog!dbk | | \X/ "My employer's machine, my opinion." (602) 897-3085 |
cs161agc@sdcc10.ucsd.EDU (John Schultz) (11/07/88)
ANALOG JOYSTICK SOLUTION/PROPOSALS We have built simple adapters and written the necessary software to support Intuition Compatible analog joysticks. The necessary hardware: 1 DB-9 female connector 1 DB-15 female " " 2 .22 Micro Farad capacitors 6 Strips of wire and solder 1 IBM Analog Joystick (I used a Gravis Mk VI) Wiring: Amiga DB-9 IBM DB-15 Button 1 3 2 Button 2 4 7 PotX 5 6 +5 Volts 7 1 Ground 8 4 PotY 9 3 Button 3 2 10 Capacitors: (Both on the Amiga DB-9) Solder one from pin 5 to pin 8, and the other from pin 9 to pin 8. (Each pot to ground, putting the capacitor in parallel with the RC circuit). NOTE: On my Gravis the range was 0..223, on my Hayes Mach III (Apple) the range was 0..255. I wired another .1 uF in parallel on the Gravis and brought the range up to 255, so a higher value cap may be needed for IBM joysticks. I'll check on this... Software: You can use any software that drives analog joysticks as outlined in the Hardware Manual (Examples have been posted and are on the Developer's Conference Disks). For Example, SubLOGIC's Jet (early versions that supported analog joysticks) works fantastic (Type "J" to switch to analog). My latest game SpaceSpuds will support analog joysticks in the Release version (any day now), and also my next two player over-the-modem version. I have heard from Dave Albrecht (sp?) who is now supporting analog joysticks in his game (Air Battle?). Thanks Dave for the clues to the correct cap values. Proposal: C-A: Why were pins 3 and 4 chosen for the fire buttons? We are going to support three fire buttons and pins 1,2, and 3 would be the most logical for buttons 1-3 (or even 1-4). Currently we are using pin 2 as button 3. Analog Joystick Library: We are writing an Analog Joystick Library, to be called from any language. C-A: Do you have any input? Any reason to handle it as a device? If a C-A version is in the works, what should we do to make ours functionally compatible? As soon as completed, we'll make the ajoystick.lib available to everyone. If enough developers are willing to support analog joysticks, we'll look into mass-marketing the adaptor. Many people already have PC joysticks, they are cheap $20-$50, and can be used on both computers. We also wired up an Apple // joystick, but the button polarity is reversed (or maybe we hosed it up taking it apart so many times; it'll probably work). All parties interested, send email. Thanks, John
oconnor@sungod.steinmetz (Dennis M. O'Connor) (11/07/88)
An article by dbk@fbog.UUCP (Dave B. Kinzer @ Price Rd. GEG) says: ] Some people on the net have been proposing that a capacitor paralleling ] the internal Amiga joyport capacitors will fix the joysticks. This is ] essentially true and a very low cost way of adapting the controller, but ] unless you know what is going on inside the Janus chip (I know I don't have ] the max power specs), it seems a little dangerous (as explained in the ] article). Of course, since apparently you can connect +5 directly to the ] pin (joystick in zero ohm position), it should work. No, it doesn't. I've tried it. The Paula chip is probably current-limited, since when I connected a larger ( 0.1 uf ) cap in parrallel, it didn't discharge fully. This may be the fault of the software ( I was using Flight-Sim II from Sublogic ). The obvious way to fix it is to hold the discharge switch on for a bit longer : it's not clear to me whether software can adjust the timing or not. With the pots near zero, the same lack-of-discharge occurs, but since the result is a lower reading, it's not a problem : zero is what you wanted to read anyway. The big problem isn't the 100K pots of the IBM joysticks : if you auto-center in software ( which FS-II does ) it just means you get 6 bits of resolution instead of 8. Just have an init step that assumes the joystick is centered and scales all subsequent readings appropriately. ( I use this to "bias" the controls on FS-II so "hands-off" becaomes a slight climb. ) The problem I've found in analog joysticks is NOISE. That 5V coming out of the joystick port seems to have a lot of 10KHz+ noise on it. This noise on the 5V has to be silenced before you'll get more than four bits of reliable input from your 'stick. You've got long wires, and with a 60Hz-fundamental sawtooth on two of them. Those 100k or 500K pots aren't exactly a low-impedance source. And you're right next to a little audio-through-radio range frequency generator (i.e. computer). People who can deal with this type of grief get paid big bucks. The best solution I've thought of involves active components in the joystick, close to the pots. But it's not simple : essentially, sense when Paula has pulled down the input to trigger a one-shot. The period of this one-shot is determined by the joystick position. This one-shot goes negative, then returns to positive. It's output is tied to Paula through a ~100K resistor, and will later be used as a pull-up. Before it goes through the resistor, however, it triggers another one shot, this one with fixed timing ( 50 microsec or so ). The second one-shot, either through a diode or a tri-state buffer, provides a high-current V+ source to rapidly charge Paula's input capacitors, then goes low (i.e. high-impedance or reverse-biasing the diode, whichever ). Then both one-shots wait for the next time Paula discharges the capacitor. _____ ______ _________ Paula Input : |_________/ |_______/ _____ _______ __________ 1st One-Shot: |_________| |_______| __ __ 2nd One-Shot: _______________||_____________||________ 555-derived dual (and quad) timers would do this job well, using a diode on the 2nd ones output. 74C-family devices can probably do the job as well, and maybe there's a tri-state version ?? This system provides a high-impedance when Paula's grounding-out the cap, and a low inpedance when charging the cap. This produces a fast rise on the Paula inputs, vastly reducing the noise problem. Unfortuneatly, I haven't had a chance to try this yet, because : I've wrecked one Paula chip's analog inputs ( capacitively-coupled line noise, I think ) so BE CAREFUL. ( Only the analog inputs died, thank goodness. Everything else still works. ) Good luck. If you solve the noise problem, let's hear about it ! -- Dennis O'Connor oconnor%sungod@steinmetz.UUCP ARPA: OCONNORDM@ge-crd.arpa "Never confuse the USENET with something that matters, like CAFFEINE."
cs161agc@sdcc10.ucsd.EDU (John Schultz) (11/09/88)
Regarding noise on analog joysticks: We're using large (physically) .22 uF PC capacitors (10% error), and the noise problem isn't too bad. Quite smooth, really... The caps are wired right into the connector (Amiga side). John
grr@cbmvax.UUCP (George Robbins) (11/09/88)
There seems to be a lot of excitement about joystick these days... Here are some notions you might want to think about or comment on: 1) The pinout for the analog joysticks is supposed to compatible with traditional game machine game paddles / analog joysticks - you shouldn't need any sort of adapter for these. 2) Most of these things seem to come in around 470K - give or take a factor of two. You can diddle the pot values or add some more timing capacitance, but there are some trade-offs. Increasing resistance increase noise level, increasing capacitance may decrease repetability. 3) Noise level varies from machine to machine. The A500 is not so good, others somewhat better. Much depends on where the timing capacitor are located. If they are near the Paula chip, they tend to filter out noise spikes, if far away induced noise tends to randomly trip the comparators. I don't know the effect of locating them in the joystick assembly itself. 4) The best way to evaluate raw performance is to write a little program that does a simple point plot display of the x-y location read from the pot registers. Idealy, you have an etch-a-sketch, in reality you get some kind of fuzz-ball, relativly small in the low resistance quadrant, larger at the high resistance extreme. 5) Software using the pot input should be pretty defensive. Toss bogus values, do some kind of averaging to reduce the effect of noise. Provide some kind of training/calibration mode so that the program can adapter to whatever the person has plugged in. 6) Consider the application - there just isn't enough accuracy for your paint/precise point location thing, but that doesn't mean it won't do for a continuous control of some sort or even a selection function if the gadgets are big enough. 7) Somone mentioned external hardware to get more accuracy repeatability - it's been done before, though I don't know what the results were. I'm not sure how much that will really help... You can probably do about as well by moving the timing caps and/or messing with RC values... -- George Robbins - now working for, uucp: {uunet|pyramid|rutgers}!cbmvax!grr but no way officially representing arpa: cbmvax!grr@uunet.uu.net Commodore, Engineering Department fone: 215-431-9255 (only by moonlite)
dbk@fbog.UUCP (Dave B. Kinzer @ Price Rd. GEG) (11/10/88)
[] OK, I have a working VBlank driver and a working Analog joystick adapter. Now for a few more questions. The joystick resistance must be greater than the 490K specified in the RKM Hardware manual in order to reach maximum counts. This has been confirmed by others in email to me. Does anyone else have any discussion to add on this? The adapter has rock solid repeatability until the resistance gets near it's maximum, and the returned counts get above about $f0 (easily simulated by unplugging the joystick entirely). The the received values start becoming unstable and occasionally (5% of readings) jump to the far end of the scale (readings of 2 and 5 are typical). Since there is a (somewhat) large capacitor on the input wire (in the Amiga), I cannot believe that there is noise on the wire itself. This leaves a possible problem with the paula chip internally, like noise on the "other" comparitor input (for the small deviations), and possibly a failure to properly discharge the capacitor (for the large jumps). The jumps could also be explained by a large spike on the internal comparitor input, or a faulty latch triggering mechanism. Is there any discussion on this? It would be nice to have repeatable readings from one end of the scale to the other. -- | // You've heard of CATS and DOGS, I'm from GOATS, Dave Kinzer | | // Gladly Offering All Their Support! noao!nud!fbog!dbk | | \X/ "My employer's machine, my opinion." (602) 897-3085 |
cs161agc@sdcc10.ucsd.EDU (John Schultz) (11/11/88)
Re repeatability: Try the caps on the adaptor closest to the Amiga. We get very reliable readings... John
cs161agc@sdcc10.ucsd.EDU (John Schultz) (11/11/88)
In article <5204@cbmvax.UUCP> grr@cbmvax.UUCP (George Robbins) writes: >1) The pinout for the analog joysticks is supposed to compatible with > traditional game machine game paddles / analog joysticks - you > shouldn't need any sort of adapter for these. Apple compatible joysticks have a DB-9 _male_ connector, and are not pin to pin compatible. IBM compatible joysticks have a DB-15 male connector...(We don't know of any other analog joysticks currently available). >2) Most of these things seem to come in around 470K - give or take > a factor of two. You can diddle the pot values or add some more > timing capacitance, but there are some trade-offs. Increasing > resistance increase noise level, increasing capacitance may > decrease repetability. We have tried both methods: Higher resistance pots (1 meg) work fine (but who wants to rip apart their joystick, let alone find a pot that will fit). Adding capacitors in parallel (.22 uF - .32 uF) will generate the full range. We've used the joystick (with a little scaling) to drag windows, etc., under intuition. >3) Noise level varies from machine to machine. The A500 is not so > good, others somewhat better. Much depends on where the timing > capacitor are located. If they are near the Paula chip, they > tend to filter out noise spikes, if far away induced noise tends > to randomly trip the comparators. I don't know the effect of > locating them in the joystick assembly itself. We put the caps on the Amiga end of our adaptatron; works well. We performed preliminary tests by placing the caps on the pots inside the joystick; worked either way. Early test code on A500's (using no caps) produced very limited range and spurious readings. The A2000 had better results, and the A1000 the best. >7) Somone mentioned external hardware to get more accuracy repeatability - > it's been done before, though I don't know what the results were. I'm > not sure how much that will really help... You can probably do about > as well by moving the timing caps and/or messing with RC values... What we need is a major joystick manufacturer to make joysticks for the Amiga with the correct connectors and caps wired inside the joystick. Less hassle for the end user and encouragement for developers to write software to support such devices; Advance the state of the art... >George Robbins - now working for, uucp: {uunet|pyramid|rutgers}!cbmvax!grr >but no way officially representing arpa: cbmvax!grr@uunet.uu.net >Commodore, Engineering Department fone: 215-431-9255 (only by moonlite) George, the hardware manual states to use pins 3 and 4 for the buttons. We would also like to support button 3 (available on some IBM joysticks). We are currently using pin 2; could we also use pin 1, to support 4 buttons? (Pin 6 is also available, but X-Specs 3D uses pin 6 to toggle the shutters). Our ajoystick.library will contain these user functions: OpenAJoystick, CloseAJoystick, and ReadAJoystick(potx,poty,button1,button2,button3). Any input would be appreciated, John
dca@kesmai.COM (David C. Albrecht) (11/11/88)
In article <7@sdcc10.ucsd.EDU>, cs161agc@sdcc10.ucsd.EDU (John Schultz) writes: > Dave Albrecht (sp?) who is now supporting analog joysticks in his > game (Air Battle?). Thanks Dave for the clues to the correct cap > values. You got the name right, the game is called Air Warrior. It's a multi-player air1 combat simulation based on WW II aircraft that runs across the GEnie network service. Glad to be of help. > > As soon as completed, we'll make the ajoystick.lib available to > everyone. If enough developers are willing to support analog > joysticks, we'll look into mass-marketing the adaptor. Please do, making adaptor cables is a major pain and it's kind of amazing no one has produced such an item so far. I suppose it must be a chicken and egg problem. > We also wired up an Apple // joystick, but the > button polarity is reversed (or maybe we hosed it up taking it apart > so many times; it'll probably work). > No, you are correct. The joystick I used would emulate an IBM style or an Apple style and the Apple style when you depress the fire button shorts to the +5 while the IBM shorts to ground. You'd have to rewire an Apple joystick to change this behavior to make it work. David Albrecht
dca@kesmai.COM (David C. Albrecht) (11/11/88)
In article <5204@cbmvax.UUCP>, grr@cbmvax.UUCP (George Robbins) writes: > 1) The pinout for the analog joysticks is supposed to compatible with > traditional game machine game paddles / analog joysticks - you > shouldn't need any sort of adapter for these. > > 2) Most of these things seem to come in around 470K - give or take > a factor of two. You can diddle the pot values or add some more > timing capacitance, but there are some trade-offs. Increasing > resistance increase noise level, increasing capacitance may > decrease repetability. I don't know where you find these things. I hadn't thought to look at game paddles but they wouldn't be useful to me anyway as I need two axis control, all the game joysticks I've ever seen weren't analog, they were the four quadrant switchy things. Analog joysticks for the IBM, however, are quite obtainable. Some, are very nicely designed for flight simulators etc.. The 40 count res of the 100K pots is acceptable for flight simulation use but pretty poor if you want to use it to position a point on the screen. Having to wire the cable is a pain. David Albrecht
grr@cbmvax.UUCP (George Robbins) (11/12/88)
In article <202@kesmai.COM> dca@kesmai.COM (David C. Albrecht) writes: > In article <5204@cbmvax.UUCP>, grr@cbmvax.UUCP (George Robbins) writes: > > 1) The pinout for the analog joysticks is supposed to compatible with > > traditional game machine game paddles / analog joysticks - you > > shouldn't need any sort of adapter for these. > > > > 2) Most of these things seem to come in around 470K - give or take > > a factor of two. You can diddle the pot values or add some more > > timing capacitance, but there are some trade-offs. Increasing > > resistance increase noise level, increasing capacitance may > > decrease repetability. > I don't know where you find these things. I hadn't thought to look at > game paddles but they wouldn't be useful to me anyway as I need two axis > control, all the game joysticks I've ever seen weren't analog, they were > the four quadrant switchy things. I dunno really, it's been almost two years since we went shopping for such toys. My recollection was that we went over to the local Games and Gadgets chain store and in a corner of one shelf there were an assortment of devices marked "Commodore/Atari/Apple" compatible or something along that line, that included mechanical joysticks, game paddles and some analog joysticks. Could be I was confused or have forgotten the true facts... We actually use a game paddle for testing since the X/Y knobs make for easy position setting and tend to stay where you set them... -- George Robbins - now working for, uucp: {uunet|pyramid|rutgers}!cbmvax!grr but no way officially representing arpa: cbmvax!grr@uunet.uu.net Commodore, Engineering Department fone: 215-431-9255 (only by moonlite)
farmer@ico.ISC.COM (David Farmer) (11/14/88)
In article <10@sdcc10.ucsd.EDU> cs161agc@sdcc10.ucsd.edu.UUCP (John Schultz) writes: > Apple compatible joysticks have a DB-9 _male_ connector, and are >not pin to pin compatible. IBM compatible joysticks have a DB-15 male >connector...(We don't know of any other analog joysticks currently >available). >... > John Sorry to jump in so late, but I just wanted to point out that the Atari 5200 used analog joysticks. I have wanted to convert mine, but haven't had any idea of how to do it. David Farmer InterActive Systems.
simon@copper.columbia.edu (Thor Simon) (01/04/89)
A small company known as MicroFlyte produces as I recall an "Amiga Flight Joystick". Is this analog? Will it work with the popular programs supporting analog sticks (I'm mostly concerned about AirWarrior)? If anybody has one, please let us know. It's a lot cheaper than the IBM and Apple designs if you figure in the parts for the interface and the solder-headaches and time expended building it. ********************************************* * Thor Simon | It doesn't matter what you're* * New York | doing. It's how little you * *____________| know about it. * *********************************************
dougp@sbphy.ucsb.edu (01/13/89)
Bryce Nesbit listed a bunch of pinouts for controllers for the controller ports. Is that all you are going to support with drivers in 1.4? I think a more generic schieme should be used for the controller ports. Specificly, How would you handle a driving simulator which wanted to use pins 1 and 3 as a reletive positioner (like 1 axis of the mouse) for the stearing, pins 5 and 9 as absolute positioners (potentiometers) for the gas and break respectivly, and pins 2 and 4 for fire buttons? This doesn't fit any of the 5 controllers mentioned, but it is possible that someone could want to build this or any of a whole slew of different controler designs. I can see two solutions to this problem, write a method of alocating the pins separately so that pins 1 and 3 can be alocated as a pair as a relative controler or separatly as buttons and so on for the output pins, and the pots. Or, you could alocate the whole port and have all the possible inputs processed simualtaniously. In this method if you had a button connected to pin 1 you would look at the button 1 bit of the button register, and if there was a relitive controler attatched to pins 1 and 3 you would look at the V count register (registers being elements in a ram based structure in this context). Whatever is done, I would like to see some built in software support for absolute positioners (analog joystics) in version 1.4 of Workbench.
cmcmanis%pepper@Sun.COM (Chuck McManis) (01/17/89)
In article <1105@hub.ucsb.edu> dougp@sbphy.ucsb.edu writes: >Is that all you are going to support with drivers in 1.4? I think a >more generic schieme should be used for the controller ports. >Specificly, How would you handle a driving simulator which wanted > [ goes on to describe a pretty wild configuration ] It is a really valid point, of course the game writers out there wouldn't use it because they just go to the metal anyway :-) but for those of us that stay within the bounds of reason, how about a super miscio.device. This device would have a structure that included values for all of the pins and pots on both ports. You would open it with a flag value that would tell the device what pieces you were interested in and what direction the I/O would go. So the structure might look something like struct Postition { short X, Y; } struct MiscIO { short Pots[4]; /* Analog pot values */ struct Postition XY[2]; /* Mouse "position" values */ unsigned char Buttons[10]; /* Button states */ } You may have noticed that there are 16 things there, give each one a bit to determine if you want a message if it changes. I know really rough sketch, but assuming that this was the underlying device, all of the existing devices could be built on top of it and custom devices like the one doug mentioned could be built with some guaruntee of future compatibility. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.
poirier@ellerbe.rtp.dg.com (Charles Poirier) (05/31/90)
Perhaps all the Gurus were out balancing on their Amiga Joyboards when I asked this the first time, as I got no response to the question: Is it possible, via some to-be-designed input-munging software, to more-or-less transparently use an ordinary analog joystick as a programmable joystick or mouse, in the tradition (though not the same implementation) of the Gravis Mousestick (TM)? Cheers, Charles Poirier poirier@dg-rtp.dg.com
robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) (05/31/90)
In article <1990May30.172116.5685@dg-rtp.dg.com> poirier@ellerbe.dg.com ( Poirier local) writes: >Perhaps all the Gurus were out balancing on their Amiga Joyboards when >I asked this the first time, as I got no response to the question: > >Is it possible, via some to-be-designed input-munging software, to >more-or-less transparently use an ordinary analog joystick as a programmable >joystick or mouse, in the tradition (though not the same implementation) >of the Gravis Mousestick (TM)? Rather than do it in the software, what would really be nice is a programmable device similar to the mousestick, that allows either the IBM style analog joysticks or the Apple style to be plugged into it, and have it plugged into the mouse port. That way we could use some of those really great IBM/APPLE joysticks, on any software we chose (not just the stuff supported by the O/S -- since a software "mung" would require that the games "that take over the machine" be munged as well). Just a thought. +-----------------------------------------------------------------------------+ |The views expressed herein, are the sole responsibility of the typist at hand| +-----------------------------------------------------------------------------+ |UUCP: cs.utexas.edu!romp!ibmchs!auschs!sabre.austin.ibm.com!robin | |USNail: 701 Canyon Bend Dr. | | Pflugerville, TX 78660 | | Home: (512)251-6889 Work: (512)823-4526 | +-----------------------------------------------------------------------------+
jcs@crash.cts.com (John Schultz) (06/01/90)
In article <1990May30.172116.5685@dg-rtp.dg.com> poirier@ellerbe.dg.com ( Poirier local) writes: >Is it possible, via some to-be-designed input-munging software, to >more-or-less transparently use an ordinary analog joystick as a programmable >joystick or mouse, in the tradition (though not the same implementation) >of the Gravis Mousestick (TM)? Sure, after software processing of the analog joystick data (values from 0-255), input events could be sent to the input device. I think there's a PD example of how to do this with a digital joystick. John
cmcmanis@stpeter.Eng.Sun.COM (Chuck McManis) (06/01/90)
In article <1990May30.172116.5685@dg-rtp.dg.com> ( Poirier local) writes: >Is it possible, via some to-be-designed input-munging software, to >more-or-less transparently use an ordinary analog joystick as a programmable >joystick or mouse, in the tradition (though not the same implementation) >of the Gravis Mousestick (TM)? Yes. The steps are : 1) Write an analog joystick device driver. 2) Write an input handler that knows about your driver. 3) Load and install the input handler in front of Intuition and the CX library. (If you have Commodities) 4) The input handler should open the joystick device driver (or it could be imbedded in the input handler) and begin to periodically scan the state of the joystick. When it changes position, the input handler should generate appropriate MOUSEMOVE input events and pass them down the chain. -- --Chuck McManis Sun Microsystems uucp: {anywhere}!sun!cmcmanis BIX: <none> Internet: cmcmanis@Eng.Sun.COM These opinions are my own and no one elses, but you knew that didn't you. "I tell you this parrot is bleeding deceased!"