mirror of https://github.com/bsnes-emu/bsnes.git
Offical WUP-028s require an activation sequence
This commit is contained in:
parent
66112af37e
commit
9f876e380c
|
@ -121,6 +121,8 @@ hacksByName = @{
|
|||
JOYConnectedUsage: @2,
|
||||
JOYConnectedUsagePage: @0xFF00,
|
||||
|
||||
JOYActivationReport: [NSData dataWithBytes:(uint8_t[]){0x13} length:1],
|
||||
|
||||
JOYSubElementStructs: @{
|
||||
|
||||
// Rumble
|
||||
|
|
|
@ -19,7 +19,7 @@ static NSString const *JOYConnectedUsagePage = @"JOYConnectedUsagePage";
|
|||
static NSString const *JOYRumbleMin = @"JOYRumbleMin";
|
||||
static NSString const *JOYRumbleMax = @"JOYRumbleMax";
|
||||
static NSString const *JOYSwapZRz = @"JOYSwapZRz";
|
||||
|
||||
static NSString const *JOYActivationReport = @"JOYActivationReport";
|
||||
|
||||
static NSMutableDictionary<id, JOYController *> *controllers; // Physical controllers
|
||||
static NSMutableArray<JOYController *> *exposedControllers; // Logical controllers
|
||||
|
@ -691,15 +691,25 @@ typedef struct __attribute__((packed)) {
|
|||
{
|
||||
NSString *name = (__bridge NSString *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey));
|
||||
NSDictionary *hacks = hacksByName[name];
|
||||
if (!hacks) {
|
||||
hacks = hacksByManufacturer[(__bridge NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey))];
|
||||
}
|
||||
NSArray *filters = hacks[JOYReportIDFilters];
|
||||
JOYController *controller = nil;
|
||||
if (filters) {
|
||||
JOYController *controller = [[JOYMultiplayerController alloc] initWithDevice:device
|
||||
reportIDFilters:filters];
|
||||
[controllers setObject:controller forKey:[NSValue valueWithPointer:device]];
|
||||
controller = [[JOYMultiplayerController alloc] initWithDevice:device
|
||||
reportIDFilters:filters];
|
||||
}
|
||||
else {
|
||||
[controllers setObject:[[JOYController alloc] initWithDevice:device] forKey:[NSValue valueWithPointer:device]];
|
||||
controller = [[JOYController alloc] initWithDevice:device];
|
||||
}
|
||||
|
||||
if (hacks[JOYActivationReport]) {
|
||||
[controller sendReport:hacks[JOYActivationReport]];
|
||||
}
|
||||
[controllers setObject:controller forKey:[NSValue valueWithPointer:device]];
|
||||
|
||||
|
||||
}
|
||||
|
||||
+ (void)controllerRemoved:(IOHIDDeviceRef) device
|
||||
|
|
Loading…
Reference in New Issue