From 5303e1f09468440d341f690df8e005284b373f24 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Mon, 21 Jul 2014 07:41:11 +0200 Subject: [PATCH] (Apple) Have apple_rarch_load_content just call rarch_main --- frontend/frontend.c | 6 ++++++ frontend/frontend.h | 3 +++ frontend/platform/platform_apple.c | 11 +---------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/frontend.c b/frontend/frontend.c index d0c830467d..29130309fa 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -65,6 +65,10 @@ #endif +#if !defined(__APPLE__) +#define HAVE_MAIN_LOOP +#endif + static retro_keyboard_event_t key_event; #ifdef HAVE_MENU @@ -374,6 +378,7 @@ returntype main_entry(signature()) free_args(wrap_args, argv_copy, ARRAY_SIZE(argv_copy)); free(wrap_args); +#if defined(HAVE_MAIN_LOOP) #if defined(HAVE_MENU) while (!main_entry_iterate(signature_expand(), args)); #else @@ -381,6 +386,7 @@ returntype main_entry(signature()) #endif main_exit(args); +#endif returnfunc(); } diff --git a/frontend/frontend.h b/frontend/frontend.h index d398096f7c..a5911f7035 100644 --- a/frontend/frontend.h +++ b/frontend/frontend.h @@ -24,9 +24,11 @@ #if defined(ANDROID) #define args_type() struct android_app* #define signature() void* data +#define returntype void #else #define args_type() void* #define signature() int argc, char *argv[] +#define returntype int #endif #ifdef __cplusplus @@ -35,6 +37,7 @@ extern "C" { int main_entry_iterate(signature(), args_type() args); void main_exit(args_type() args); +returntype main_entry(signature()); #ifdef __cplusplus } diff --git a/frontend/platform/platform_apple.c b/frontend/platform/platform_apple.c index d5bcddb20f..80942561eb 100644 --- a/frontend/platform/platform_apple.c +++ b/frontend/platform/platform_apple.c @@ -84,16 +84,7 @@ void apple_event_basic_command(enum basic_event_t action) int apple_rarch_load_content(int *argc, char* argv[]) { - rarch_main_clear_state(); - rarch_init_msg_queue(); - - if (rarch_main_init(*argc, argv)) - return 1; - - if (!g_extern.libretro_dummy) - menu_rom_history_push_current(); - - g_extern.lifecycle_state |= 1ULL << MODE_GAME; + rarch_main(*argc, argv); return 0; }