summaryrefslogtreecommitdiff
path: root/macosx/main.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-07-09 07:07:15 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-07-09 07:07:15 +0000
commitb797c32f080fbdb69f4c84ace14a496b34423551 (patch)
tree4b54874a4959adf6f011874c181fe5173620ab63 /macosx/main.m
parente653d69b63a0be853f544d7c533f01817b0be0f4 (diff)
downloadpcsxr-b797c32f080fbdb69f4c84ace14a496b34423551.tar.gz
Changing a lot of NSLogs to SysPrintf on OS X's PCSXR.
Enable the emulog on OS X debug, and have create and use a log in ~/Library/Logs/PCSXR. Delete the hack that enabled PCSXR logs to go to the console in debug mode. Use modern syntax to create static NSArrays (and retain them in non-ARC code). Simplify the pauseSafeWithBlock to just create a new dispatch queue and run pauseSafe on the queue. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85931 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/main.m')
-rwxr-xr-xmacosx/main.m16
1 files changed, 12 insertions, 4 deletions
diff --git a/macosx/main.m b/macosx/main.m
index 8539101d..10724075 100755
--- a/macosx/main.m
+++ b/macosx/main.m
@@ -64,7 +64,15 @@ int SysInit() {
if (!sysInited) {
#ifdef EMU_LOG
#ifndef LOG_STDOUT
- emuLog = fopen("emuLog.txt","wb");
+ NSFileManager *manager = [NSFileManager defaultManager];
+ NSURL *supportURL = [manager URLForDirectory:NSLibraryDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:NULL];
+ NSURL *logFolderURL = [supportURL URLByAppendingPathComponent:@"Logs/PCSXR"];
+ if (![logFolderURL checkResourceIsReachableAndReturnError:NULL])
+ [manager createDirectoryAtPath:[logFolderURL path] withIntermediateDirectories:YES attributes:nil error:NULL];
+ //We use the log extension so that OS X's console app can open it by default.
+ NSURL *logFileURL = [logFolderURL URLByAppendingPathComponent:@"emuLog.log"];
+
+ emuLog = fopen([[logFileURL path] fileSystemRepresentation],"wb");
#else
emuLog = stdout;
#endif
@@ -85,7 +93,7 @@ int SysInit() {
IOReturn success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("PSX Emu Running"), &powerAssertion);
if (success != kIOReturnSuccess) {
- NSLog(@"Unable to stop sleep, error code %d", success);
+ SysPrintf("Unable to stop sleep, error code %d", success);
}
attachHotkeys();
@@ -147,7 +155,7 @@ const char *SysLibError() {
#ifdef DEBUG
const char *theErr = dlerror();
if (theErr) {
- NSLog(@"Error loading binary: %s", theErr);
+ SysPrintf("Error loading binary: %s\n", theErr);
}
return theErr;
#else
@@ -206,6 +214,6 @@ char* Pcsxr_locale_text(char* toloc){
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *origString = nil, *transString = nil;
origString = @(toloc);
- transString = [mainBundle localizedStringForKey:origString value:nil table:nil];
+ transString = [mainBundle localizedStringForKey:origString value:@"" table:nil];
return (char*)[transString UTF8String];
}