From 4f8d3052355410c15bcb63ade4ddd6d55086adec Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 30 Jul 2016 12:49:08 +0200 Subject: [PATCH] (PS3) Implement frontend_ps3_process_args --- frontend/drivers/platform_ps3.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/frontend/drivers/platform_ps3.c b/frontend/drivers/platform_ps3.c index dcc158f8d2..5084754e42 100644 --- a/frontend/drivers/platform_ps3.c +++ b/frontend/drivers/platform_ps3.c @@ -522,12 +522,29 @@ static int frontend_ps3_parse_drive_list(void *data) return 0; } +static void frontend_ps3_process_args(int *argc, char *argv[]) +{ +#ifndef IS_SALAMANDER + /* A big hack: sometimes Salamander doesn't save the new core + * it loads on first boot, so we make sure + * active core path is set here. */ + + if (config_active_core_path_is_empty() && *argc >= 1 && strrchr(argv[0], '/')) + { + char path[PATH_MAX_LENGTH] = {0}; + strlcpy(path, strrchr(argv[0], '/') + 1, sizeof(path)); + if (path_file_exists(path)) + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, path); + } +#endif +} + frontend_ctx_driver_t frontend_ctx_ps3 = { frontend_ps3_get_environment_settings, frontend_ps3_init, frontend_ps3_deinit, frontend_ps3_exitspawn, - NULL, /* process_args */ + frontend_ps3_process_args, frontend_ps3_exec, #ifdef IS_SALAMANDER NULL,