diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-06-11 09:22:11 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-06-11 09:22:11 +0000 |
| commit | 115f535248b36a4a08bbb570e6fc971d3c40e654 (patch) | |
| tree | 40ec39212d9ba18581b5bd99971807bb660f4491 | |
| parent | 1ca5686e1587d754f8f97c369b717679c95876a1 (diff) | |
| download | pcsxr-115f535248b36a4a08bbb570e6fc971d3c40e654.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@23682 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | macosx/English.lproj/PCSX.nib/classes.nib | 2 | ||||
| -rw-r--r-- | macosx/English.lproj/PCSX.nib/info.nib | 8 | ||||
| -rw-r--r-- | macosx/English.lproj/PCSX.nib/objects.nib | bin | 3327 -> 3402 bytes | |||
| -rw-r--r-- | macosx/Pcsx.xcodeproj/project.pbxproj | 2 | ||||
| -rw-r--r-- | macosx/PcsxController.h | 2 | ||||
| -rw-r--r-- | macosx/PcsxController.m | 88 | ||||
| -rw-r--r-- | macosx/PluginController.m | 2 |
8 files changed, 71 insertions, 41 deletions
@@ -1,3 +1,11 @@ +June 11, 2009 Wei Mingzhi <weimingzhi@gmail.com> + + * pcsxr/macosx/English.lproj/PCSX.nib/objects.nib: Added "Run ISO" function. + * pcsxr/macosx/English.lproj/PCSX.nib/info.nib: Likewise. + * pcsxr/macosx/English.lproj/PCSX.nib/classes.nib: Likewise. + * pcsxr/macosx/PcsxController.h: Likewise. + * pcsxr/macosx/PcsxController.m: Likewise. + June 10, 2009 Wei Mingzhi <weimingzhi@gmail.com> * libpcsxcore/plugins.c: Don't add "_" to function name for Mac OS X. diff --git a/macosx/English.lproj/PCSX.nib/classes.nib b/macosx/English.lproj/PCSX.nib/classes.nib index 62f942f4..1bd6e1b8 100644 --- a/macosx/English.lproj/PCSX.nib/classes.nib +++ b/macosx/English.lproj/PCSX.nib/classes.nib @@ -11,9 +11,9 @@ pause = id; preferences = id; reset = id; - runBios = id; runCD = id; runExe = id; + runIso = id; }; CLASS = PcsxController; LANGUAGE = ObjC; diff --git a/macosx/English.lproj/PCSX.nib/info.nib b/macosx/English.lproj/PCSX.nib/info.nib index 21855013..adce8580 100644 --- a/macosx/English.lproj/PCSX.nib/info.nib +++ b/macosx/English.lproj/PCSX.nib/info.nib @@ -3,14 +3,18 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>82 159 492 320 0 0 1024 746 </string> + <string>273 288 492 320 0 0 1024 746 </string> <key>IBEditorPositions</key> <dict> <key>29</key> - <string>136 288 261 44 0 0 1024 746 </string> + <string>79 658 219 44 0 0 1024 746 </string> </dict> <key>IBFramework Version</key> <string>446.1</string> + <key>IBOpenObjects</key> + <array> + <integer>29</integer> + </array> <key>IBSystem Version</key> <string>8P2137</string> </dict> diff --git a/macosx/English.lproj/PCSX.nib/objects.nib b/macosx/English.lproj/PCSX.nib/objects.nib Binary files differindex 6cd60ab4..b4ceb493 100644 --- a/macosx/English.lproj/PCSX.nib/objects.nib +++ b/macosx/English.lproj/PCSX.nib/objects.nib diff --git a/macosx/Pcsx.xcodeproj/project.pbxproj b/macosx/Pcsx.xcodeproj/project.pbxproj index 799a0707..da04a365 100644 --- a/macosx/Pcsx.xcodeproj/project.pbxproj +++ b/macosx/Pcsx.xcodeproj/project.pbxproj @@ -136,7 +136,7 @@ 2BA44360052DB2EA00E21DDD /* PcsxPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PcsxPlugin.h; sourceTree = "<group>"; }; 2BA44361052DB2EA00E21DDD /* PcsxPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = PcsxPlugin.m; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 2BB3D6CF05427FE200831ACB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; }; - 2BB3D6D105427FE200831ACB /* PCSX.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = PCSX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BB3D6D105427FE200831ACB /* PCSX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PCSX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 2BBB1126051DC00500B84448 /* PluginList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginList.h; sourceTree = "<group>"; }; 2BBB1127051DC00500B84448 /* PluginList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PluginList.m; sourceTree = "<group>"; }; 2BBB1787051E0D9700B84448 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = Credits.rtf; sourceTree = "<group>"; }; diff --git a/macosx/PcsxController.h b/macosx/PcsxController.h index 1e83aa81..13738469 100644 --- a/macosx/PcsxController.h +++ b/macosx/PcsxController.h @@ -22,7 +22,7 @@ - (IBAction)preferences:(id)sender; - (IBAction)reset:(id)sender; - (IBAction)runCD:(id)sender; -- (IBAction)runBios:(id)sender; +- (IBAction)runIso:(id)sender; - (IBAction)runExe:(id)sender; - (IBAction)freeze:(id)sender; - (IBAction)defrost:(id)sender; diff --git a/macosx/PcsxController.m b/macosx/PcsxController.m index b1502761..3d12ee66 100644 --- a/macosx/PcsxController.m +++ b/macosx/PcsxController.m @@ -21,29 +21,44 @@ NSString *saveStatePath; NSRange rdiskRange; BOOL wasPaused = [EmuThread pauseSafe]; - + /* close connection to current cd */ if ([EmuThread active]) CDR_close(); - - if (CDR_getDriveLetter() != nil) { - deviceName = [NSMutableString stringWithCString:CDR_getDriveLetter()]; - - // delete the 'r' in 'rdisk' - rdiskRange = [deviceName rangeOfString:@"rdisk"]; - if (rdiskRange.length != 0) { - rdiskRange.length = 1; - [deviceName deleteCharactersInRange:rdiskRange]; + + // switch to another ISO if using internal image reader, otherwise eject the CD + if (cdrfilename[0] != '\0') { + NSOpenPanel* openDlg = [NSOpenPanel openPanel]; + + [openDlg setCanChooseFiles:YES]; + [openDlg setCanChooseDirectories:NO]; + + if ([openDlg runModalForDirectory:nil file:nil] == NSOKButton) { + NSArray* files = [openDlg filenames]; + strcpy(cdrfilename, (const char *)[[files objectAtIndex:0] UTF8String]); + } + + cdOpenCase = time(NULL) + 2; + } else { + if (CDR_getDriveLetter() != nil) { + deviceName = [NSMutableString stringWithCString:CDR_getDriveLetter()]; + + // delete the 'r' in 'rdisk' + rdiskRange = [deviceName rangeOfString:@"rdisk"]; + if (rdiskRange.length != 0) { + rdiskRange.length = 1; + [deviceName deleteCharactersInRange:rdiskRange]; + } + // execute hdiutil to eject the device + ejectTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray arrayWithObjects:@"eject", deviceName, nil]]; + [ejectTask waitUntilExit]; } - // execute hdiutil to eject the device - ejectTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray arrayWithObjects:@"eject", deviceName, nil]]; - [ejectTask waitUntilExit]; } - + /* and open new cd */ if ([EmuThread active]) CDR_open(); - + if (!wasPaused) { [EmuThread resume]; } @@ -90,14 +105,22 @@ NSString *saveStatePath; - (IBAction)runCD:(id)sender { -// LoadCdBios = 0; + cdrfilename[0] = '\0'; [EmuThread run]; } -- (IBAction)runBios:(id)sender +- (IBAction)runIso:(id)sender { -// LoadCdBios = 1; - [EmuThread run]; + NSOpenPanel* openDlg = [NSOpenPanel openPanel]; + + [openDlg setCanChooseFiles:YES]; + [openDlg setCanChooseDirectories:NO]; + + if ([openDlg runModalForDirectory:nil file:nil] == NSOKButton) { + NSArray* files = [openDlg filenames]; + strcpy(cdrfilename, (const char *)[[files objectAtIndex:0] UTF8String]); + [EmuThread run]; + } } - (IBAction)runExe:(id)sender @@ -123,26 +146,26 @@ NSString *saveStatePath; GPU_keypressed(GPU_FULLSCREEN_KEY); } - - (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem { if ([menuItem action] == @selector(pause:)) { [menuItem setState:([EmuThread isPaused] ? NSOnState : NSOffState)]; - } else if ([menuItem action] == @selector(runBios:)) { - return [PcsxController biosAvailable]; } if ([menuItem action] == @selector(reset:) || [menuItem action] == @selector(pause:) || [menuItem action] == @selector(ejectCD:) || [menuItem action] == @selector(freeze:) || [menuItem action] == @selector(fullscreen:)) return [EmuThread active]; - + + if ([menuItem action] == @selector(runCD:) || [menuItem action] == @selector(runIso:)) + return ![EmuThread active]; + if ([menuItem action] == @selector(defrost:)) { if (![EmuThread active]) return NO; - + NSString *path = [NSString stringWithFormat:@"%@/%s-%3.3d.pcsxstate", saveStatePath, CdromId, [menuItem tag]]; - return (CheckState([path fileSystemRepresentation]) == 0); + return (CheckState((char *)[path fileSystemRepresentation]) == 0); } return YES; @@ -151,7 +174,7 @@ NSString *saveStatePath; - (void)applicationWillResignActive:(NSNotification *)aNotification { wasPausedBeforeBGSwitch = [EmuThread isPaused]; - + if (sleepInBackground) { [EmuThread pause]; } @@ -170,12 +193,12 @@ NSString *saveStatePath; if (![pluginList configured] /*!Config.Gpu[0] || !Config.Spu[0] || !Config.Pad1[0] || !Config.Cdr[0]*/) { // configure plugins [self preferences:nil]; - + NSRunCriticalAlertPanel(NSLocalizedString(@"Missing plugins!", nil), NSLocalizedString(@"Pcsx is missing one or more critical plugins. You will need to install these in order to play games.", nil), nil, nil, nil); } - + if (![PcsxController biosAvailable]) { NSRunInformationalAlertPanel(NSLocalizedString(@"Missing BIOS!", nil), NSLocalizedString(@"Pcsx wasn't able to locate any Playstation BIOS ROM files. This means that it will run in BIOS simulation mode which is less stable and compatible than using a real Playstation BIOS.\n" @@ -237,7 +260,7 @@ NSString *saveStatePath; if (str != nil) strncpy(Config.Bios, str, 255); else strcpy(Config.Bios, "HLE"); } - + // FIXME: hack strcpy(Config.Net, "Disabled"); } @@ -356,11 +379,6 @@ NSString *saveStatePath; str = [path fileSystemRepresentation]; if (str != nil) strncpy(Config.PluginsDir, str, 255); - // set font location -// path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/GONZN16X.TLF"]; -// str = [path fileSystemRepresentation]; -// if (str != nil) strncpy(Config.BiosFont, str, 255); - // locate a bios biosList = [[NSMutableArray alloc] init]; NSFileManager *manager = [NSFileManager defaultManager]; @@ -370,7 +388,7 @@ NSString *saveStatePath; for (i=0; i<[bioses count]; i++) { NSString *file = [bioses objectAtIndex:i]; NSDictionary *attrib = [manager fileAttributesAtPath:[NSString stringWithFormat:@"%s%@", Config.BiosDir, file] traverseLink:YES]; - + if ([[attrib fileType] isEqualToString:NSFileTypeRegular]) { unsigned long long size = [attrib fileSize]; if (([attrib fileSize] % (256*1024)) == 0 && size > 0) { diff --git a/macosx/PluginController.m b/macosx/PluginController.m index 958cad3a..a77f8850 100644 --- a/macosx/PluginController.m +++ b/macosx/PluginController.m @@ -12,7 +12,7 @@ - (IBAction)doConfigure:(id)sender { PcsxPlugin *plugin = [plugins objectAtIndex:[pluginMenu indexOfSelectedItem]]; - + [plugin configureAs:pluginType]; } |
