(PS3) Add non-NPDRM exitspawn fallback

This commit is contained in:
TwinAphex51224 2012-02-26 17:30:01 +01:00
parent ac5fb991a2
commit 98bd071fd3
2 changed files with 14 additions and 0 deletions

View File

@ -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);

View File

@ -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();