Trouble with Gamepad

The intent of this forum is to discuss my DOS TSR programs (available at http://bretjohnson.us), how they work and don't work, new/missing features, status of updates, and anything else related to them that may need to be discussed.

Trouble with Gamepad

Postby BrentH » Tue Jul 07, 2009 5:08 pm

Hi,

I was trying out a Logitech Precison Gamepad on a Dell Inspiron 7000 laptop. I'm running Windows 98SE, in "command prompt only" mode. Usbuhcil seems to be working ok, but usbjstik doesn't want to detect the Gamepad.

"usbuhcil al" displays:
Code: Select all
USBUHCIL 0.08, (C) 2007-2009, Bret E. Johnson.
DOS Driver for a Universal HCI compatible USB Host Controller.
  LITE version (maximum 16 Devices, no Isochronous Transactions).


                               DEVICE ADDRESSES
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Host Index:  0  Host Type: UHCI  Bus Type: PCI   IRQ#: 11  Root Hub Ports: 2
Vendor: 8086h = Intel Corp                                 Product: 7112h
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
                DEVICES                                   INTERFACES           
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ  ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
                           L                C  I A                O           
ADRS                       o         P      o  n l                w           
ÍÍÍÍ   (hex)               S         o BUS  n  t t                n           
Test VEND PROD     Sub Pro p USB HUB r POWR f  f I                e     Sub Pro
RWak  ID   ID  Cls Cls col d VER ADR t (mA) g  c n  DESCRIPTION   d Cls Cls col
ÍÍÍÍ ÍÍÍÍ ÍÍÍÍ ÍÍÍ ÍÍÍ ÍÍÍ Í ÍÍÍ ÍÍÍ Í ÍÍÍÍ Í  Í Í ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Í ÍÍÍ ÍÍÍ ÍÍÍ
  1  8086 7112   9   0   0 . 1.0 ... . s  0 1  0 0*Root Hub       Y   9   0   0
     Intel Corp                             
ÄÄÄÄ ÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄÄ ÄÄÄ Ä ÄÄÄ ÄÄÄ Ä ÄÄÄÄ Ä  Ä Ä ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Ä ÄÄÄ ÄÄÄ ÄÄÄ
  2  046D C21A   0   0   0 Y 1.1   1 1   50 1  0 0*Human Intf Dvc .   3   0   0
     Logitech Inc


"usbjstik b" displays:
Code: Select all
USBJSTIK 0.08, (C) 2007-2009, Bret E. Johnson.
DOS Driver for up to 8 USB Joysticks or GamePads.

Beep for Bad Joysticks: Yes

BAD (INCOMPATIBLE) JOYSTICKS
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

HOST  DVC   INTF  STAGE  ERROR
INDX  ADDR  NUM    NUM   CODE
ÄÄÄÄ  ÄÄÄÄ  ÄÄÄÄ  ÄÄÄÄÄ  ÄÄÄÄÄ
   0     2     0    210  0000h


While I haven't heard any beeps, the laptop's speaker never has worked reliably. I was wondering if there's anything else that I should try.

Thanks,
Brent
BrentH
 
Posts: 4
Joined: Tue Jul 07, 2009 4:37 pm

Re: Trouble with Gamepad

Postby Bret » Wed Jul 08, 2009 1:21 am

An error at Stage 210 in USBJSTIK indicates that there's something in the HID Report Descriptor that USBJSTIK doesn't understand. Please post the output of a:

USBUHCIL Report 2 0

USBJSTIK will need to be modified. If you have another joystick or gamepad, you might try it in the mean time.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Trouble with Gamepad

Postby BrentH » Wed Jul 08, 2009 10:56 am

usbuhci Report 2 0 shows:
Code: Select all
USBUHCIL 0.08, (C) 2007-2009, Bret E. Johnson.
DOS Driver for a Universal HCI compatible USB Host Controller.
  LITE version (maximum 16 Devices, no Isochronous Transactions).

USB HID (HUMAN INTERFACE DEVICE) REPORT DESCRIPTOR               
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
05 01          Usage Page:       Generic Desktop
09 04          Usage:            Joystick
A1 01          Collection:       Application

A1 02            Collection:       Logical

75 08              Report Size:      8
95 02              Report Count:     2
15 00              Logical Min:      00h  0  0
26 FF 00           Logical Max:      FFh  255  -1
35 00              Physical Min:     00h  0  0
46 FF 00           Physical Max:     FFh  255  -1
09 30              Usage:            X-axis
09 31              Usage:            Y-axis
81 02              INPUT:            Data  Variable  Absolute
                                     No_Wrap  Linear  Preferred_State
                                     No_Null_State  Non_Volatile  Bit_Field

75 01              Report Size:      1
95 0A              Report Count:     10
25 01              Logical Max:      01h  1  +1
45 01              Physical Max:     01h  1  +1
05 09              Usage Page:       Buttons
19 01              Usage Min:        Button #1 (Primary)
29 0A              Usage Max:        Button #10 (Denary)
81 02              INPUT:            Data  Variable  Absolute
                                     No_Wrap  Linear  Preferred_State
                                     No_Null_State  Non_Volatile  Bit_Field

06 00 FF           Usage Page:       FF00h (Vendor-Defined)
75 01              Report Size:      1
95 06              Report Count:     6
25 01              Logical Max:      01h  1  +1
45 01              Physical Max:     01h  1  +1
09 01              Usage:            01h
81 02              INPUT:            Data  Variable  Absolute
                                     No_Wrap  Linear  Preferred_State
                                     No_Null_State  Non_Volatile  Bit_Field

C0                 End Collection   

C0               End Collection   


BrentH
 
Posts: 4
Joined: Tue Jul 07, 2009 4:37 pm

Re: Trouble with Gamepad

Postby Bret » Wed Jul 08, 2009 1:50 pm

I've got it so it will recognize the Logitech gamepad now, but I'm wondering what to do with the last six entities it shows in the report descriptor. The descriptor shows 2 axes, 10 buttons, and then 6 vendor-defined boolean entities (buttons or switches or something). Do you have any idea what those last 6 things are? I think they might just be placeholders to keep the data byte-aligned, but I've never seen a joystick use a vendor-defined function to do that before -- all I've ever seen are constant values of zero.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Trouble with Gamepad

Postby BrentH » Wed Jul 08, 2009 2:59 pm

There are two axis and 10 buttons. There's no other switches/buttons, on the gamepad. While I'm not sure how to read the HID descriptor, I did manage to log some data. All of the "out" data looks like this:
Code: Select all
7   in down   0x81   0.187   BULK_OR_INTERRUPT_TRANSFER   -   
8   in down   0x81   0.187   BULK_OR_INTERRUPT_TRANSFER   -   


Here is the "in" data, with the buttons/axis are labeled, on the right.
Code: Select all
7    in up   0x81   19.453   BULK_OR_INTERRUPT_TRANSFER   01 80 00 04   0x00000000 XAxis Left
8    in up   0x81   19.734   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
9    in up   0x81   20.922   BULK_OR_INTERRUPT_TRANSFER   ff 80 00 08   0x00000000 XAxis Right
10   in up   0x81   21.172   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
11   in up   0x81   21.828   BULK_OR_INTERRUPT_TRANSFER   80 01 00 10   0x00000000 YAxis Up
12   in up   0x81   22.156   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
13   in up   0x81   23.031   BULK_OR_INTERRUPT_TRANSFER   80 ff 00 20   0x00000000 YAxis Down
14   in up   0x81   23.359   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
15   in up   0x81   27.594   BULK_OR_INTERRUPT_TRANSFER   80 80 01 00   0x00000000 Button 1
16   in up   0x81   27.750   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
17   in up   0x81   28.516   BULK_OR_INTERRUPT_TRANSFER   80 80 02 00   0x00000000 Button 2
18   in up   0x81   28.687   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
19   in up   0x81   29.062   BULK_OR_INTERRUPT_TRANSFER   80 80 04 00   0x00000000 Button 3
20   in up   0x81   29.250   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
21   in up   0x81   29.750   BULK_OR_INTERRUPT_TRANSFER   80 80 08 00   0x00000000 Button 4
22   in up   0x81   29.906   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
23   in up   0x81   32.953   BULK_OR_INTERRUPT_TRANSFER   80 80 10 00   0x00000000 Button 5
24   in up   0x81   33.125   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
25   in up   0x81   33.687   BULK_OR_INTERRUPT_TRANSFER   80 80 20 00   0x00000000 Button 6
26   in up   0x81   33.891   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
27   in up   0x81   34.578   BULK_OR_INTERRUPT_TRANSFER   80 80 40 00   0x00000000 Button 7
28   in up   0x81   34.734   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
29   in up   0x81   35.359   BULK_OR_INTERRUPT_TRANSFER   80 80 80 00   0x00000000 Button 8
30   in up   0x81   35.547   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
31   in up   0x81   36.328   BULK_OR_INTERRUPT_TRANSFER   80 80 00 01   0x00000000 Button 9
32   in up   0x81   36.500   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000
33   in up   0x81   37.453   BULK_OR_INTERRUPT_TRANSFER   80 80 00 02   0x00000000 Button 10
34   in up   0x81   37.625   BULK_OR_INTERRUPT_TRANSFER   80 80 00 00   0x00000000


The layout of the game pad (in really bad ascii art)...
Code: Select all
    [07]                                   [08]
     [05]                                 [06]

       (yu)          [09]  [10]         (04)
        |                             
   (xl)---(xr)                      (01)    (03) 
        |                         
       (yd)                             (02)


Hope this helps.
BrentH
 
Posts: 4
Joined: Tue Jul 07, 2009 4:37 pm

Re: Trouble with Gamepad

Postby Bret » Thu Jul 09, 2009 4:15 am

It looks like the extra six "buttons" are just placeholders to account for every bit of data, as is required by the standards. I'm not sure why Logitech decided to classify them as vendor-specific boolean values instead of fixed data like everyone else seems to, but oh well. They also classify the device as a joystick instead of a gamepad, and classify the Direction-Pad as a pair of axes. The part that was confusing USBJSTIK, though, is some of the "header" information at the top of the descriptor, which doesn't follow the format recommended by the USB standards. Almost everything about the descriptor is non-standard or faulty in some fashion. Believe it or not, this is pretty typical, and is one of the reasons it's so hard to write software for USB -- even though there are standards, almost nobody follows them (at least not completely).

Anyway, I updated the USBDOS.ZIP file on the web site (http://bretjohnson.us), and it includes a new version of USBJSTIK. Download it and let me know how it works for you.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Trouble with Gamepad

Postby Wengier » Fri Jul 10, 2009 1:29 pm

Great! USBJSTIK now recognizes my Logitech DualAction Gamepad, and THRUST also works fine (using BIOS), just like my recently-bought Microsoft Sidewinder Gamepad (with SDWRGMPD driver loaded). Regrettably, unlike THRUST, JOYKEYS 2.0 seems to have problems recognizing the 4 buttons (A1, A2, B1, B2) on the Logitech Gamepad (e.g. testing with its /J option), though it works with the POVs. Thus I'm not yet able to emulate keys using the Logitech Gamepad.
Wengier
 
Posts: 4
Joined: Fri Jul 10, 2009 1:15 pm

Re: Trouble with Gamepad

Postby Bret » Fri Jul 10, 2009 2:13 pm

Are you sure you have all of the mappings and options set correctly for both programs (USBJSTIK & JOYKEYS)? As you already know, it can be very confusing, and everything has to match up with everything else regarding the protocols.

Does JOYKEYS recognize the Sidewinder buttons OK?
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Trouble with Gamepad

Postby Wengier » Fri Jul 10, 2009 3:05 pm

Yes, JOYKEYS (and THRUST) has no problems recognizing the Sidewinder buttons. Since the options are quite complicated as you already mentioned, I usually stick with the default setting and protocol, or sometimes with some mappings changed (e.g. /A1=xx /A2=xx), both ways have proved to work fine on my Sidewinder Gamepad.

As for the Logitech Gamepad, I just restarted the PC to test it again, and still the same result. After installing the USBJSTIK driver (with default setting and protocol), THRUST (from both the USB driver package and the JOYKEYS package) correctly recognizes the POVs and 4-button presses, but JOYKEYS /J always reports that the 4 buttons are "OFF" even if they are pressed, though it is able to report the correct status of the POVs. I cannot say I have already tested everything thoroughly, but since THRUST works fine on both gamepads, and I have no problem getting JOYKEYS to work with the Sidewinder buttons, I'd assume there is some sort of incompatibility here. Any hints are appreciated.

EDIT: By the way, is it possible to add I/O Virtualization (which is certainly very useful) to the Sidewinder Gamepad driver as well? Thanks very much.
Wengier
 
Posts: 4
Joined: Fri Jul 10, 2009 1:15 pm

Re: Trouble with Gamepad

Postby Bret » Fri Jul 10, 2009 5:24 pm

I found the bug in USBJSTIK, and uploaded a new version to the web site. I also uploaded a new version of USBDRIVE, which includes some items related to a concurrent thread.

I do intend to add I/O virtualization to SDWRGMPD, but it will be quite awhile before I can get around to it. I'll be concentrating on the USB stuff for at least the next several months, if not longer. I have a lot of programs, including some new ones, that are in limbo right now just because i don't have time to work on them.

You're certainly welcome to try and update SDWRGMPD yourself if you have the inclination.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Trouble with Gamepad

Postby BrentH » Sat Jul 11, 2009 8:29 am

The "Logitech Precision Gamepad 2" is being detected just fine. I was about ready ask about a problem I was having, using the int15 bios call, to read the buttons, but you had it fixed before I had the chance to report it!

Thanks a lot for all of your help.
BrentH
 
Posts: 4
Joined: Tue Jul 07, 2009 4:37 pm


Return to Programs

Who is online

Users browsing this forum: No registered users and 3 guests

cron