diff --git a/android/phoenix/src/org/retroarch/browser/MainMenuActivity.java b/android/phoenix/src/org/retroarch/browser/MainMenuActivity.java index 47b1b4bae2..24e97ea143 100644 --- a/android/phoenix/src/org/retroarch/browser/MainMenuActivity.java +++ b/android/phoenix/src/org/retroarch/browser/MainMenuActivity.java @@ -317,7 +317,7 @@ public class MainMenuActivity extends PreferenceActivity { readbackBool(config, edit, "rewind_enable"); readbackBool(config, edit, "savestate_auto_load"); readbackBool(config, edit, "savestate_auto_save"); - readbackDouble(config, edit, "video_refresh_rate"); + //readbackDouble(config, edit, "video_refresh_rate"); readbackBool(config, edit, "audio_rate_control"); readbackBool(config, edit, "audio_enable"); @@ -325,7 +325,7 @@ public class MainMenuActivity extends PreferenceActivity { readbackDouble(config, edit, "input_overlay_opacity"); readbackBool(config, edit, "input_autodetect_enable"); - readbackInt(config, edit, "input_back_behavior"); + //readbackInt(config, edit, "input_back_behavior"); readbackBool(config, edit, "video_allow_rotate"); readbackBool(config, edit, "video_font_enable"); diff --git a/apple/OSX/platform.m b/apple/OSX/platform.m index 41f1c6e516..c860edeac0 100644 --- a/apple/OSX/platform.m +++ b/apple/OSX/platform.m @@ -85,7 +85,7 @@ apple_display_alert(@"No libretro cores were found.\nSelect \"Go->Cores Directory\" from the menu and place libretro dylib files there.", @"RetroArch"); // Run RGUI if needed - if (!_wantReload) + if (!_wantReload || apple_argv) apple_run_core(nil, 0); else [self chooseCore]; @@ -270,6 +270,23 @@ int main(int argc, char *argv[]) { + uint32_t current_argc = 0; + + for (int i = 0; i != argc; i ++) + { + if (strcmp(argv[i], "--") == 0) + { + current_argc = 1; + apple_argv = malloc(sizeof(char*) * (argc + 1)); + memset(apple_argv, 0, sizeof(char*) * (argc + 1)); + apple_argv[0] = argv[0]; + } + else if (current_argc) + { + apple_argv[current_argc ++] = argv[i]; + } + } + return NSApplicationMain(argc, (const char **) argv); } diff --git a/apple/RetroArch/RAGameView.m b/apple/RetroArch/RAGameView.m index 4b9c592f33..5064083985 100644 --- a/apple/RetroArch/RAGameView.m +++ b/apple/RetroArch/RAGameView.m @@ -312,6 +312,31 @@ void *apple_get_proc_address(const char *symbol_name) #endif } +bool apple_set_video_mode(unsigned width, unsigned height, bool fullscreen) +{ + __block bool result = true; + +#ifdef OSX + dispatch_sync(dispatch_get_main_queue(), + ^{ + // TODO: Multi-monitor support + // TODO: Sceen mode support + + if (fullscreen) + result = [g_view enterFullScreenMode:[NSScreen mainScreen] withOptions:nil]; + else + { + [g_view exitFullScreenModeWithOptions:nil]; + [g_view.window makeFirstResponder:g_view]; + } + }); +#endif + + // TODO: Maybe iOS users should be apple to show/hide the status bar here? + + return result; +} + #ifdef IOS void apple_bind_game_view_fbo(void) { diff --git a/apple/RetroArch/RetroArch_Apple.h b/apple/RetroArch/RetroArch_Apple.h index 90dccbb0da..96be99f0c7 100644 --- a/apple/RetroArch/RetroArch_Apple.h +++ b/apple/RetroArch/RetroArch_Apple.h @@ -38,6 +38,7 @@ #import "../OSX/platform.h" #endif +extern char** apple_argv; extern bool apple_is_paused; extern bool apple_is_running; extern bool apple_use_tv_mode; diff --git a/apple/RetroArch/main.m b/apple/RetroArch/main.m index 4ba48c1933..b8c85f2fff 100644 --- a/apple/RetroArch/main.m +++ b/apple/RetroArch/main.m @@ -23,6 +23,8 @@ #include "file.h" +char** apple_argv; + //#define HAVE_DEBUG_FILELOG id apple_platform; @@ -125,37 +127,46 @@ void apple_run_core(RAModuleInfo* core, const char* file) apple_core = core; apple_is_running = true; - + static char config_path[PATH_MAX]; static char core_path[PATH_MAX]; static char file_path[PATH_MAX]; - - static const char* argv[] = { "retroarch", "-c", config_path, "-L", core_path, file_path, 0 }; - if (apple_core) - strlcpy(config_path, apple_core.configPath.UTF8String, sizeof(config_path)); - else - strlcpy(config_path, RAModuleInfo.globalConfigPath.UTF8String, sizeof(config_path)); + if (!apple_argv) + { + static const char* argv[] = { "retroarch", "-c", config_path, "-L", core_path, file_path, 0 }; + + if (apple_core) + strlcpy(config_path, apple_core.configPath.UTF8String, sizeof(config_path)); + else + strlcpy(config_path, RAModuleInfo.globalConfigPath.UTF8String, sizeof(config_path)); - if (file && core) - { - argv[3] = "-L"; - argv[4] = core_path; - strlcpy(core_path, apple_core.path.UTF8String, sizeof(core_path)); - strlcpy(file_path, file, sizeof(file_path)); - } - else - { - argv[3] = "--menu"; - argv[4] = 0; + if (file && core) + { + argv[3] = "-L"; + argv[4] = core_path; + strlcpy(core_path, apple_core.path.UTF8String, sizeof(core_path)); + strlcpy(file_path, file, sizeof(file_path)); + } + else + { + argv[3] = "--menu"; + argv[4] = 0; + } + + apple_argv = (char**)argv; } - if (pthread_create(&apple_retro_thread, 0, rarch_main_spring, argv)) + if (pthread_create(&apple_retro_thread, 0, rarch_main_spring, apple_argv)) { + apple_argv = 0; + apple_rarch_exited((void*)1); return; } + apple_argv = 0; + pthread_detach(apple_retro_thread); } } diff --git a/apple/RetroArch/rarch_wrapper.h b/apple/RetroArch/rarch_wrapper.h index b92cf5eb83..3537360da5 100644 --- a/apple/RetroArch/rarch_wrapper.h +++ b/apple/RetroArch/rarch_wrapper.h @@ -26,6 +26,7 @@ void apple_rarch_exited (void* result); // These functions must only be called in gfx/context/ioseagl_ctx.c bool apple_init_game_view(void); void apple_destroy_game_view(void); +bool apple_set_video_mode(unsigned width, unsigned height, bool fullscreen); void apple_flip_game_view(void); void apple_set_game_view_sync(unsigned interval); void apple_get_game_view_size(unsigned *width, unsigned *height); diff --git a/apple/RetroArch_OSX.xcodeproj/project.pbxproj b/apple/RetroArch_OSX.xcodeproj/project.pbxproj index c67900681c..217f63a153 100644 --- a/apple/RetroArch_OSX.xcodeproj/project.pbxproj +++ b/apple/RetroArch_OSX.xcodeproj/project.pbxproj @@ -352,22 +352,22 @@ "-DHAVE_RARCH_MAIN_WRAP", "-DHAVE_GRIFFIN", "-DHAVE_RGUI", - "-DIOS", + "-DOSX", "-DHAVE_OPENGL", "-DHAVE_FBO", "-DHAVE_VID_CONTEXT", - "-DHAVE_OPENGLES2", "-DHAVE_GLSL", "-DINLINE=inline", "-DLSB_FIRST", "-D__LIBRETRO__", - "-DRARCH_MOBILE", + "-DWANT_RPNG", "-DHAVE_COREAUDIO", "-DHAVE_DYNAMIC", "-DHAVE_OVERLAY", "-DHAVE_ZLIB", "-DWANT_MINIZ", "-DSINC_LOWER_QUALITY", + "-DHAVE_NETPLAY", ); PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; diff --git a/gfx/context/apple_gl_ctx.c b/gfx/context/apple_gl_ctx.c index d8db42630f..29d0bfeb35 100644 --- a/gfx/context/apple_gl_ctx.c +++ b/gfx/context/apple_gl_ctx.c @@ -42,10 +42,7 @@ static bool gfx_ctx_set_video_mode( unsigned width, unsigned height, bool fullscreen) { - (void)width; - (void)height; - (void)fullscreen; - return true; + return apple_set_video_mode(width, height, fullscreen); } static void gfx_ctx_update_window_title(void)