diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-10 19:26:52 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-10 19:26:52 +0000 |
| commit | c6eff5092c8086b8b3226e820f269837ed9f38b3 (patch) | |
| tree | af0a7e383297666e79259c6f29b6246e67c3cb9f /macosx/PcsxrController.m | |
| parent | c4d371a6e7072944077786dc3300c4e032f558d9 (diff) | |
| download | pcsxr-c6eff5092c8086b8b3226e820f269837ed9f38b3.tar.gz | |
Fix a problem if the memory cards couldn't be found. This fixes the plug-ins in the preferences window not popping up.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86611 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrController.m')
| -rwxr-xr-x | macosx/PcsxrController.m | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/macosx/PcsxrController.m b/macosx/PcsxrController.m index f9d8bd38..4ec3a8fc 100755 --- a/macosx/PcsxrController.m +++ b/macosx/PcsxrController.m @@ -615,11 +615,30 @@ otherblock();\ } } - str = [[[defaults URLForKey:@"Mcd1"] path] fileSystemRepresentation]; - if (str) strlcpy(Config.Mcd1, str, MAXPATHLEN); - - str = [[[defaults URLForKey:@"Mcd2"] path] fileSystemRepresentation]; - if (str) strlcpy(Config.Mcd2, str, MAXPATHLEN); + { + NSFileManager *manager = [NSFileManager defaultManager]; + NSURL *memoryURL = [[[manager URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:NULL] URLByAppendingPathComponent:@"Pcsxr"] URLByAppendingPathComponent:@"Memory Cards"]; + + str = [[[defaults URLForKey:@"Mcd1"] path] fileSystemRepresentation]; + if (str) { + strlcpy(Config.Mcd1, str, MAXPATHLEN); + } else { + NSURL *url = [memoryURL URLByAppendingPathComponent:@"Mcd001.mcr"]; + [defaults setURL:url forKey:@"Mcd1"]; + str = [[url path] fileSystemRepresentation]; + if (str != nil) strlcpy(Config.Mcd1, str, MAXPATHLEN); + } + + str = [[[defaults URLForKey:@"Mcd2"] path] fileSystemRepresentation]; + if (str) { + strlcpy(Config.Mcd2, str, MAXPATHLEN); + } else { + NSURL *url = [memoryURL URLByAppendingPathComponent:@"Mcd002.mcr"]; + [defaults setURL:url forKey:@"Mcd2"]; + str = [[url path] fileSystemRepresentation]; + if (str != nil) strlcpy(Config.Mcd2, str, MAXPATHLEN); + } + } if ([defaults boolForKey:@"UseHLE"] || 0 == [biosList count]) { strcpy(Config.Bios, "HLE"); |
