summaryrefslogtreecommitdiff
path: root/macosx/main.m
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-12-14 08:15:46 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-12-14 08:15:46 +0000
commit0facac847fd9cde7556a53a0d19407b93b3e3c15 (patch)
tree70dc1ea116b8c06d4647aca653d9a2e56e551c97 /macosx/main.m
parentf6977b75b9a3cebff0ac73a9e751941dea4d7e42 (diff)
downloadpcsxr-0facac847fd9cde7556a53a0d19407b93b3e3c15.tar.gz
MaddTheSane:
- Clean up the Xcode projects a bit. - Added 64-bit mode on Mac. - Made it so that the SDK was set on the Xcode projects. - Enabled PowerPC support. (Patch #7730). git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@61171 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/main.m')
-rw-r--r--macosx/main.m17
1 files changed, 16 insertions, 1 deletions
diff --git a/macosx/main.m b/macosx/main.m
index ebd6e136..f496d43c 100644
--- a/macosx/main.m
+++ b/macosx/main.m
@@ -47,6 +47,9 @@ int main(int argc, const char *argv[]) {
return NSApplicationMain(argc, argv);
}
+#import <IOKit/pwr_mgt/IOPMLib.h>
+static IOPMAssertionID powerAssertion= 0;
+
int SysInit() {
if (!sysInited) {
#ifdef EMU_LOG
@@ -69,6 +72,10 @@ int SysInit() {
}
LoadMcds(Config.Mcd1, Config.Mcd2);
+ IOReturn success= IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &powerAssertion);
+ if (success != kIOReturnSuccess) {
+ NSLog(@"Unable to stop sleep, error code %d", success);
+ }
return 0;
}
@@ -131,19 +138,27 @@ void SysCloseLibrary(void *lib) {
// Called periodically from the emu thread
void SysUpdate() {
- UpdateSystemActivity(UsrActivity);
+// UpdateSystemActivity(UsrActivity);
[emuThread handleEvents];
}
// Returns to the Gui
void SysRunGui() {
+ if (powerAssertion != 0) {
+ IOPMAssertionRelease(powerAssertion);
+ powerAssertion = 0;
+ }
}
// Close mem and plugins
void SysClose() {
EmuShutdown();
ReleasePlugins();
+
+ if (powerAssertion != 0) {
+ IOPMAssertionRelease(powerAssertion);
+ }
if (emuLog != NULL) fclose(emuLog);