(ANDROID) display error message when ROM fails to load
This commit is contained in:
parent
a2247272ef
commit
c8b0d23c78
|
@ -106,11 +106,10 @@ static void jni_get (void *data_in, void *data_out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool android_app_start_main(struct android_app *android_app, int *init_ret)
|
static bool android_app_start_main(struct android_app *android_app)
|
||||||
{
|
{
|
||||||
struct jni_params in_params;
|
struct jni_params in_params;
|
||||||
struct jni_out_params_char out_args;
|
struct jni_out_params_char out_args;
|
||||||
struct rarch_main_wrap args = {0};
|
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
in_params.java_vm = android_app->activity->vm;
|
in_params.java_vm = android_app->activity->vm;
|
||||||
|
@ -153,37 +152,15 @@ static bool android_app_start_main(struct android_app *android_app, int *init_re
|
||||||
RARCH_LOG("Config file: [%s].\n", g_extern.config_path);
|
RARCH_LOG("Config file: [%s].\n", g_extern.config_path);
|
||||||
RARCH_LOG("Current IME: [%s].\n", android_app->current_ime);
|
RARCH_LOG("Current IME: [%s].\n", android_app->current_ime);
|
||||||
|
|
||||||
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
|
ret = load_menu_game();
|
||||||
|
if (ret)
|
||||||
args.verbose = true;
|
|
||||||
args.config_path = g_extern.config_path;
|
|
||||||
args.sram_path = NULL;
|
|
||||||
args.state_path = NULL;
|
|
||||||
args.rom_path = g_extern.fullpath;
|
|
||||||
args.libretro_path = g_settings.libretro;
|
|
||||||
|
|
||||||
ret = rarch_main_init_wrap(&args);
|
|
||||||
|
|
||||||
if (ret == 0)
|
|
||||||
{
|
|
||||||
RARCH_LOG("rarch_main_init succeeded.\n");
|
|
||||||
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
|
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
|
||||||
}
|
return ret;
|
||||||
else
|
|
||||||
RARCH_ERR("rarch_main_init failed.\n");
|
|
||||||
|
|
||||||
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INIT);
|
|
||||||
|
|
||||||
if (ret == 0)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *android_app_entry(void *data)
|
static void *android_app_entry(void *data)
|
||||||
{
|
{
|
||||||
struct android_app* android_app = (struct android_app*)data;
|
struct android_app* android_app = (struct android_app*)data;
|
||||||
int init_ret = 0;
|
|
||||||
|
|
||||||
android_app->config = AConfiguration_new();
|
android_app->config = AConfiguration_new();
|
||||||
AConfiguration_fromAssetManager(android_app->config, android_app->activity->assetManager);
|
AConfiguration_fromAssetManager(android_app->config, android_app->activity->assetManager);
|
||||||
|
@ -212,12 +189,17 @@ static void *android_app_entry(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
rarch_init_msg_queue();
|
rarch_init_msg_queue();
|
||||||
|
|
||||||
if (!android_app_start_main(android_app, &init_ret))
|
|
||||||
goto exit;
|
|
||||||
|
|
||||||
menu_init();
|
menu_init();
|
||||||
|
|
||||||
|
if (!android_app_start_main(android_app))
|
||||||
|
{
|
||||||
|
init_drivers();
|
||||||
|
driver.video_poke->set_aspect_ratio(driver.video_data, ASPECT_RATIO_SQUARE);
|
||||||
|
rarch_render_cached_frame();
|
||||||
|
sleep(2);
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (g_extern.system.shutdown)
|
if (g_extern.system.shutdown)
|
||||||
|
@ -234,7 +216,7 @@ static void *android_app_entry(void *data)
|
||||||
#ifdef RARCH_CONSOLE
|
#ifdef RARCH_CONSOLE
|
||||||
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
|
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
|
||||||
#else
|
#else
|
||||||
return 1;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +274,7 @@ exit:
|
||||||
// exit() here is nasty.
|
// exit() here is nasty.
|
||||||
// pthread_exit(NULL) or return NULL; causes hanging ...
|
// pthread_exit(NULL) or return NULL; causes hanging ...
|
||||||
// Should probably called ANativeActivity_finsih(), but it's bugged, it will hang our app.
|
// Should probably called ANativeActivity_finsih(), but it's bugged, it will hang our app.
|
||||||
exit(init_ret);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void android_app_write_cmd (void *data, int8_t cmd)
|
static inline void android_app_write_cmd (void *data, int8_t cmd)
|
||||||
|
|
Loading…
Reference in New Issue