From 306a13ead55ee21c5af1e7e849f9a25e6074daa7 Mon Sep 17 00:00:00 2001 From: Tomasz Mazur Date: Tue, 17 May 2016 19:20:18 +0200 Subject: [PATCH 1/2] added 8Bitdo SFC30 --- iCade/LMBTControllerView.h | 3 ++- iCade/LMBTControllerView.m | 40 +++++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/iCade/LMBTControllerView.h b/iCade/LMBTControllerView.h index eb9492b..79d8f32 100644 --- a/iCade/LMBTControllerView.h +++ b/iCade/LMBTControllerView.h @@ -19,7 +19,8 @@ typedef enum _LMBTControllerType LMBTControllerType_iMpulse = 6, LMBTControllerType_8BitdoNES30 = 7, LMBTControllerType_IPEGAPG9025 = 8, - LMBTControllerType_Snakebyteidroidcon = 9 + LMBTControllerType_Snakebyteidroidcon = 9, + LMBTControllerType_8BitdoSFC30 = 10 } LMBTControllerType; @interface LMBTControllerView : iCadeReaderView { diff --git a/iCade/LMBTControllerView.m b/iCade/LMBTControllerView.m index 4b5e2fc..2448587 100644 --- a/iCade/LMBTControllerView.m +++ b/iCade/LMBTControllerView.m @@ -40,7 +40,7 @@ - (void)setControllerType:(LMBTControllerType)controllerType if(_controllerType != controllerType) { _controllerType = controllerType; - + for(NSArray* controller in [LMBTControllerView supportedControllers]) { if([[controller objectAtIndex:1] intValue] == _controllerType) @@ -51,7 +51,7 @@ - (void)setControllerType:(LMBTControllerType)controllerType memset(offString, '.', 12*sizeof(char)); onString[12] = '\0'; offString[12] = '\0'; - + NSString* controllerString = [controller objectAtIndex:2]; for(NSUInteger i=0; i<[controllerString length]; i++) { @@ -60,11 +60,11 @@ - (void)setControllerType:(LMBTControllerType)controllerType else offString[i/2] = [controllerString characterAtIndex:i]; } - + /*NSLog(@"on: %s", onString); NSLog(@"off: %s", offString); NSLog(@"Original: %@", controllerString);*/ - + /*char* customOnString = "wdxa..lkoyhj"; char* customOffString = "eczq..vpgtrn"; NSMutableString* rebuilt = [NSMutableString string]; @@ -78,7 +78,7 @@ - (void)setControllerType:(LMBTControllerType)controllerType [rebuilt appendString:[NSString stringWithCharacters:&character length:1]]; } NSLog(@"rebuilt: %@", rebuilt);*/ - + [self LMBT_setOnStateString:onString offStateString:offString]; break; @@ -98,60 +98,64 @@ + (NSArray*)supportedControllers // X // SE ST Y A // B - + // map order: UP RT DN LT SE ST Y B X A L R - + LMBTSupportedControllers = [[@[ /*@[@"Custom", [NSNumber numberWithInt:LMBTControllerType_Custom], @""],*/ - + // iCade @[@"iCade", [NSNumber numberWithInt:LMBTControllerType_iCade], @"wedcxzaqythrufjnimkpoglv"], - + // iCade 8-Bitty @[@"iCade 8-Bitty", [NSNumber numberWithInt:LMBTControllerType_iCade8Bitty], @"wedcxzaqytufimkpoglvhrjn"], - + // EX Hybrid // TODO: Properly support the EX Hybrid @[@"EX Hybrid", [NSNumber numberWithInt:LMBTControllerType_EXHybrid], @"wedcxzaqythrufjnimkpoglv"], - + // SteelSeries Free (thanks to Infernoten) @[@"SteelSeries Free", [NSNumber numberWithInt:LMBTControllerType_SteelSeriesFree], @"wedcxzaqoglvythrufjnimkp"], - + // 8Bitdo FC30 (thanks to guidoscheffler) @[@"8Bitdo FC30", [NSNumber numberWithInt:LMBTControllerType_8BitdoFC30], @"wedcxzaqytufimkpoglvhrjn"], - + // 8Bitdo NES30 (thanks to DerekT07) @[@"8Bitdo NES30", [NSNumber numberWithInt:LMBTControllerType_8BitdoNES30], @"wedcxzaqlvogythrjnufkpim"], - + // iMpulse @[@"iMpulse", [NSNumber numberWithInt:LMBTControllerType_iMpulse], @"wedcxzaq....lvkpogythrjn"], - + // IPEGA PG-9025 (thanks to naldin) @[@"IPEGA PG-9025", [NSNumber numberWithInt:LMBTControllerType_IPEGAPG9025], @"wedcxzaqoglvjnufythrimkp"], - + // Snakebyte idroid:con (thanks to Gohlan) @[@"Snakebyte idroid:con", [NSNumber numberWithInt:LMBTControllerType_Snakebyteidroidcon], - @"wedcxzaqlvogythrjnufimkp"] - + @"wedcxzaqlvogythrjnufimkp"], + + @[@"8Bitdo SFC30", + [NSNumber numberWithInt:LMBTControllerType_8BitdoSFC30], + @"wedcxzaqlvogythrjnufkpim"] + ] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { return [[obj1 firstObject] compare:[obj2 firstObject]]; }] copy]; From 300d97e5473b33fc28ab18da8a6077165d297796 Mon Sep 17 00:00:00 2001 From: Tomasz Mazur Date: Wed, 18 May 2016 11:58:51 +0200 Subject: [PATCH 2/2] Added iPega PG-9028; Removed EX Hybrid --- iCade/LMBTControllerView.h | 20 ++++++++++---------- iCade/LMBTControllerView.m | 37 ++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/iCade/LMBTControllerView.h b/iCade/LMBTControllerView.h index 79d8f32..e0ef0c9 100644 --- a/iCade/LMBTControllerView.h +++ b/iCade/LMBTControllerView.h @@ -10,17 +10,17 @@ typedef enum _LMBTControllerType { - LMBTControllerType_Custom = 0, - LMBTControllerType_iCade = 1, - LMBTControllerType_iCade8Bitty = 2, - LMBTControllerType_EXHybrid = 3, - LMBTControllerType_SteelSeriesFree = 4, - LMBTControllerType_8BitdoFC30 = 5, - LMBTControllerType_iMpulse = 6, - LMBTControllerType_8BitdoNES30 = 7, - LMBTControllerType_IPEGAPG9025 = 8, + LMBTControllerType_Custom = 0, + LMBTControllerType_iCade = 1, + LMBTControllerType_iCade8Bitty = 2, + LMBTControllerType_8BitdoFC30 = 3, + LMBTControllerType_8BitdoNES30 = 4, + LMBTControllerType_8BitdoSFC30 = 5, + LMBTControllerType_IPEGAPG9025 = 6, + LMBTControllerType_IPEGAPG9028 = 7, + LMBTControllerType_SteelSeriesFree = 8, LMBTControllerType_Snakebyteidroidcon = 9, - LMBTControllerType_8BitdoSFC30 = 10 + LMBTControllerType_iMpulse = 10 } LMBTControllerType; @interface LMBTControllerView : iCadeReaderView { diff --git a/iCade/LMBTControllerView.m b/iCade/LMBTControllerView.m index 2448587..26947ec 100644 --- a/iCade/LMBTControllerView.m +++ b/iCade/LMBTControllerView.m @@ -116,17 +116,6 @@ + (NSArray*)supportedControllers [NSNumber numberWithInt:LMBTControllerType_iCade8Bitty], @"wedcxzaqytufimkpoglvhrjn"], - // EX Hybrid - // TODO: Properly support the EX Hybrid - @[@"EX Hybrid", - [NSNumber numberWithInt:LMBTControllerType_EXHybrid], - @"wedcxzaqythrufjnimkpoglv"], - - // SteelSeries Free (thanks to Infernoten) - @[@"SteelSeries Free", - [NSNumber numberWithInt:LMBTControllerType_SteelSeriesFree], - @"wedcxzaqoglvythrufjnimkp"], - // 8Bitdo FC30 (thanks to guidoscheffler) @[@"8Bitdo FC30", [NSNumber numberWithInt:LMBTControllerType_8BitdoFC30], @@ -137,25 +126,35 @@ + (NSArray*)supportedControllers [NSNumber numberWithInt:LMBTControllerType_8BitdoNES30], @"wedcxzaqlvogythrjnufkpim"], - // iMpulse - @[@"iMpulse", - [NSNumber numberWithInt:LMBTControllerType_iMpulse], - @"wedcxzaq....lvkpogythrjn"], + // 8Bitdo SFC30 (thanks to defkode) + @[@"8Bitdo SFC30", + [NSNumber numberWithInt:LMBTControllerType_8BitdoSFC30], + @"wedcxzaqlvogythrjnufkpim"], // IPEGA PG-9025 (thanks to naldin) @[@"IPEGA PG-9025", [NSNumber numberWithInt:LMBTControllerType_IPEGAPG9025], @"wedcxzaqoglvjnufythrimkp"], + // IPEGA PG-9028 (thanks to klattimer) + @[@"IPEGA PG-9028", + [NSNumber numberWithInt:LMBTControllerType_IPEGAPG9028], + @"wedcxzaqimkpjnufythroglv"], + + // SteelSeries Free (thanks to Infernoten) + @[@"SteelSeries Free", + [NSNumber numberWithInt:LMBTControllerType_SteelSeriesFree], + @"wedcxzaqoglvythrufjnimkp"], + // Snakebyte idroid:con (thanks to Gohlan) @[@"Snakebyte idroid:con", [NSNumber numberWithInt:LMBTControllerType_Snakebyteidroidcon], @"wedcxzaqlvogythrjnufimkp"], - @[@"8Bitdo SFC30", - [NSNumber numberWithInt:LMBTControllerType_8BitdoSFC30], - @"wedcxzaqlvogythrjnufkpim"] - + // iMpulse + @[@"iMpulse", + [NSNumber numberWithInt:LMBTControllerType_iMpulse], + @"wedcxzaq....lvkpogythrjn"] ] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { return [[obj1 firstObject] compare:[obj2 firstObject]]; }] copy];