From ded204ce197277af814ac4e84cec17c378f7130c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 29 Apr 2013 15:19:16 +0200 Subject: [PATCH] (PS3) Load Game History works on PS3 - Multiman will from now on have to supply its own SELF path to argv[2] in order to work --- frontend/platform/platform_ps3.c | 14 ++++++-------- frontend/platform/platform_ps3_exec.c | 15 +++++++++------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/frontend/platform/platform_ps3.c b/frontend/platform/platform_ps3.c index 65006f77ef..1b6c0a0410 100644 --- a/frontend/platform/platform_ps3.c +++ b/frontend/platform/platform_ps3.c @@ -200,7 +200,8 @@ static void get_environment_settings(int argc, char *argv[]) #ifdef HAVE_MULTIMAN /* not launched from external launcher, set default path */ - if(path_file_exists(MULTIMAN_SELF_FILE) && argc > 1 && path_file_exists(argv[1])) + // second param is multiMAN SELF file + if(path_file_exists(argv[2]) && argc > 1 && (strcmp(argv[2], EMULATOR_CONTENT_DIR) == 0)) { g_extern.lifecycle_mode_state |= (1ULL << MODE_EXTLAUNCH_MULTIMAN); RARCH_LOG("Started from multiMAN, auto-game start enabled.\n"); @@ -341,17 +342,14 @@ static void system_init(void) static int system_process_args(int argc, char *argv[]) { - int ret = 0; -#ifdef HAVE_MULTIMAN - if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXTLAUNCH_MULTIMAN)) + if (argc > 1) { - RARCH_LOG("Started from multiMAN, will auto-start game.\n"); + RARCH_LOG("Auto-start game %s.\n", argv[1]); strlcpy(g_extern.fullpath, argv[1], sizeof(g_extern.fullpath)); - ret = 1; + return 1; } -#endif - return ret; + return 0; } static void system_deinit(void) diff --git a/frontend/platform/platform_ps3_exec.c b/frontend/platform/platform_ps3_exec.c index 8939770f66..c59d402b5d 100644 --- a/frontend/platform/platform_ps3_exec.c +++ b/frontend/platform/platform_ps3_exec.c @@ -31,16 +31,19 @@ static void rarch_console_exec(const char *path, bool should_load_game) RARCH_LOG("Attempt to load executable: [%s].\n", path); char spawn_data[256]; + char game_path[256]; for(unsigned int i = 0; i < sizeof(spawn_data); ++i) spawn_data[i] = i & 0xff; - char spawn_data_size[16]; - snprintf(spawn_data_size, sizeof(spawn_data_size), "%d", 256); +#ifndef IS_SALAMANDER + if (should_load_game) + strlcpy(game_path, g_extern.fullpath, sizeof(game_path)); +#endif const char * const spawn_argv[] = { - spawn_data_size, - "test argv for", - "sceNpDrmProcessExitSpawn2()", +#ifndef IS_SALAMANDER + game_path, +#endif NULL }; @@ -50,7 +53,7 @@ static void rarch_console_exec(const char *path, bool should_load_game) if(ret < 0) { RARCH_WARN("SELF file is not of NPDRM type, trying another approach to boot it...\n"); - sys_game_process_exitspawn(path, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); + sys_game_process_exitspawn(path, (const char** const)spawn_argv, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } sceNpTerm();