diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-06-26 00:53:22 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-06-26 00:53:22 +0000 |
| commit | 6349404da5984e6785574c96db3eb3a08a515b37 (patch) | |
| tree | 321d3f7f201b3f1f79190744c1387dff95e01d06 /macosx/PcsxrController.m | |
| parent | f51a15e84f8ec88c183ada3fab62dd4786ab9977 (diff) | |
| download | pcsxr-6349404da5984e6785574c96db3eb3a08a515b37.tar.gz | |
Even more work on the memory card management.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85558 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrController.m')
| -rwxr-xr-x | macosx/PcsxrController.m | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/macosx/PcsxrController.m b/macosx/PcsxrController.m index 9c122a4c..889c87ff 100755 --- a/macosx/PcsxrController.m +++ b/macosx/PcsxrController.m @@ -16,6 +16,7 @@ NSDictionary *prefStringKeys; NSDictionary *prefByteKeys; +NSDictionary *prefURLKeys; NSMutableArray *biosList; NSString *saveStatePath; @@ -437,7 +438,7 @@ otherblock();\ hasParsedAnArgument = YES; NSString *path = FileTestBlock(); runtimeBlock = [^{ - [self runURL:[NSURL fileURLWithPath:path]]; + [self runURL:[NSURL fileURLWithPath:path isDirectory:NO]]; } copy]; }; @@ -573,10 +574,10 @@ otherblock();\ } } - str = [[defaults stringForKey:@"Mcd1"] fileSystemRepresentation]; + str = [[[defaults URLForKey:@"Mcd1"] path] fileSystemRepresentation]; if (str) strlcpy(Config.Mcd1, str, MAXPATHLEN); - str = [[defaults stringForKey:@"Mcd2"] fileSystemRepresentation]; + str = [[[defaults URLForKey:@"Mcd2"] path] fileSystemRepresentation]; if (str) strlcpy(Config.Mcd2, str, MAXPATHLEN); if ([defaults boolForKey:@"UseHLE"] || 0 == [biosList count]) { @@ -608,6 +609,16 @@ otherblock();\ [defaults setObject:tmpNSStr forKey:defaultKey]; return; } + + str = (char *)[[prefURLKeys objectForKey:defaultKey] pointerValue]; + if (str) { + NSString *tmpNSStr = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:str length:strlen(str)]; + if (!tmpNSStr) { + tmpNSStr = [NSString stringWithCString:str encoding:NSUTF8StringEncoding]; + } + [defaults setURL:[NSURL fileURLWithPath:tmpNSStr isDirectory:NO] forKey:defaultKey]; + return; + } u8 *val = (u8 *)[[prefByteKeys objectForKey:defaultKey] pointerValue]; if (val) { @@ -644,9 +655,12 @@ otherblock();\ [NSValue valueWithPointer:Config.Pad1], @"PluginPAD", [NSValue valueWithPointer:Config.Cdr], @"PluginCDR", [NSValue valueWithPointer:Config.Net], @"PluginNET", - [NSValue valueWithPointer:Config.Mcd1], @"Mcd1", - [NSValue valueWithPointer:Config.Mcd2], @"Mcd2", nil]; + + prefURLKeys = [[NSDictionary alloc] initWithObjectsAndKeys: + [NSValue valueWithPointer:Config.Mcd1], @"Mcd1", + [NSValue valueWithPointer:Config.Mcd2], @"Mcd2", + nil]; prefByteKeys = [[NSDictionary alloc] initWithObjectsAndKeys: [NSValue valueWithPointer:&Config.Xa], @"NoXaAudio", |
