From 4242295f9302360762ad7b3a61b06976cd756b39 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 28 Jul 2012 18:55:40 +0200 Subject: [PATCH] (360)Include rarch_console_libretro_mgmt.c into Salamander solution and remove duplicate code in Salamander --- console/salamander/main.c | 50 +------------------ .../RetroArch-Salamander.vcxproj | 8 +++ .../RetroArch-Salamander.vcxproj.filters | 3 ++ 3 files changed, 12 insertions(+), 49 deletions(-) diff --git a/console/salamander/main.c b/console/salamander/main.c index 590612ce5c..d5b944ac19 100644 --- a/console/salamander/main.c +++ b/console/salamander/main.c @@ -44,6 +44,7 @@ #define PATH_MAX 512 #endif +#include "../rarch_console_libretro_mgmt.h" #include "../rarch_console_exec.h" #include "../../retroarch_logger.h" @@ -61,55 +62,6 @@ char LIBRETRO_DIR_PATH[PATH_MAX]; char SYS_CONFIG_FILE[PATH_MAX]; char libretro_path[PATH_MAX]; -static void rarch_manage_libretro_set_first_file(char *first_file, size_t size_of_first_file, const char *libretro_path, const char * exe_ext) -{ - //We need to set libretro to the first entry in the cores - //directory so that it will be saved to the config file - - struct string_list *dir_list = dir_list_new(libretro_path, exe_ext, false); - - const char * first_exe; - - if (!dir_list) - { - RARCH_ERR("Couldn't read directory.\n"); - RARCH_ERR("Failed to set first entry to libretro path.\n"); - goto end; - } - - first_exe = dir_list->elems[0].data; - - if(first_exe) - { -#ifdef _XBOX360 - char fname_tmp[PATH_MAX]; - fill_pathname_base(fname_tmp, first_exe, sizeof(fname_tmp)); - - if(strcmp(fname_tmp, "RetroArch-Salamander.xex") == 0) - { - RARCH_WARN("First entry is RetroArch Salamander itself, increment entry by one and check if it exists.\n"); - first_exe = dir_list->elems[1].data; - fill_pathname_base(fname_tmp, first_exe, sizeof(fname_tmp)); - - if(!first_exe) - { - RARCH_ERR("Unlikely error happened - no second entry - no choice but to set it to RetroArch Salamander\n"); - first_exe = dir_list->elems[0].data; - fill_pathname_base(fname_tmp, first_exe, sizeof(fname_tmp)); - } - } - - strlcpy(first_file, fname_tmp, size_of_first_file); -#else - strlcpy(first_file, first_exe, size_of_first_file); -#endif - RARCH_LOG("Set first entry in libretro core dir to libretro path: [%s].\n", first_file); - } - -end: - dir_list_free(dir_list); -} - static void find_and_set_first_file(void) { //Last fallback - we'll need to start the first executable file diff --git a/msvc/RetroArch-360-Salamander/RetroArch-Salamander.vcxproj b/msvc/RetroArch-360-Salamander/RetroArch-Salamander.vcxproj index c120a2878a..6d9777ee0f 100644 --- a/msvc/RetroArch-360-Salamander/RetroArch-Salamander.vcxproj +++ b/msvc/RetroArch-360-Salamander/RetroArch-Salamander.vcxproj @@ -264,6 +264,14 @@ CompileAsC CompileAsC + + CompileAsC + CompileAsC + CompileAsC + CompileAsC + CompileAsC + CompileAsC + CompileAsCpp CompileAsCpp diff --git a/msvc/RetroArch-360-Salamander/RetroArch-Salamander.vcxproj.filters b/msvc/RetroArch-360-Salamander/RetroArch-Salamander.vcxproj.filters index 5bde70630c..5f0c3cdeca 100644 --- a/msvc/RetroArch-360-Salamander/RetroArch-Salamander.vcxproj.filters +++ b/msvc/RetroArch-360-Salamander/RetroArch-Salamander.vcxproj.filters @@ -35,5 +35,8 @@ Source Files\console + + Source Files\console + \ No newline at end of file