From c2340bb44fb89e4a4c95bcf62a826c28059daeda Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 2 Jan 2016 16:07:23 -0800 Subject: [PATCH] OpenEmu: Fix Info.plist, saves --- CMakeLists.txt | 4 ++-- src/platform/openemu/Info.plist.in | 4 +++- src/platform/openemu/mGBAGameCore.m | 13 ++++++++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b062d59f..385c21209 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -588,8 +588,8 @@ if(BUILD_OPENEMU) MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/src/platform/openemu/Info.plist.in BUNDLE TRUE BUNDLE_EXTENSION oecoreplugin - OUTPUT_NAME ${PROJECT_NAME}EmuCore - COMPILE_DEFINITIONS "DISABLE_THREADING;${OS_DEFINES};${FUNCTION_DEFINES};MINIMAL_CORE=2") + OUTPUT_NAME ${PROJECT_NAME} + COMPILE_DEFINITIONS "DISABLE_THREADING;${OS_DEFINES};${FUNCTION_DEFINES};MINIMAL_CORE=1") target_link_libraries(${BINARY_NAME}-openemu ${OS_LIB} ${FOUNDATION} ${OPENEMUBASE}) install(TARGETS ${BINARY_NAME}-openemu LIBRARY DESTINATION ${LIBDIR} COMPONENT ${BINARY_NAME}.oecoreplugin NAMELINK_SKIP) endif() diff --git a/src/platform/openemu/Info.plist.in b/src/platform/openemu/Info.plist.in index 9c9980ee7..b99c084c3 100644 --- a/src/platform/openemu/Info.plist.in +++ b/src/platform/openemu/Info.plist.in @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleExecutable - ${EXECUTABLE_NAME} + ${PROJECT_NAME} CFBundleIconFile mGBA CFBundleIdentifier @@ -25,6 +25,8 @@ OEGameCoreOptions openemu.system.gba + + OEGameCorePlayerCount 1 diff --git a/src/platform/openemu/mGBAGameCore.m b/src/platform/openemu/mGBAGameCore.m index 1036d6024..58f2456e2 100644 --- a/src/platform/openemu/mGBAGameCore.m +++ b/src/platform/openemu/mGBAGameCore.m @@ -94,6 +94,18 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error { UNUSED(error); + + NSString *batterySavesDirectory = [self batterySavesDirectoryPath]; + NSLog(batterySavesDirectory); + [[NSFileManager defaultManager] createDirectoryAtURL:[NSURL fileURLWithPath:batterySavesDirectory] + withIntermediateDirectories:YES + attributes:nil + error:nil]; + if (context.dirs.save) { + context.dirs.save->close(context.dirs.save); + } + context.dirs.save = VDirOpen([batterySavesDirectory UTF8String]); + if (!GBAContextLoadROM(&context, [path UTF8String], true)) { return NO; } @@ -124,7 +136,6 @@ - (void)stopEmulation { - NSLog(@"Stopping"); GBAContextStop(&context); [super stopEmulation]; }