I know I'm replying to very old post, but I recently figured out how to make controllers work on PS2 emu (on PS3). Let me share my knowledge.
I used BeagleBoard-xM to analyze "hori real arcade pro v3" - an officially licensed and simple controller.
It worked well on PS2 emu and I didn't find any special packets (magic packets) passing through.
Then I noticed that PS3 is checking controllers' device descriptors and/or configuration descriptors. Unless they are in PS3's whitelist, PS3 does not start polling for hid report (even if the report descriptor of a controller is same as that of dualshock3).
Here I attach descriptors. It will work on PS3 with latest firmware.
Note that only first 3 bytes in hid reports are significant (Button_states_byte1, Button_states_byte2 and POV. details below) and following 24 bytes are fixed (128,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,2,0,2).
Assignment of keys (low bit first)
Button_states_byte1: Square, Cross, Circle, Triangle, L1, R1, L2, R2
Button_states_byte2: SELECT, START, L3, R3, PS, -, -, -
POV: 0x00=up 0x01=up-right 0x02=right 0x03=right-down 0x04=down 0x05=left-down 0x06=left 0x07=left-up 0x0f=none
Code: Select all
Device Descriptor:
18, // bLength
1, // bDescriptorType
0x00, 0x02, // bcdUSB
0, // bDeviceClass
0, // bDeviceSubClass
0, // bDeviceProtocol
64, // bMaxPacketSize0
0x0d, // idVendor[0]
0x0f, // idVendor[1]
0x22, // idProduct[0]
0x00, // idProduct[1]
0x00, 0x10, // bcdDevice (=version number)
1, // iManufacturer
2, // iProduct
0, // iSerialNumber
1 // bNumConfigurations (this source does not support composite device)
Code: Select all
Configuration Descriptor:
9, // bLength;
2, // bDescriptorType;
0x29,
0x00, // wTotalLength
1, // bNumInterfaces
1, // bConfigurationValue
0, // iConfiguration
0x80, // bmAttributes
50, // bMaxPower
// interface descriptor
9, // bLength
4, // bDescriptorType
0, // bInterfaceNumber
0, // bAlternateSetting
2, // bNumEndpoints
0x03, // bInterfaceClass (0x03 = HID)
0x00, // bInterfaceSubClass (0x00 = No Boot)
0x00, // bInterfaceProtocol (0x00 = No Protocol)
0, // iInterface
// HID interface descriptor
9, // bLength
0x21, // bDescriptorType
0x11, 0x01, // bcdHID
0, // bCountryCode
1, // bNumDescriptors
0x22, // bDescriptorType
0x89,
0x00, // wDescriptorLength
// endpoint descriptor
7, // bLength
5, // bDescriptorType
2, // bEndpointAddress (ep2,out)
0x03, // bmAttributes (0x03=intr)
64, 0, // wMaxPacketSize
10, // bInterval
// endpoint descriptor
7, // bLength
5, // bDescriptorType
0x81, // bEndpointAddress (ep1,in)
0x03, // bmAttributes (0x03=intr)
64, 0, // wMaxPacketSize
10 // bInterval
Code: Select all
Report Descriptor:
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x05, // Usage (Game Pad)
0xA1, 0x01, // Collection (Application)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x35, 0x00, // Physical Minimum (0)
0x45, 0x01, // Physical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x0D, // Report Count (13)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (0x01)
0x29, 0x0D, // Usage Maximum (0x0D)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x03, // Report Count (3)
0x81, 0x01, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x25, 0x07, // Logical Maximum (7)
0x46, 0x3B, 0x01, // Physical Maximum (315)
0x75, 0x04, // Report Size (4)
0x95, 0x01, // Report Count (1)
0x65, 0x14, // Unit (System: English Rotation, Length: Centimeter)
0x09, 0x39, // Usage (Hat switch)
0x81, 0x42, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,Null State)
0x65, 0x00, // Unit (None)
0x95, 0x01, // Report Count (1)
0x81, 0x01, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x46, 0xFF, 0x00, // Physical Maximum (255)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x09, 0x32, // Usage (Z)
0x09, 0x35, // Usage (Rz)
0x75, 0x08, // Report Size (8)
0x95, 0x04, // Report Count (4)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00)
0x09, 0x20, // Usage (0x20)
0x09, 0x21, // Usage (0x21)
0x09, 0x22, // Usage (0x22)
0x09, 0x23, // Usage (0x23)
0x09, 0x24, // Usage (0x24)
0x09, 0x25, // Usage (0x25)
0x09, 0x26, // Usage (0x26)
0x09, 0x27, // Usage (0x27)
0x09, 0x28, // Usage (0x28)
0x09, 0x29, // Usage (0x29)
0x09, 0x2A, // Usage (0x2A)
0x09, 0x2B, // Usage (0x2B)
0x95, 0x0C, // Report Count (12)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x0A, 0x21, 0x26, // Usage (0x2621)
0x95, 0x08, // Report Count (8)
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x0A, 0x21, 0x26, // Usage (0x2621)
0x91, 0x02, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x26, 0xFF, 0x03, // Logical Maximum (1023)
0x46, 0xFF, 0x03, // Physical Maximum (1023)
0x09, 0x2C, // Usage (0x2C)
0x09, 0x2D, // Usage (0x2D)
0x09, 0x2E, // Usage (0x2E)
0x09, 0x2F, // Usage (0x2F)
0x75, 0x10, // Report Size (16)
0x95, 0x04, // Report Count (4)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0 // End Collection