diff options
| author | iCatButler <i.am.catbutler@gmail.com> | 2016-03-30 15:07:35 +0100 |
|---|---|---|
| committer | iCatButler <i.am.catbutler@gmail.com> | 2016-03-30 15:07:35 +0100 |
| commit | 8b4350fee747708ffd376744ef5dc1e239a87ba6 (patch) | |
| tree | a9ab6e2f25e06edc7c668353f8000856704f7fa3 /macosx/Source/PcsxrPlugin.m | |
| parent | e3df273095a5800e3dcdcb63bd66e269c0c2d3a8 (diff) | |
| download | pcsxr-8b4350fee747708ffd376744ef5dc1e239a87ba6.tar.gz | |
Bring up to date with PCSX-R master (97809)
Diffstat (limited to 'macosx/Source/PcsxrPlugin.m')
| -rw-r--r-- | macosx/Source/PcsxrPlugin.m | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/macosx/Source/PcsxrPlugin.m b/macosx/Source/PcsxrPlugin.m index 09e3eecf..016aefff 100644 --- a/macosx/Source/PcsxrPlugin.m +++ b/macosx/Source/PcsxrPlugin.m @@ -242,20 +242,15 @@ #define PluginSymbolNameConfigure(type) PluginSymbolName(type, @"configure") #define PluginSymbolNameAbout(type) PluginSymbolName(type, @"about") -- (void)runCommand:(id)arg +- (void)runCommandNamed:(NSString*)arg { - @autoreleasepool { - NSString *funcName = arg[0]; - long (*func)(void); - - func = SysLoadSym(pluginRef, [funcName cStringUsingEncoding:NSASCIIStringEncoding]); - if (SysLibError() == NULL) { - func(); - } else { - NSBeep(); - } - - return; + long (*func)(void); + + func = SysLoadSym(pluginRef, [arg cStringUsingEncoding:NSASCIIStringEncoding]); + if (SysLibError() == NULL) { + func(); + } else { + NSBeep(); } } @@ -336,26 +331,24 @@ - (void)aboutAs:(int)aType { - NSArray *arg; - NSString *aboutSym = PluginSymbolNameAbout(aType); - arg = @[aboutSym, @0]; + //NSArray *arg = @[aboutSym, @0]; // detach a new thread - [NSThread detachNewThreadSelector:@selector(runCommand:) toTarget:self - withObject:arg]; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + [self runCommandNamed:aboutSym]; + }); } - (void)configureAs:(int)aType { - NSArray *arg; - NSString *configSym = PluginSymbolNameConfigure(aType); - arg = @[configSym, @1]; + //NSArray *arg = @[configSym, @1]; // detach a new thread - [NSThread detachNewThreadSelector:@selector(runCommand:) toTarget:self - withObject:arg]; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + [self runCommandNamed:configSym]; + }); } - (NSString *)displayVersion @@ -376,7 +369,7 @@ if (_name == nil) return [path lastPathComponent]; - return [NSString stringWithFormat:@"%@ %@ [%@]", self.name, [self displayVersion], [path lastPathComponent]]; + return [NSString stringWithFormat:@"%@ %@ [%@]", self.name, self.displayVersion, path.lastPathComponent]; } - (NSString*)debugDescription @@ -384,7 +377,7 @@ if (_name == nil) { return fullPlugPath; } - return [NSString stringWithFormat:@"%@, %@ [%@]", self.name, [self displayVersion], fullPlugPath]; + return [NSString stringWithFormat:@"%@, %@ [%@]", self.name, self.displayVersion, fullPlugPath]; } // the plugin will check if it's still valid and return the status |
