From 1374226c6a7f9add20adb0683ac6e1ef19035872 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 4 Jun 2014 22:44:37 +0200 Subject: [PATCH] (PS3) Clean up Salamander implementation --- frontend/platform/platform_ps3.c | 70 +++++++++----------------------- 1 file changed, 20 insertions(+), 50 deletions(-) diff --git a/frontend/platform/platform_ps3.c b/frontend/platform/platform_ps3.c index 67b678c75f..ebee219d83 100644 --- a/frontend/platform/platform_ps3.c +++ b/frontend/platform/platform_ps3.c @@ -69,63 +69,33 @@ static void find_and_set_first_file(void) static void frontend_ps3_salamander_init(void) { - CellPadData pad_data; - cellPadInit(7); + //normal executable loading path + char tmp_str[PATH_MAX]; + bool config_file_exists = false; - cellPadGetData(0, &pad_data); + if (path_file_exists(default_paths.config_path)) + config_file_exists = true; - if(pad_data.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_TRIANGLE) + if (config_file_exists) { - //override path, boot first executable in cores directory - RARCH_LOG("Fallback - Will boot first executable in RetroArch cores/ directory.\n"); + config_file_t * conf = config_file_new(default_paths.config_path); + config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str)); + config_file_free(conf); + strlcpy(libretro_path, tmp_str, sizeof(libretro_path)); + } + + if (!config_file_exists || !strcmp(libretro_path, "")) find_and_set_first_file(); - } else + RARCH_LOG("Start [%s] found in retroarch.cfg.\n", libretro_path); + + if (!config_file_exists) { - //normal executable loading path - char tmp_str[PATH_MAX]; - bool config_file_exists = false; - - if (path_file_exists(default_paths.config_path)) - config_file_exists = true; - - //try to find CORE executable - char core_executable[1024]; - fill_pathname_join(core_executable, default_paths.core_dir, "CORE.SELF", sizeof(core_executable)); - - if(path_file_exists(core_executable)) - { - //Start CORE executable - strlcpy(libretro_path, core_executable, sizeof(libretro_path)); - RARCH_LOG("Start [%s].\n", libretro_path); - } - else - { - if (config_file_exists) - { - config_file_t * conf = config_file_new(default_paths.config_path); - config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str)); - config_file_free(conf); - strlcpy(libretro_path, tmp_str, sizeof(libretro_path)); - } - - if (!config_file_exists || !strcmp(libretro_path, "")) - find_and_set_first_file(); - else - RARCH_LOG("Start [%s] found in retroarch.cfg.\n", libretro_path); - - if (!config_file_exists) - { - config_file_t *new_conf = config_file_new(NULL); - config_set_string(new_conf, "libretro_path", libretro_path); - config_file_write(new_conf, default_paths.config_path); - config_file_free(new_conf); - } - } + config_file_t *new_conf = config_file_new(NULL); + config_set_string(new_conf, "libretro_path", libretro_path); + config_file_write(new_conf, default_paths.config_path); + config_file_free(new_conf); } - - cellPadEnd(); - } #endif