summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-10-04 22:06:37 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-10-04 22:06:37 +0000
commitc305db698d4560c2b494f10f0cff74d86ef660b9 (patch)
tree8a48f608dded969061d90b0776a1abb8d3f5c8da
parent2ee144472e54c451a26b71489f1abde0dcd5bd64 (diff)
downloadpcsxr-c305db698d4560c2b494f10f0cff74d86ef660b9.tar.gz
Minor fixes and improvements on OS X code.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@87354 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--macosx/Pcsxr.xcodeproj/project.pbxproj4
-rwxr-xr-xmacosx/PcsxrController.h3
-rwxr-xr-xmacosx/PcsxrController.m27
3 files changed, 23 insertions, 11 deletions
diff --git a/macosx/Pcsxr.xcodeproj/project.pbxproj b/macosx/Pcsxr.xcodeproj/project.pbxproj
index d32276e5..762fdd3f 100644
--- a/macosx/Pcsxr.xcodeproj/project.pbxproj
+++ b/macosx/Pcsxr.xcodeproj/project.pbxproj
@@ -1509,10 +1509,10 @@
557649B81786AFB7007C4457 /* Controllers */ = {
isa = PBXGroup;
children = (
- 2B4DE98D05FF9307003EFEF0 /* PluginController.h */,
- 2B4DE98E05FF9307003EFEF0 /* PluginController.m */,
2B75FD3C051C56D200D12034 /* PcsxrController.h */,
2B75FD3D051C56D200D12034 /* PcsxrController.m */,
+ 2B4DE98D05FF9307003EFEF0 /* PluginController.h */,
+ 2B4DE98E05FF9307003EFEF0 /* PluginController.m */,
2B75FD4A051C8A7400D12034 /* ConfigurationController.h */,
2B75FD4B051C8A7400D12034 /* ConfigurationController.m */,
55A9021E147D7C380037E18F /* PcsxrMemCardController.h */,
diff --git a/macosx/PcsxrController.h b/macosx/PcsxrController.h
index bc250d7d..cb2a902f 100755
--- a/macosx/PcsxrController.h
+++ b/macosx/PcsxrController.h
@@ -20,7 +20,8 @@ void ShowHelpAndExit(FILE* output, int exitCode);
unsigned int sleepInBackground:1;
unsigned int wasPausedBeforeBGSwitch:1;
unsigned int endAtEmuClose:1;
- unsigned int reserved:25;
+ unsigned int wasPausedBeforeDiscEject:1;
+ unsigned int reserved:28;
} PSXflags;
}
@property (weak) IBOutlet RecentItemsMenu *recentItems;
diff --git a/macosx/PcsxrController.m b/macosx/PcsxrController.m
index 6ddce420..ac9ae8ad 100755
--- a/macosx/PcsxrController.m
+++ b/macosx/PcsxrController.m
@@ -51,6 +51,7 @@ void ShowHelpAndExit(FILE* output, int exitCode)
@property (readwrite) BOOL endAtEmuClose;
@property BOOL sleepInBackground;
@property BOOL wasPausedBeforeBGSwitch;
+@property BOOL wasPausedBeforeDiscEject;
@property (strong) NSMutableArray *skipFiles;
@property (strong) NSWindow *preferenceWindow;
@property (strong) NSWindow *cheatWindow;
@@ -94,6 +95,16 @@ void ShowHelpAndExit(FILE* output, int exitCode)
PSXflags.wasPausedBeforeBGSwitch = wasPausedBeforeBGSwitch;
}
+- (BOOL)wasPausedBeforeDiscEject
+{
+ return PSXflags.wasPausedBeforeDiscEject;
+}
+
+-(void)setWasPausedBeforeDiscEject:(BOOL)wasPausedBeforeDiscEject
+{
+ PSXflags.wasPausedBeforeDiscEject = wasPausedBeforeDiscEject;
+}
+
@synthesize diskSession = _diskSession;
- (void)setDiskSession:(DASessionRef)diskSession
{
@@ -102,13 +113,13 @@ void ShowHelpAndExit(FILE* output, int exitCode)
}
if (_diskSession) {
CFRelease(_diskSession);
+ _diskSession = NULL;
}if (diskSession) {
_diskSession = diskSession;
CFRetain(diskSession);
}
}
-static BOOL wasPaused;
static void PSXDiscAppearedCallback(DADiskRef disk, void *context)
{
PcsxrController *theSelf = (__bridge PcsxrController*)context;
@@ -120,7 +131,7 @@ static void PSXDiscAppearedCallback(DADiskRef disk, void *context)
if ([EmuThread active])
CDR_open();
- if (!wasPaused) {
+ if (theSelf.wasPausedBeforeDiscEject) {
[EmuThread resume];
}
@@ -130,17 +141,17 @@ static void PSXDiscAppearedCallback(DADiskRef disk, void *context)
- (IBAction)ejectCD:(id)sender
{
- wasPaused = [EmuThread pauseSafe];
-
+ self.wasPausedBeforeDiscEject = [EmuThread pauseSafe];
+
/* close connection to current cd */
if ([EmuThread active])
CDR_close();
-
+
// switch to another ISO if using internal image reader, otherwise eject the CD
if (UsingIso()) {
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
[openDlg setAllowedFileTypes:[PcsxrDiscHandler supportedUTIs]];
-
+
if ([openDlg runModal] == NSFileHandlingPanelOKButton) {
NSArray* files = [openDlg URLs];
SetIsoFile([[files[0] path] fileSystemRepresentation]);
@@ -151,7 +162,7 @@ static void PSXDiscAppearedCallback(DADiskRef disk, void *context)
if ([EmuThread active])
CDR_open();
- if (!wasPaused) {
+ if (self.wasPausedBeforeDiscEject) {
[EmuThread resume];
}
} else {
@@ -162,7 +173,7 @@ static void PSXDiscAppearedCallback(DADiskRef disk, void *context)
if (driveLetter != NULL) {
deviceName = [NSMutableString stringWithString:[[NSFileManager defaultManager] stringWithFileSystemRepresentation:driveLetter length:strlen(driveLetter)]];
-
+
// delete the 'r' in 'rdisk'
rdiskRange = [deviceName rangeOfString:@"rdisk"];
if (rdiskRange.length != 0) {