Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add error: parameter to -loadFileAtPath: method. And update each type…

… of IPC communication to send the NSError back to the callers.
  • Loading branch information...
commit e39cbaca8e8bea97ead0d77f7ba579d87583f2d3 1 parent 002ede4
@clobber clobber authored
2  Atari800
@@ -1 +1 @@
-Subproject commit 95927c4ae7caf25a458b2a80ff6bd3fd9638f28a
+Subproject commit fd4db8da7428fb3c7e34e807b088dec68b298489
2  BSNES
@@ -1 +1 @@
-Subproject commit 92c22eb7673808379e9818ec6fb81b4d86aadbbc
+Subproject commit 4d86bfa2c2cab624b2c1d0de65a2a72fa9933ab9
2  CrabEmu
@@ -1 +1 @@
-Subproject commit f77d286df61d269ecccb396badaa3274a4fab3cd
+Subproject commit 718b2932a7bcc4ee22043f74af4b87574a2f3ec0
2  FCEU
@@ -1 +1 @@
-Subproject commit b775c7e09906694cf11df05e8cb9951402a701bd
+Subproject commit e5e1a41c770eed998cffc2429e31b8b4f57cce0e
2  Gambatte
@@ -1 +1 @@
-Subproject commit e19930fdd2abee59c793291e0ef5017907f51415
+Subproject commit 934aec61520c791e243875c76cd6cb4af073986e
2  GenesisPlus
@@ -1 +1 @@
-Subproject commit 7c143301529abc58c1858469675a2d58ae70cd81
+Subproject commit 818519ea859e2b2d3c54f1688574161901b1862e
2  Higan
@@ -1 +1 @@
-Subproject commit b9f241ca892652be77c18e35a4f45086924cdef4
+Subproject commit fa01a82293dccb60e7a9ffff1ac3b0c7a3a10a95
2  Mednafen
@@ -1 +1 @@
-Subproject commit 8f29dfbb16d5f78cc01d93cdac44de725ece4bdf
+Subproject commit 9b9615282ad0318711a1dc8416ca9d1874e0f8cd
2  Mupen64Plus
@@ -1 +1 @@
-Subproject commit beb9757baf764468d846805350ba32c240dba617
+Subproject commit 4421cab64fe81693bada7d39cadaf1710b766f63
2  NeoPop
@@ -1 +1 @@
-Subproject commit f6ba6dc929a3f30271b8389db575cc0adbfe90a0
+Subproject commit e5a6e8626e2760411941fa2e77afc56930efe01c
2  Nestopia
@@ -1 +1 @@
-Subproject commit 505025c2ea2fc3c180f4f94da19b88a0b5183cba
+Subproject commit aa6e8c67d98833573dc240d2bf751a714f0683d8
2  OpenEmu-SDK
@@ -1 +1 @@
-Subproject commit 46ebe6a41996cb56d669687cc7e2c5288872d36e
+Subproject commit 52d6f62389a0ab47beacbd7b804f63289cbaecd4
View
1  OpenEmu/OEDOGameCoreHelper.h
@@ -67,6 +67,7 @@
@protocol OEDOGameCoreHelperDelegate <NSObject>
- (oneway void)gameCoreHelperDidSetSystemResponderClient:(byref id)responderClient withMessageIdentifier:(NSString *)identifier;
+- (oneway void)gameCoreHelperFailedToLoadROMWithError:(NSError *)error messageIdentifier:(NSString *)identifier;
- (oneway void)gameCoreHelperDidSetupEmulationWithSurfaceID:(IOSurfaceID)surfaceID screenSize:(OEIntSize)screenSize aspectSize:(OEIntSize)aspectSize messageIdentifier:(NSString *)identifier;;
- (oneway void)gameCoreHelperDidStartEmulationWithMessageIdentifier:(NSString *)identifier;
View
28 OpenEmu/OEDOGameCoreManager.m
@@ -78,8 +78,15 @@ - (void)loadROMWithCompletionHandler:(void(^)(id systemClient))completionHandler
withDelegate:_delegateHelper
displayHelper:(id<OEDOGameCoreDisplayHelper>)[self displayHelper]
messageIdentifier:
- [self messageIdentifierForResponderClientHandler:^(id responderClient)
+ [self messageIdentifierForResponderClientHandler:
+ ^(id responderClient, NSError *error)
{
+ if(responderClient == nil)
+ {
+ errorHandler(error);
+ return;
+ }
+
[(NSDistantObject *)responderClient setProtocolForProxy:[[[self systemController] responderClass] gameSystemResponderClientProtocol]];
completionHandler(responderClient);
@@ -301,7 +308,7 @@ - (NSString *)messageIdentifierForSuccessHandler:(void(^)(BOOL, NSError *))succe
return identifier;
}
-- (NSString *)messageIdentifierForResponderClientHandler:(void(^)(id))responderClient;
+- (NSString *)messageIdentifierForResponderClientHandler:(void(^)(id, NSError *))responderClient;
{
NSString *identifier = [NSString stringWithUUID];
responderClient = [responderClient copy];
@@ -332,11 +339,11 @@ - (void)performSuccessBlockWithIdentifier:(NSString *)identifier success:(BOOL)s
block(success, error);
}
-- (void)performResponderClientBlockWithIdentifier:(NSString *)identifier systemClient:(id)systemClient;
+- (void)performResponderClientBlockWithIdentifier:(NSString *)identifier systemClient:(id)systemClient error:(NSError *)error;
{
- void(^block)(id) = _pendingBlocks[identifier];
+ void(^block)(id, NSError *) = _pendingBlocks[identifier];
[_pendingBlocks removeObjectForKey:identifier];
- block(systemClient);
+ block(systemClient, error);
}
#pragma mark - TaskWrapper delegate methods
@@ -385,14 +392,19 @@ - (void)callSuccessBlockForIdentifier:(NSString *)identifier withSuccess:(BOOL)s
[_gameCoreManager performSuccessBlockWithIdentifier:identifier success:success error:error];
}
-- (void)callResponderClientBlockForIdentifier:(NSString *)identifier withClient:(id)client
+- (void)callResponderClientBlockForIdentifier:(NSString *)identifier withClient:(id)client error:(NSError *)error
{
- [_gameCoreManager performResponderClientBlockWithIdentifier:identifier systemClient:client];
+ [_gameCoreManager performResponderClientBlockWithIdentifier:identifier systemClient:client error:error];
}
- (oneway void)gameCoreHelperDidSetSystemResponderClient:(byref id)responderClient withMessageIdentifier:(NSString *)identifier
{
- [self callResponderClientBlockForIdentifier:identifier withClient:responderClient];
+ [self callResponderClientBlockForIdentifier:identifier withClient:responderClient error:nil];
+}
+
+- (oneway void)gameCoreHelperFailedToLoadROMWithError:(NSError *)error messageIdentifier:(NSString *)identifier
+{
+ [self callResponderClientBlockForIdentifier:identifier withClient:nil error:error];
}
- (oneway void)gameCoreHelperDidSetupEmulationWithSurfaceID:(IOSurfaceID)surfaceID screenSize:(OEIntSize)screenSize aspectSize:(OEIntSize)aspectSize messageIdentifier:(NSString *)identifier;
View
6 OpenEmu/OEThreadGameCoreManager.m
@@ -73,12 +73,14 @@ - (void)_executionThread:(id)object
{
[self setGameCoreHelper:(id<OEGameCoreHelper>)_helperProxy];
[_helper setDisplayHelper:(id<OEGameCoreDisplayHelper>)_displayHelperProxy];
- if(![_helper loadROMAtPath:[self ROMPath] withCorePluginAtPath:[[self plugin] path] systemIdentifier:[[self systemController] systemIdentifier]])
+
+ NSError *error;
+ if(![_helper loadROMAtPath:[self ROMPath] withCorePluginAtPath:[[self plugin] path] systemIdentifier:[[self systemController] systemIdentifier] error:&error])
{
FIXME("Return a proper error object here.");
if(_errorHandler != nil)
{
- _errorHandler(nil);
+ _errorHandler(error);
_errorHandler = nil;
}
return;
View
5 OpenEmu/OpenEmuDOHelperApp.m
@@ -112,8 +112,11 @@ - (oneway void)loadROMAtPath:(bycopy NSString *)romPath usingCorePluginAtPath:(b
[(NSDistantObject *)delegate setProtocolForProxy:@protocol(OEDOGameCoreDisplayHelper)];
[self setDisplayHelper:(id<OEGameCoreDisplayHelper>)displayHelper];
- if([self loadROMAtPath:romPath withCorePluginAtPath:corePluginPath systemIdentifier:[[OESystemPlugin systemPluginWithBundleAtPath:systemPluginPath] systemIdentifier]])
+ NSError *error;
+ if([self loadROMAtPath:romPath withCorePluginAtPath:corePluginPath systemIdentifier:[[OESystemPlugin systemPluginWithBundleAtPath:systemPluginPath] systemIdentifier] error:&error])
[delegate gameCoreHelperDidSetSystemResponderClient:[self gameCore] withMessageIdentifier:identifier];
+ else
+ [delegate gameCoreHelperFailedToLoadROMWithError:error messageIdentifier:identifier];
}
@end
View
2  OpenEmu/OpenEmuHelperApp.h
@@ -109,7 +109,7 @@ enum _OEHelperAppErrorCodes
- (void)launchApplication;
-- (BOOL)loadROMAtPath:(NSString *)aPath withCorePluginAtPath:(NSString *)pluginPath systemIdentifier:(NSString *)systemIdentifier;
+- (BOOL)loadROMAtPath:(NSString *)aPath withCorePluginAtPath:(NSString *)pluginPath systemIdentifier:(NSString *)systemIdentifier error:(NSError **)error;
- (void)setupProcessPollingTimer;
- (void)quitHelperTool;
View
4 OpenEmu/OpenEmuHelperApp.m
@@ -526,7 +526,7 @@ - (void)destroyGLResources
#pragma mark - Game Core methods
-- (BOOL)loadROMAtPath:(NSString *)aPath withCorePluginAtPath:(NSString *)pluginPath systemIdentifier:(NSString *)systemIdentifier
+- (BOOL)loadROMAtPath:(NSString *)aPath withCorePluginAtPath:(NSString *)pluginPath systemIdentifier:(NSString *)systemIdentifier error:(NSError **)error
{
if([self loadedRom]) return NO;
@@ -559,7 +559,7 @@ - (BOOL)loadROMAtPath:(NSString *)aPath withCorePluginAtPath:(NSString *)pluginP
if(![systemIdentifier isEqualToString:@"openemu.system.arcade"])
aPath = [self decompressedPathForRomAtPath:aPath];
- if([_gameCore loadFileAtPath:aPath])
+ if([_gameCore loadFileAtPath:aPath error:error])
{
DLog(@"Loaded new Rom: %@", aPath);
return self.loadedRom = YES;
View
5 OpenEmu/OpenEmuXPCHelperApp.m
@@ -108,9 +108,10 @@ - (void)loadROMAtPath:(NSString *)romPath usingCorePluginAtPath:(NSString *)plug
{
OESystemPlugin *plugin = [OESystemPlugin systemPluginWithBundleAtPath:systemPluginPath];
- if(![self loadROMAtPath:romPath withCorePluginAtPath:pluginPath systemIdentifier:[plugin systemIdentifier]])
+ NSError *error;
+ if(![self loadROMAtPath:romPath withCorePluginAtPath:pluginPath systemIdentifier:[plugin systemIdentifier] error:&error])
{
- completionHandler(nil, nil);
+ completionHandler(nil, error);
return;
}
2  PPSSPP
@@ -1 +1 @@
-Subproject commit 5c1458bc250b652c2e720c9d79fff864f501efc8
+Subproject commit 3064b9883aaa7760a562a1445e36a89b631aa9d6
2  ProSystem
@@ -1 +1 @@
-Subproject commit 366bb1c4a96b9a908dcbed93ab730b0cad09b777
+Subproject commit 561a47efe1e5eeddd70c6f808176d272550d649a
2  SNES9x
@@ -1 +1 @@
-Subproject commit dfa20c0d7205b2476e74b7ce0306b53679b3b3a2
+Subproject commit d09af71bd6640906b61640f7a5b5780230deb405
2  Stella
@@ -1 +1 @@
-Subproject commit e07710ae7b479ef4c4c4ac034ebcea93f8562183
+Subproject commit e4d3ae497df71495cbbc6c38510f8cc24677c34e
2  TwoMbit
@@ -1 +1 @@
-Subproject commit 55e1c99498717bc40380c41dc03cd0ccd9b793e1
+Subproject commit 270d2d1656b9deea28d57073804d60bc9eed33be
2  UME
@@ -1 +1 @@
-Subproject commit f3f6959c30cc4e261404464e91f7c7f059a28860
+Subproject commit 9799cf4f23900d530e1f1832329ec102512fe61b
2  VecXGL
@@ -1 +1 @@
-Subproject commit bda6c9398b39b8435e69ca158420082e94557d55
+Subproject commit df9d5670bd7ef1d7887b1eee2537a9085123eead
2  VisualBoyAdvance
@@ -1 +1 @@
-Subproject commit 59e0006e9d4acb47054198fe297fb1914553ac3c
+Subproject commit 455e9fe0032a461d9d5cabc45d5ef6def064c971
2  blueMSX
@@ -1 +1 @@
-Subproject commit 9639e9e4971ccf631ac0b63b35260b72201fa9f6
+Subproject commit 76425e1dbdb20938c59dee11f5a2949d97222267
2  picodrive
@@ -1 +1 @@
-Subproject commit eecb61b377861f8d094d22922033ee0b14fd730a
+Subproject commit 3e5456ec7f23e300d9ab3387931366eefddab566
2  yabause
@@ -1 +1 @@
-Subproject commit 415602f0916667b8d6ef03b91368e1430e77c2f9
+Subproject commit f5fa3d44805634e06e7dcd855e6660062dbe1156
Please sign in to comment.
Something went wrong with that request. Please try again.