summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-01-08 22:20:31 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-01-08 22:20:31 +0000
commit05e0c2b22ce4340c990446557ab720740af0edf7 (patch)
treea338dfd6b8187ec239150ba49459a610dbad47bd
parent22d155c56423bc9997ae122a01f4ae1b0ef079e7 (diff)
downloadpcsxr-05e0c2b22ce4340c990446557ab720740af0edf7.tar.gz
Making PCSX-R for Mac handle the added disc image formats.
Getting rid of unneeded .cue to .bin handling code. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82120 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--macosx/Info.plist128
-rwxr-xr-xmacosx/PcsxrController.m81
-rwxr-xr-xmacosx/PcsxrDiscHandler.m2
3 files changed, 88 insertions, 123 deletions
diff --git a/macosx/Info.plist b/macosx/Info.plist
index 2596d027..fbf97010 100644
--- a/macosx/Info.plist
+++ b/macosx/Info.plist
@@ -111,6 +111,8 @@
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
+ <string>com.sony.psp.firmware</string>
+ <string>com.codeplex.pcsxr.compressed-bin-image</string>
<string>com.alcohol-soft.mdfdisc</string>
<string>com.apple.disk-image-ndif</string>
<string>com.goldenhawk.cdrwin-cuesheet</string>
@@ -149,50 +151,6 @@
<string>PCSXR</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
- <key>UTImportedTypeDeclarations</key>
- <array>
- <dict>
- <key>UTTypeConformsTo</key>
- <array>
- <string>public.plain-text</string>
- <string>public.disk-image</string>
- </array>
- <key>UTTypeIdentifier</key>
- <string>com.goldenhawk.cdrwin-cuesheet</string>
- <key>UTTypeDescription</key>
- <string>bin/cue Disc Image</string>
- <key>UTTypeTagSpecification</key>
- <dict>
- <key>public.mime-type</key>
- <string>application/x-cue</string>
- <key>public.filename-extension</key>
- <array>
- <string>cue</string>
- <string>inst</string>
- </array>
- </dict>
- </dict>
- <dict>
- <key>UTTypeConformsTo</key>
- <array>
- <string>public.disk-image</string>
- <string>public.data</string>
- </array>
- <key>UTTypeDescription</key>
- <string>Alcohol Disc Image</string>
- <key>UTTypeReferenceURL</key>
- <string>http://www.alcohol-soft.com</string>
- <key>UTTypeIdentifier</key>
- <string>com.alcohol-soft.mdfdisc</string>
- <key>UTTypeTagSpecification</key>
- <dict>
- <key>public.filename-extension</key>
- <array>
- <string>mdf</string>
- </array>
- </dict>
- </dict>
- </array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
@@ -280,5 +238,87 @@
</dict>
</dict>
</array>
+ <key>UTImportedTypeDeclarations</key>
+ <array>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.plain-text</string>
+ <string>public.disk-image</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>bin/cue Disc Image</string>
+ <key>UTTypeIdentifier</key>
+ <string>com.goldenhawk.cdrwin-cuesheet</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>cue</string>
+ <string>inst</string>
+ </array>
+ <key>public.mime-type</key>
+ <string>application/x-cue</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.disk-image</string>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>Alcohol Disc Image</string>
+ <key>UTTypeIdentifier</key>
+ <string>com.alcohol-soft.mdfdisc</string>
+ <key>UTTypeReferenceURL</key>
+ <string>http://www.alcohol-soft.com</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>mdf</string>
+ </array>
+ </dict>
+ </dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.disk-image</string>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>PSP firmware dump</string>
+ <key>UTTypeIdentifier</key>
+ <string>com.sony.psp.firmware</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>pbp</string>
+ </array>
+ </dict>
+ </dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.disk-image</string>
+ <string>public.data</string>
+ <string>public.archive</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>Compressed bin Disc Image</string>
+ <key>UTTypeIdentifier</key>
+ <string>com.codeplex.pcsxr.compressed-bin-image</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>cbin</string>
+ <string>cbn</string>
+ </array>
+ </dict>
+ </dict>
+ </array>
</dict>
</plist>
diff --git a/macosx/PcsxrController.m b/macosx/PcsxrController.m
index da5de3d3..ae588ea2 100755
--- a/macosx/PcsxrController.m
+++ b/macosx/PcsxrController.m
@@ -16,81 +16,6 @@ NSDictionary *prefByteKeys;
NSMutableArray *biosList;
NSString *saveStatePath;
-static NSString *GetBin(NSString *toHandle)
-{
- NSString *extension = [toHandle pathExtension];
- BOOL getBin = NO;
- if ([extension caseInsensitiveCompare:@"cue"] == NSOrderedSame)
- getBin = YES;
- if ([extension caseInsensitiveCompare:@"toc"] == NSOrderedSame)
- getBin = YES;
-
- if (getBin == YES)
- {
- NSString *returnPath = nil;
- NSString *rawPath = [toHandle stringByDeletingPathExtension];
- returnPath = [rawPath stringByAppendingPathExtension:@"bin"];
- if(![[NSFileManager defaultManager] fileExistsAtPath:returnPath])
- {
- //TODO: handle case-sensitive filesystems better
- returnPath = [rawPath stringByAppendingPathExtension:@"BIN"];
- }
- return returnPath;
- } else {
- return toHandle;
- }
-
-}
-
-static NSString *HandleBinCue(NSString *toHandle)
-{
- NSURL *tempURL = [[NSURL alloc] initFileURLWithPath:toHandle];
- BOOL gotBin = NO;
- NSString *extension = [tempURL pathExtension];
- NSString *newName = toHandle;
- NSURL *temp1 = [tempURL URLByDeletingLastPathComponent];
- NSURL *temp2 = nil;
- if ([extension caseInsensitiveCompare:@"cue"] == NSOrderedSame) {
- //Get the bin file name from the cue.
- NSString *cueFile = [NSString stringWithContentsOfURL:tempURL encoding:NSUTF8StringEncoding error:nil];
- if (!cueFile) {
- cueFile = [NSString stringWithContentsOfURL:tempURL encoding:NSASCIIStringEncoding error:nil];
- if (!cueFile) {
- goto badCue;
- }
- }
-
- NSRange firstQuote, lastQuote, filePath;
- firstQuote = [cueFile rangeOfString:@"\""];
- if (firstQuote.location == NSNotFound) {
- goto badCue;
- }
- lastQuote = [cueFile rangeOfString:@".bin\"" options:NSCaseInsensitiveSearch];
- if (lastQuote.location == NSNotFound) {
- goto badCue;
- }
-
- filePath.location = firstQuote.location + 1; //Don't include the quote symbol
- filePath.length = (lastQuote.location + 4) - (firstQuote.location + 1 ); //Include the .bin but not the first quote symbol
- temp2 = [temp1 URLByAppendingPathComponent:[cueFile substringWithRange:filePath]];
- if (![[NSFileManager defaultManager] fileExistsAtPath:[temp2 path]])
- goto badCue;
-
- gotBin = YES;
-
- badCue:
- ;
- }
- if (gotBin == YES)
- {
- newName = [temp2 path];
- } else {
- newName = GetBin(toHandle);
- }
- [tempURL release];
- return newName;
-}
-
@implementation PcsxrController
- (IBAction)ejectCD:(id)sender
@@ -117,7 +42,7 @@ static NSString *HandleBinCue(NSString *toHandle)
if ([openDlg runModal] == NSFileHandlingPanelOKButton) {
NSArray* files = [openDlg URLs];
SetCdOpenCaseTime(time(NULL) + 2);
- SetIsoFile((const char *)[HandleBinCue([[files objectAtIndex:0] path]) fileSystemRepresentation]);
+ SetIsoFile((const char *)[[[files objectAtIndex:0] path] fileSystemRepresentation]);
}
[openDlg release];
} else {
@@ -210,7 +135,7 @@ static NSString *HandleBinCue(NSString *toHandle)
- (void)runURL:(NSURL*)url
{
- SetIsoFile((const char *)[HandleBinCue([url path]) fileSystemRepresentation]);
+ SetIsoFile((const char *)[[url path] fileSystemRepresentation]);
[EmuThread run];
}
@@ -577,7 +502,7 @@ static NSString *HandleBinCue(NSString *toHandle)
}
}
if (canHandle) {
- isHandled = [hand handleFile:HandleBinCue(filename)];
+ isHandled = [hand handleFile:filename];
[hand release];
break;
}
diff --git a/macosx/PcsxrDiscHandler.m b/macosx/PcsxrDiscHandler.m
index 86efdf73..79c65704 100755
--- a/macosx/PcsxrDiscHandler.m
+++ b/macosx/PcsxrDiscHandler.m
@@ -17,7 +17,7 @@
{
static NSArray *utisupport = nil;
if (utisupport == nil) {
- utisupport = [[NSArray alloc] initWithObjects:@"com.alcohol-soft.mdfdisc", @"com.goldenhawk.cdrwin-cuesheet", @"com.apple.disk-image-ndif", @"public.iso-image", nil];
+ utisupport = [[NSArray alloc] initWithObjects:@"com.alcohol-soft.mdfdisc", @"com.goldenhawk.cdrwin-cuesheet", @"com.apple.disk-image-ndif", @"public.iso-image", @"com.sony.psp.firmware", @"com.codeplex.pcsxr.compressed-bin-image", nil];
}
return utisupport;
}