From 98bd071fd347b87183596d68d8cc23fa80cf7cd1 Mon Sep 17 00:00:00 2001 From: TwinAphex51224 Date: Sun, 26 Feb 2012 17:30:01 +0100 Subject: [PATCH] (PS3) Add non-NPDRM exitspawn fallback --- ps3/main.c | 6 ++++++ ps3/salamander/main.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ps3/main.c b/ps3/main.c index 3f48087f98..b1088a8c89 100644 --- a/ps3/main.c +++ b/ps3/main.c @@ -621,6 +621,12 @@ begin_shutdown: SceNpDrmKey * k_licensee = NULL; int ret = sceNpDrmProcessExitSpawn2(k_licensee, g_settings.libsnes, (const char** const)spawn_argv, NULL, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); SSNES_LOG("Attempt to load SELF: [%s] (return code: [%x]).\n", g_settings.libsnes, ret); + if(ret == SCE_NP_DRM_ERROR_FORMAT) + { + SSNES_LOG("SELF file is not of NPDRM type, trying another approach to boot it...\n"); + exitspawn(g_settings.libsnes, spawn_argv, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); + + } sceNpTerm(); cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP); cellSysmoduleUnloadModule(CELL_SYSMODULE_NET); diff --git a/ps3/salamander/main.c b/ps3/salamander/main.c index c64f6f4a12..ed1991871f 100644 --- a/ps3/salamander/main.c +++ b/ps3/salamander/main.c @@ -291,6 +291,14 @@ int main(int argc, char *argv[]) SceNpDrmKey * k_licensee = NULL; int ret = sceNpDrmProcessExitSpawn2(k_licensee, libsnes_path, (const char** const)spawn_argv, NULL, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); + if(ret == SCE_NP_DRM_ERROR_FORMAT) + { + SSNES_LOG("SELF file is not of NPDRM type, trying another approach to boot it...\n"); + char * launchargv[7]; + memset(launchargv, 0, sizeof(launchargv)); + exitspawn(libsnes_path, (char * const*)launchargv, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); + + } SSNES_LOG("Launch libsnes core: [%s] (return code: %x]).\n", libsnes_path, ret); sceNpTerm();