Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: PS3 Controller  (Read 7316 times)

0 Members and 1 Guest are viewing this topic.

JRChristenson

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 76
  • Last login:August 28, 2020, 05:29:39 pm
PS3 Controller
« on: July 22, 2013, 07:27:42 pm »
Has anyone had any luck playing MAME with a PS3 controller? I've got it paired to my laptop but I can't get MAME to recognize it. I'm using MAME32 Plus! 0.106.

Thanks!

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:March 22, 2022, 03:57:28 pm
Re: PS3 Controller
« Reply #1 on: July 22, 2013, 08:01:12 pm »
Windows will recognize it via USB, but the PS3 controller will not send send any commands back to the PC until you send it a special USB command.  Specifically, I believe it's HID_REQ_GET_REPORT.  Anyway, I found a bit of source called sixaxis-init.c on the web.  It basically is a bit of code that looks for any HID devices that match the sixaxis vendor/product ID, and sends the command to each controller.  It does require that you have libUSB installed, and you have to install a filter for the PS3 controller (very easy, libUSB comes with a gui to install filters).

I had to tweak the code slightly to get it to compile, since I think this code was originally written for Linux.  Mainly I thnk I just had to tweak the includes.  But I've attached what I compiled.  I'm pretty sure I compiled this using 64bit MINGW, so it will probably only work on a 64bit system.  I included the modified source as well, so you can compile it on 32bit if you need to.

After you run this, press the PS button in the controller, and Windows should see it then.  It exposes everything but the tilt functions.  There is also some sketchy looking drivers you can download and install.  They do give you access to tilt, and I think even bluetooth.  But I'm a little leery of them.


keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
Re: PS3 Controller
« Reply #2 on: July 22, 2013, 08:10:08 pm »
I use a ps3 controller with mame, no issues. I press the center button and it pairs with my mac. You can notice it in the bluetooth icon in the menubar. I use joystick mapper from the app store to convert the controller to key strokes.

I also have a key mapping for call of duty 4, since that game does not allow joystick support. ---daisies---.

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:March 22, 2022, 03:57:28 pm
Re: PS3 Controller
« Reply #3 on: July 22, 2013, 08:21:42 pm »
I use a ps3 controller with mame, no issues. I press the center button and it pairs with my mac.

The linux USB stack patched in support for detecting the vendor/product ID and sending the HID command somewhere in the 2.6 kernel (at minimum 2.6.25).  I suspect most other *nix/bsd OS's (like OS X) did as well after Linux implemented it in their USB stack.


Brian74

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1089
  • Last login:April 21, 2025, 11:11:53 am
  • Yep... I built that!!
Re: PS3 Controller
« Reply #4 on: July 23, 2013, 02:27:37 pm »
         

JRChristenson

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 76
  • Last login:August 28, 2020, 05:29:39 pm
Re: PS3 Controller
« Reply #5 on: July 25, 2013, 09:32:47 am »
Here you go http://www.motioninjoy.com/

That's what I used to pair my controller to my laptop but I still can't get it to work with MAME. I'll have to try Nick's advice from above, if I can figure it out.

urpimpnes

  • Trade Count: (0)
  • Newbie
  • *
  • Offline Offline
  • Posts: 1
  • Last login:April 22, 2015, 07:35:07 am
  • I want to build my own arcade controls!
Re: PS3 Controller
« Reply #6 on: April 22, 2015, 07:17:23 am »
Easiest method to get ps3 controller working in Windows.