diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-01-09 01:50:38 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-01-09 01:50:38 +0000 |
| commit | 9af085242bda9ad4da78ef23e9d4ed180aa2c629 (patch) | |
| tree | c776a5dfefbe475936a461b54d469d244df9de75 /macosx/PcsxrController.m | |
| parent | c5b4bf6974fbfd05b6e75c494d11569756034e36 (diff) | |
| download | pcsxr-9af085242bda9ad4da78ef23e9d4ed180aa2c629.tar.gz | |
Use ARC in 64-bit mode on the Mac.
Register when we drag a disc image (or double click) to Pcsxr in the recent menu.
Comment out ReleasePlugins() in SysClose: it was causing a pointer to be released twice when you changed a plug-in (specifically, the GPU).
Cleaning up the Recent items code. One notable case is only releasing objects we have ownership of (this is pointless in ARC, but necessary in 32-bit code).
Had to rewrite -[PluginList setActivePlugin:forType:] because the previous version wasn't ARC-friendly.
If we select a disc while the emulator is running, load the disc into the current session.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82136 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrController.m')
| -rwxr-xr-x | macosx/PcsxrController.m | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/macosx/PcsxrController.m b/macosx/PcsxrController.m index ae588ea2..5949adcf 100755 --- a/macosx/PcsxrController.m +++ b/macosx/PcsxrController.m @@ -10,6 +10,7 @@ #include "plugins.h" #include "misc.h" #include "ExtendedKeys.h" +#import "ARCBridge.h" NSDictionary *prefStringKeys; NSDictionary *prefByteKeys; @@ -18,6 +19,8 @@ NSString *saveStatePath; @implementation PcsxrController +@synthesize recentItems; + - (IBAction)ejectCD:(id)sender { NSMutableString *deviceName; @@ -32,8 +35,7 @@ NSString *saveStatePath; // switch to another ISO if using internal image reader, otherwise eject the CD if (UsingIso()) { - NSOpenPanel* openDlg = [NSOpenPanel openPanel]; - [openDlg retain]; + NSOpenPanel* openDlg = RETAINOBJ([NSOpenPanel openPanel]); [openDlg setCanChooseFiles:YES]; [openDlg setCanChooseDirectories:NO]; @@ -44,7 +46,7 @@ NSString *saveStatePath; SetCdOpenCaseTime(time(NULL) + 2); SetIsoFile((const char *)[[[files objectAtIndex:0] path] fileSystemRepresentation]); } - [openDlg release]; + RELEASEOBJ(openDlg); } else { char *driveLetter = CDR_getDriveLetter(); @@ -112,8 +114,7 @@ NSString *saveStatePath; - (IBAction)runIso:(id)sender { - NSOpenPanel* openDlg = [NSOpenPanel openPanel]; - [openDlg retain]; + NSOpenPanel* openDlg = RETAINOBJ([NSOpenPanel openPanel]); [openDlg setCanChooseFiles:YES]; [openDlg setCanChooseDirectories:NO]; @@ -124,7 +125,7 @@ NSString *saveStatePath; [recentItems addRecentItem:url]; [self runURL:url]; } - [openDlg release]; + RELEASEOBJ(openDlg); } - (IBAction)runBios:(id)sender @@ -135,8 +136,13 @@ NSString *saveStatePath; - (void)runURL:(NSURL*)url { - SetIsoFile((const char *)[[url path] fileSystemRepresentation]); - [EmuThread run]; + if ([EmuThread active] == YES) { + SetCdOpenCaseTime(time(NULL) + 2); + SetIsoFile([[url path] fileSystemRepresentation]); + } else { + SetIsoFile((const char *)[[url path] fileSystemRepresentation]); + [EmuThread run]; + } } - (IBAction)freeze:(id)sender @@ -258,11 +264,14 @@ NSString *saveStatePath; sleepInBackground = [[NSUserDefaults standardUserDefaults] boolForKey:@"PauseInBackground"]; } + +#if !__has_feature(objc_arc) - (void)dealloc { [pluginList release]; [super dealloc]; } +#endif + (void)setConfigFromDefaults { @@ -439,8 +448,7 @@ NSString *saveStatePath; strcpy(Config.BiosDir, "Bios/"); strcpy(Config.PatchesDir, "Patches/"); - saveStatePath = @"sstates"; - [saveStatePath retain]; + saveStatePath = RETAINOBJ(@"sstates"); } // set plugin path @@ -499,14 +507,15 @@ NSString *saveStatePath; for (NSString *uti in [fileHandler supportedUTIs]) { if ([[NSWorkspace sharedWorkspace] type:utiFile conformsToType:uti]) { canHandle = YES; + break; } } if (canHandle) { isHandled = [hand handleFile:filename]; - [hand release]; + RELEASEOBJ(hand); break; } - [hand release]; + RELEASEOBJ(hand); } return isHandled; |
