diff --git a/frontend/platform/platform_gx.c b/frontend/platform/platform_gx.c index 793a58fddf..7db1e50c73 100644 --- a/frontend/platform/platform_gx.c +++ b/frontend/platform/platform_gx.c @@ -53,14 +53,14 @@ extern void system_exec_wii(const char *path, bool should_load_game); #ifdef IS_SALAMANDER char libretro_path[PATH_MAX]; -static void find_and_set_first_file(void) +static void find_and_set_first_file(const char *ext) { //Last fallback - we'll need to start the first executable file // we can find in the RetroArch cores directory char first_file[PATH_MAX] = {0}; find_first_libretro_core(first_file, sizeof(first_file), - default_paths.core_dir, "dol"); + default_paths.core_dir, ext); if(first_file) { @@ -93,7 +93,7 @@ static void frontend_gx_salamander_init(void) } if(!config_file_exists || !strcmp(libretro_path, "")) - find_and_set_first_file(); + find_and_set_first_file("dol"); else { RARCH_LOG("Start [%s] found in retroarch.cfg.\n", libretro_path); diff --git a/frontend/platform/platform_ps3.c b/frontend/platform/platform_ps3.c index 5c94f0199b..86007b53d2 100644 --- a/frontend/platform/platform_ps3.c +++ b/frontend/platform/platform_ps3.c @@ -49,13 +49,14 @@ SYS_PROCESS_PARAM(1001, 0x200000) char libretro_path[512]; -static void find_and_set_first_file(void) +static void find_and_set_first_file(const char *ext) { //Last fallback - we'll need to start the first executable file // we can find in the RetroArch cores directory char first_file[PATH_MAX]; - find_first_libretro_core(first_file, sizeof(first_file), default_paths.core_dir, "SELF"); + find_first_libretro_core(first_file, sizeof(first_file), + default_paths.core_dir, ext); if(first_file) { @@ -84,7 +85,7 @@ static void frontend_ps3_salamander_init(void) } if (!config_file_exists || !strcmp(libretro_path, "")) - find_and_set_first_file(); + find_and_set_first_file("SELF"); else RARCH_LOG("Start [%s] found in retroarch.cfg.\n", libretro_path); diff --git a/frontend/platform/platform_xdk.c b/frontend/platform/platform_xdk.c index ae0a3a564c..0048dc9434 100644 --- a/frontend/platform/platform_xdk.c +++ b/frontend/platform/platform_xdk.c @@ -30,27 +30,18 @@ #ifdef IS_SALAMANDER char libretro_path[512]; -static void find_and_set_first_file(void) +static void find_and_set_first_file(const char *ext) { //Last fallback - we'll need to start the first executable file // we can find in the RetroArch cores directory - char first_file[PATH_MAX]; + char first_file[PATH_MAX] = {0}; find_first_libretro_core(first_file, sizeof(first_file), -#if defined(_XBOX360) - "game:", "xex" -#elif defined(_XBOX1) - "D:", "xbe" -#endif -); + default_paths.core_dir, ext); if(first_file) { -#ifdef _XBOX1 fill_pathname_join(libretro_path, default_paths.core_dir, first_file, sizeof(libretro_path)); -#else - strlcpy(libretro_path, first_file, sizeof(libretro_path)); -#endif RARCH_LOG("libretro_path now set to: %s.\n", libretro_path); } else @@ -77,7 +68,11 @@ static void frontend_xdk_salamander_init(void) if(!config_file_exists || !strcmp(libretro_path, "")) { - find_and_set_first_file(); +#if defined(_XBOX360) + find_and_set_first_file("xex"); +#elif defined(_XBOX1) + find_and_set_first_file("xbe"); +#endif } else {