delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/11/15:46:30

Date: Wed, 12 Mar 1997 09:31:28 +1200
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: joystick reading (gameport)
To: Christoph Kukulies <kuku AT gilberto DOT physik DOT RWTH-Aachen DOT DE>
Cc: djgpp AT delorie DOT com
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <3325CF30.60E9@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <199703110907 DOT KAA06763 AT gilberto DOT physik DOT rwth-aachen DOT de>

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.

Bill
-- 
Leave others their otherness.

- Raw text -


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