It is currently Sat Jun 15, 2019 10:00 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: USB Controller
PostPosted: Tue Oct 28, 2008 3:46 pm 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1236
Location: Berlin, Germany
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?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 28, 2008 9:19 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 2:13 pm
Posts: 1668
DirectInput--what you should be using for keyboard input as well.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2008 1:53 am 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1236
Location: Berlin, Germany
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?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2008 2:36 am 
Offline
User avatar

Joined: Fri Jun 29, 2007 10:25 pm
Posts: 324
Location: Earth, Milkyway Galaxy, The Universe, M-Theory
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:
          *=$0000
loop      JMP loop
          .eof


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2008 9:32 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21439
Location: NE Indiana, USA (NTSC)
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2008 9:56 am 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1236
Location: Berlin, Germany
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:


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2008 10:20 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21439
Location: NE Indiana, USA (NTSC)
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.

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2008 12:19 pm 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1236
Location: Berlin, Germany
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?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2008 8:44 pm 
Offline
User avatar

Joined: Mon Aug 28, 2006 2:52 am
Posts: 407
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.

_________________
- BMF
RuSteD LOgIc


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2008 2:18 am 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1236
Location: Berlin, Germany
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2008 3:33 pm 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1236
Location: Berlin, Germany
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. :(


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2008 8:11 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11369
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 18, 2009 3:47 pm 
Offline

Joined: Thu Sep 15, 2005 9:23 am
Posts: 1236
Location: Berlin, Germany
*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?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 18, 2009 7:00 pm 
Offline
User avatar

Joined: Wed Oct 06, 2004 8:00 am
Posts: 132
Location: Northern New York
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group