Article View: comp.sys.ibm.pc.misc
Article #7191Re: Joysticks
From: Mark Lord
Date: Tue, 29 Jan 1991 16:09
Date: Tue, 29 Jan 1991 16:09
50 lines
3121 bytes
3121 bytes
In article <1991Jan28.175634.6899@terminator.cc.umich.edu> jkenyon@css.itd.umich.edu (Jim Kenyon) writes: <David Simpson says..... < <> Okay folks. Who knows anything about programming the game port <> for a joystick on the PC? I plugged a Mach I joystick into the <> game port of my Zeos 386 and discovered that the BIOS "read <> joystick" function (interrupt 15h, function 84h) correctly <> reads the "fire" buttons but not the joystick position. <> (The position is just randomly varying "trash" numbers.) <> However, I discovered that my "Tetris" game can use the joystick <> without trouble. What gives? <> (I know. "Power users" don't use joysticks, but I'm curious.) <> :-) Thanks for any help. <> David Simpson < <Hey! This sounds *very* familiar! I have an ALR386/220 with exactly <the same problem -- However, QAPlus does read the sticks correctly. The scoop is that the joystick interface consists of a 555 timer wired in an RC circuit. Reading the joystick consists of triggering the timer, and then looping until it resets. There is one such circuit for each joystick axis. Most early software simply counts the number of loop interations and bases its reading on the total. VERY CPU SPEED DEPENDANT. Some software is slightly brighter.. they ask for you to "calibrate" the joystick by moving it from top left to bottom right while they take measurements. An annoyance for sure, but at least it usually works afterwards. Other software will do the calibration invisibly, by assuming that the joystick is centered when the program starts up. This method works well for programs which merely use the joystick for direction, rather than absolute analog positioning. Another method is to perform the joystick readings based on elapsed time, by using one of the internal timers (on the motherboard) instead of a software loop when "reading" the joystick. This is not too common. You've heard of "high speed joystick adaptors?" They are identical to the "normal" joystick interfaces, except that they use jumpers/switches to permit different RC values for the 555 circuit, thus speeding up the timer to compensate for faster CPU timing loops. All of this variety leads to the conclusion that, in the pc world, mice are probably a lot better than joysticks, cuz they don't have these problems! -- ___Mark S. Lord__________________________________________ | ..uunet!bnrgate!mlord%bmerh724 | Climb Free Or Die (NH) | | MLORD@BNR.CA Ottawa, Ontario | Personal views only. | |________________________________|________________________|
Technical Details
Message-ID:
<5486@bwdls58.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!bwdls61.bnr.ca!bwdls58!mlordReferences:
<1991Jan27.043204.3792@aplcen.apl.jhu.edu> <1991Jan28.175634.6899@terminator.cc.umich.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!bwdls61.bnr.ca!bwdls58!mlord From: mlord@bwdls58.bnr.ca (Mark Lord) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: Joysticks Message-ID: <5486@bwdls58.UUCP> Date: 29 Jan 91 16:09:28 GMT References: <1991Jan27.043204.3792@aplcen.apl.jhu.edu> <1991Jan28.175634.6899@terminator.cc.umich.edu> Sender: news@bwdls58.UUCP Reply-To: mlord@bwdls58.bnr.ca (Mark Lord) Organization: Bell-Northern Research, Ottawa, Canada Lines: 50