delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/12/04:32:51

From: Christoph Kukulies <kuku AT gilberto DOT physik DOT rwth-aachen DOT de>
Message-Id: <199703120931.KAA14805@gilberto.physik.rwth-aachen.de>
Subject: Re: joystick reading (gameport)
In-Reply-To: <3325CF30.60E9@blackmagic.tait.co.nz> from Bill Currie at "Mar 12, 97 09:31:28 am"
To: billc AT blackmagic DOT tait DOT co DOT nz
Date: Wed, 12 Mar 1997 10:31:32 +0100 (MET)
Cc: kuku AT gilberto DOT physik DOT RWTH-Aachen DOT DE, djgpp AT delorie DOT com
Reply-To: Christoph Kukulies <kuku AT gilberto DOT physik DOT rwth-aachen DOT de>
MIME-Version: 1.0

> Christoph Kukulies wrote:
> > 
> > Hmm. bits 2 and 3 ?
> > 
> > With the following test program
> > 
> > #include <stdio.h>
> > main()
> > {
> >   int i;
> >   while(1){
> >      outportb(0x201,0xff);
> >      i=inportb(0x201);
> >      printf("%02x\r",i);fflush(stdout);
> >   }
> > }
> > 
> > I'm getting 0xff when no button is pressed or no stick action is made.
> > When I press one fire button I'm getting 0xef, the other 0xdf.
> > 
> > This joystick has two fire buttons (Saitek MEGASTICK III, MX-130)
> > (e.g.: http://www.dbline.it/shtm/jmx-130.htm)
> > 
> > Are the two fire buttons equivalent to the second joystick?
> > Why do I see no data in the first nibble?
> 
> Because you are resetting the bits every loop and so when you read them,
> you will only ever get 1's in them.

Aarrgh. Slap, slap. :-)

> 
> Bill
> -- 
> Leave others their otherness.
> 

--
Chris Christoph P. U. Kukulies kuku AT gil DOT physik DOT rwth-aachen DOT de

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019