- Joined
- Jul 7, 2010
- Messages
- 3,882
- Trophies
- 2
- Location
- /dev/random
- Website
- www.gudenau.net
- XP
- 5,417
- Country
A am attempting to create a driver for the xBox 360 Gamepad for use on the Wii, however it is not showing up.
Here is the source:
And here is the USB info about the controller:
Any help would be appreciated.
Here is the source:
Code:
#include <ogc/system.h>
#include <ogc/usb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <unistd.h>
#include <wiiuse/wpad.h>
#include <gccore.h>
#include <ogc/usb.h>
#include <ogc/lwp_queue.h>
#include <ogc/usbmouse.h>
#include <ogc/semaphore.h>
#include "util.h"
#define CLASS_VENDOR 0xFF
#define SUBCLASS_XBOX360_GAMEPAD 0x5D
#define UIPROTO_XBOX360_HEADSET 0x00
#define UIPROTO_XBOX360_GAMEPAD 0x01
#define UIPROTO_XBOX360_CHATPAD 0x02
#define HEAP_SIZE 4096
#define DEVLIST_MAXSIZE 8
void reset();
void power();
int main(int argc, char **argv){
usb_device_entry *buffer;
u8 device_count;
s32 hid = -1;
initGraphics();
WPAD_Init();
printf("\x1b[2;0H");
printf("Hello world!\n");
printf("USB_Initialize\n");
if(USB_Initialize() != 0){
printf("ERROR");
exit(0);
}
printf("iosCreateHeap\n");
hid = iosCreateHeap(HEAP_SIZE);
if(hid < 0){
printf("ERROR");
exit(0);
}
printf("iosAlloc\n");
buffer = iosAlloc(hid, DEVLIST_MAXSIZE * sizeof(usb_device_entry));
if(!buffer){
printf("ERROR");
exit(0);
}
memset(buffer, 0, DEVLIST_MAXSIZE * sizeof(usb_device_entry));
printf("USB_GetDeviceList\n");
if(USB_GetDeviceList(buffer, DEVLIST_MAXSIZE, CLASS_VENDER, &device_count) < 0){
iosFree(hid, buffer);
printf("ERROR");
exit(0);
}
printf("%u\n", device_count);
return 0;
}
And here is the USB info about the controller:
Code:
Information for device Controller (VID=0x045E PID=0x028E):
Connection Information:
------------------------------
Connection status: Device connected
Device actual bus speed: Full
Device is hub: No
Device adress: 0x0001
Current configuration value: 0x01
Number of open pipes: 7
Device Descriptor:
------------------------------
0x12bLength
0x01bDescriptorType
0x0200bcdUSB
0xFFbDeviceClass (Vendor specific)
0xFFbDeviceSubClass
0xFFbDeviceProtocol
0x08bMaxPacketSize0 (8 Bytes)
0x045EidVendor
0x028EidProduct
0x0114bcdDevice
0x01iManufacturer "©Microsoft Corporation"
0x02iProduct "Controller"
0x03iSerialNumber "0F23AFB"
0x01bNumConfigurations
Configuration Descriptor:
------------------------------
0x09bLength
0x02bDescriptorType
0x0099wTotalLength
0x04bNumInterfaces
0x01bConfigurationValue
0x00iConfiguration
0xA0bmAttributes (Bus-powered Device, Remote-Wakeup)
0xFAbMaxPower (500 mA)
Interface Descriptor:
------------------------------
0x09bLength
0x04bDescriptorType
0x00bInterfaceNumber
0x00bAlternateSetting
0x02bNumEndPoints
0xFFbInterfaceClass (Vendor specific)
0x5DbInterfaceSubClass
0x01bInterfaceProtocol
0x00iInterface
Unknown Descriptor:
------------------------------
0x11bLength
0x21bDescriptorType
Hex dump:
0x11 0x21 0x00 0x01 0x01 0x25 0x81 0x14 0x00 0x00
0x00 0x00 0x13 0x01 0x08 0x00 0x00
Endpoint Descriptor:
------------------------------
0x07bLength
0x05bDescriptorType
0x81bEndpointAddress (IN Endpoint)
0x03bmAttributes(Transfer: Interrupt / Synch: None / Usage: Data)
0x0020wMaxPacketSize (32 Bytes)
0x04bInterval
Endpoint Descriptor:
------------------------------
0x07bLength
0x05bDescriptorType
0x01bEndpointAddress (OUT Endpoint)
0x03bmAttributes(Transfer: Interrupt / Synch: None / Usage: Data)
0x0020wMaxPacketSize (32 Bytes)
0x08bInterval
Interface Descriptor:
------------------------------
0x09bLength
0x04bDescriptorType
0x01bInterfaceNumber
0x00bAlternateSetting
0x04bNumEndPoints
0xFFbInterfaceClass (Vendor specific)
0x5DbInterfaceSubClass
0x03bInterfaceProtocol
0x00iInterface
Unknown Descriptor:
------------------------------
0x1BbLength
0x21bDescriptorType
Hex dump:
0x1B 0x21 0x00 0x01 0x01 0x01 0x82 0x40 0x01 0x02
0x20 0x16 0x83 0x00 0x00 0x00 0x00 0x00 0x00 0x16
0x03 0x00 0x00 0x00 0x00 0x00 0x00
Endpoint Descriptor:
------------------------------
0x07bLength
0x05bDescriptorType
0x82bEndpointAddress (IN Endpoint)
0x03bmAttributes(Transfer: Interrupt / Synch: None / Usage: Data)
0x0020wMaxPacketSize (32 Bytes)
0x02bInterval
Endpoint Descriptor:
------------------------------
0x07bLength
0x05bDescriptorType
0x02bEndpointAddress (OUT Endpoint)
0x03bmAttributes(Transfer: Interrupt / Synch: None / Usage: Data)
0x0020wMaxPacketSize (32 Bytes)
0x04bInterval
Endpoint Descriptor:
------------------------------
0x07bLength
0x05bDescriptorType
0x83bEndpointAddress (IN Endpoint)
0x03bmAttributes(Transfer: Interrupt / Synch: None / Usage: Data)
0x0020wMaxPacketSize (32 Bytes)
0x40bInterval
Endpoint Descriptor:
------------------------------
0x07bLength
0x05bDescriptorType
0x03bEndpointAddress (OUT Endpoint)
0x03bmAttributes(Transfer: Interrupt / Synch: None / Usage: Data)
0x0020wMaxPacketSize (32 Bytes)
0x10bInterval
Interface Descriptor:
------------------------------
0x09bLength
0x04bDescriptorType
0x02bInterfaceNumber
0x00bAlternateSetting
0x01bNumEndPoints
0xFFbInterfaceClass (Vendor specific)
0x5DbInterfaceSubClass
0x02bInterfaceProtocol
0x00iInterface
Unknown Descriptor:
------------------------------
0x09bLength
0x21bDescriptorType
Hex dump:
0x09 0x21 0x00 0x01 0x01 0x22 0x84 0x07 0x00
Endpoint Descriptor:
------------------------------
0x07bLength
0x05bDescriptorType
0x84bEndpointAddress (IN Endpoint)
0x03bmAttributes(Transfer: Interrupt / Synch: None / Usage: Data)
0x0020wMaxPacketSize (32 Bytes)
0x10bInterval
Interface Descriptor:
------------------------------
0x09bLength
0x04bDescriptorType
0x03bInterfaceNumber
0x00bAlternateSetting
0x00bNumEndPoints
0xFFbInterfaceClass (Vendor specific)
0xFDbInterfaceSubClass
0x13bInterfaceProtocol
0x04iInterface "Xbox Security Method 3, Version 1.00, © 2005 Microsoft Corporation. All rights reserved."
Unknown Descriptor:
------------------------------
0x06bLength
0x41bDescriptorType
Hex dump:
0x06 0x41 0x00 0x01 0x01 0x03
String Descriptor Table
--------------------------------
Index LANGID String
0x00 0x0000 0x0409
0x01 0x0409 "©Microsoft Corporation"
0x02 0x0409 "Controller"
0x03 0x0409 "0F23AFB"
0x04 0x0409 "Xbox Security Method 3, Version 1.00, © 2005 Microsoft Corporation. All rights reserved."
0xEE 0x0000 "MSFT100"
------------------------------
Connection path for device:
Intel(R) USB 3.0 eXtensible Host Controller
Root Hub
Controller (VID=0x045E PID=0x028E)
Brought to you by TDD v1.83.0, Mar 7 2014, 14:22:05
Any help would be appreciated.