USB Controller

You can talk about almost anything that you want to on this board.

Moderator: Moderators

Post Reply
WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

USB Controller

Post by WedNESday » Tue Oct 28, 2008 3:46 pm

So I have this USB controller that I want to communicate with using my emulator. I have read a few tutorials on communication with USB ports etc. and I think that I'm on the right track. But how do emulators go about implementing controller support?

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku » Tue Oct 28, 2008 9:19 pm

DirectInput--what you should be using for keyboard input as well.

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday » Wed Oct 29, 2008 1:53 am

kyuusaku wrote:DirectInput--what you should be using for keyboard input as well.
Basically its my DualShock 3 controller, which under Control Panel->Game Controllers does actually appear with the correct name and settings too. Of course there are no drivers for the controller which means that whenever you try to calibrate it you get no response. Since my computer recognises the device, could I still use DirectInput (which I have always used for my keyboard) to access it, or since there is no driver would I have to go in directly with USB access?

Edit: Since its recognised by Windows, does that mean that I could read data from the controller directly via DirectInput?

atari2600a
Posts: 324
Joined: Fri Jun 29, 2007 10:25 pm
Location: Earth, Milkyway Galaxy, The Universe, M-Theory
Contact:

Post by atari2600a » Wed Oct 29, 2008 2:36 am

kyuusaku wrote:DirectInput--what you should be using for keyboard input as well.
Don't forget about cross-platform emulators! (Or else the linux penguin will seek his revenge)

Code: Select all

          *=$0000
loop      JMP loop
          .eof

tepples
Posts: 21755
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Wed Oct 29, 2008 9:32 am

Your cross-platform wrapper should wrap DirectInput on Windows or the counterpart on *n?x or Mac OS X. Allegro does, and so should SDL.

WedNESday: I can has driver

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday » Wed Oct 29, 2008 9:56 am

tepples wrote:Your cross-platform wrapper should wrap DirectInput on Windows or the counterpart on *n?x or Mac OS X. Allegro does, and so should SDL.

WedNESday: I can has driver
No, that driver doesn't work for my computer. And sorry tepples, but the first sentence of that post means nothing to me. :lol:

tepples
Posts: 21755
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Wed Oct 29, 2008 10:20 am

WedNESday wrote:And sorry tepples, but the first sentence of that post means nothing to me. :lol:
A lot of cross-platform games are developed using a library such as Allegro, SDL, or ClanLib. This library exposes a generic API to read game controllers. Under the Windows version of the library, the generic API calls DirectInput. Under the Linux version of the library, the generic API calls the Linux joystick interface. Or under the Mac OS X version of the library, the generic API calls the HID Manager.

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday » Wed Oct 29, 2008 12:19 pm

Oh yeah sorry but I did understand after all. But anyway, under control panel my Dualshock 3 controller is recognised, and when I plugged it in it installed correctly and now appears under game controllers in the control panel (as a Playstation 3 controller with settings and calibrations). Even though there is obviously no driver for this (the one I tried didn't work (ps3sixaxis_en.exe)), could I still used DirectInput to read from the controller, or am I the proud owner of the world's most expensive paperweight?

Edit: I've just read somewhere that USB game controllers that are HID compliant don't need drivers, is this true?

User avatar
BMF54123
Posts: 407
Joined: Mon Aug 28, 2006 2:52 am
Contact:

Post by BMF54123 » Wed Oct 29, 2008 8:44 pm

WedNESday wrote:Edit: I've just read somewhere that USB game controllers that are HID compliant don't need drivers, is this true?
Yeah. As long as it shows up in Device Manager and tests OK in the Game Controllers applet, you're good to go. Of course, controller-specific features (rumble, programmable buttons, motion sensors, etc.) usually won't work, unless they map to a standard axis or button.

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday » Thu Oct 30, 2008 2:18 am

It appears under device manager twice:

Human Interface Devices->HID-compliant Consumer Control Device
Human Interface Devices->HID-compliant game controller

Here is how it appears under Control Panel->Game Controllers. Go to this page and scroll down until you can see images with all kinds of red circles on them. That is what I get in my Control Panel->Game Controllers, except nothing responds onscreen whenever I press any buttons.

http://forums.ps2dev.org/viewtopic.php?p=65104

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday » Thu Oct 30, 2008 3:33 pm

It's no use. After hours of searching the internet and trying all kinds of stuff, I just can't get it to work. The basic thing is, there're no drivers for this thing (at least ones that work for me). I can get it to show up in the Control Panel under Game Controllers, but cannot calibrate it and none of the buttons respond to it. When I plugged in my USB->PC Playstation controller thingy, it installed straight away (just like my Dualshock 3 did) but I could go straight into ZSNES and just configure the keys with it, unlike my Dualshock 3.

So I've basically wasted £50. Great. Does anyone know of a person/software house that could write me a driver? I might be prepared to pay for services too. :(

User avatar
tokumaru
Posts: 11469
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru » Thu Oct 30, 2008 8:11 pm

WedNESday wrote:Does anyone know of a person/software house that could write me a driver? I might be prepared to pay for services too. :(
That might be more expensive than you think. Will probably make the money you've already spent on the thing look like pocket change.

WedNESday
Posts: 1236
Joined: Thu Sep 15, 2005 9:23 am
Location: Berlin, Germany
Contact:

Post by WedNESday » Wed Mar 18, 2009 3:47 pm

*Bump*

Yes! There are some new drivers that finally make the thing work now, but my USB dongle doesn't detect the controller. Does anybody know of one that will, or can provide information on the PS3's bluetooth capability?

User avatar
AWal
Posts: 132
Joined: Wed Oct 06, 2004 8:00 am
Location: Northern New York
Contact:

Post by AWal » Wed Mar 18, 2009 7:00 pm

I have a pair of dongles (Big Microsoft 1.0 with the dock and iogear's 2.0 direct connect one).

Now I don't have any PS3 controllers aside from the RockBand stuff (I bought for PS2, all PS3 devices stickered "PS2 Compatible"...lol), but I do have plenty of Wii Remotes, which I've managed to get some working in GlovePIE (this is for VR tracking devices, and the WiiMote's accelerometer(s) is/are supported)...the only catch I've ran into is that you may need to obtain the Widcomm drivers or BlueSoleil software to support anything other than Keyboards, Mice, Networking Devices, and "Virtual Serial/Parallel Ports."


tl;dr WidComm or BlueSoleil allow more devices, and may be needed for it to work.

Post Reply