summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-11-12 19:44:47 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-11-12 19:44:47 +0000
commitbe61196f71ee0372b937d67f83e105e92ccb2a65 (patch)
treeefb271bb0683eb678ba33e77835e03279aea443e
parenteb27bacdefae4f130fe6f28487409a309f33390d (diff)
downloadpcsxr-be61196f71ee0372b937d67f83e105e92ccb2a65.tar.gz
Use Power Assertions on both 32-bit and 64-bit.
Since we have upped the system requirements to 10.6, this shouldn't cause any problems. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72222 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--macosx/main.m22
1 files changed, 4 insertions, 18 deletions
diff --git a/macosx/main.m b/macosx/main.m
index c27a27d2..e8478770 100644
--- a/macosx/main.m
+++ b/macosx/main.m
@@ -13,13 +13,11 @@
#import <unistd.h>
#include "psxcommon.h"
#include "sio.h"
+#import <IOKit/pwr_mgt/IOPMLib.h>
static BOOL sysInited = NO;
//#define EMU_LOG
-
-#ifdef __x86_64__
-#define USE_POWER_ASSERTION 1
-#endif
+static IOPMAssertionID powerAssertion = kIOPMNullAssertionID;
int main(int argc, const char *argv[]) {
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
@@ -51,11 +49,6 @@ int main(int argc, const char *argv[]) {
return NSApplicationMain(argc, argv);
}
-#ifdef USE_POWER_ASSERTION
-#import <IOKit/pwr_mgt/IOPMLib.h>
-static IOPMAssertionID powerAssertion = kIOPMNullAssertionID;
-#endif
-
int SysInit() {
if (!sysInited) {
#ifdef EMU_LOG
@@ -78,12 +71,12 @@ int SysInit() {
}
LoadMcds(Config.Mcd1, Config.Mcd2);
-#ifdef USE_POWER_ASSERTION
+
IOReturn success= IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("PSX Emu Running"), &powerAssertion);
if (success != kIOReturnSuccess) {
NSLog(@"Unable to stop sleep, error code %d", success);
}
-#endif
+
return 0;
}
@@ -145,9 +138,6 @@ void SysCloseLibrary(void *lib) {
// Called periodically from the emu thread
void SysUpdate() {
-#ifndef USE_POWER_ASSERTION
- UpdateSystemActivity(UsrActivity);
-#endif
PAD1_keypressed();
PAD2_keypressed();
[emuThread handleEvents];
@@ -155,12 +145,10 @@ void SysUpdate() {
// Returns to the Gui
void SysRunGui() {
-#ifdef USE_POWER_ASSERTION
if (powerAssertion != kIOPMNullAssertionID) {
IOPMAssertionRelease(powerAssertion);
powerAssertion = kIOPMNullAssertionID;
}
-#endif
}
// Close mem and plugins
@@ -168,12 +156,10 @@ void SysClose() {
EmuShutdown();
ReleasePlugins();
-#ifdef USE_POWER_ASSERTION
if (powerAssertion != kIOPMNullAssertionID) {
IOPMAssertionRelease(powerAssertion);
powerAssertion = kIOPMNullAssertionID;
}
-#endif
if (emuLog != NULL) fclose(emuLog);