void rarch_exec (void) { if(g_console.return_to_launcher) { RARCH_LOG("Attempt to load executable: [%s].\n", g_console.launch_app_on_exit); #if defined(_XBOX) XLaunchNewImage(g_console.launch_app_on_exit, NULL); #elif defined(__CELLOS_LV2__) char spawn_data[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); const char * const spawn_argv[] = { spawn_data_size, "test argv for", "sceNpDrmProcessExitSpawn2()", NULL }; SceNpDrmKey * k_licensee = NULL; int ret = sceNpDrmProcessExitSpawn2(k_licensee, g_console.launch_app_on_exit, (const char** const)spawn_argv, NULL, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); if(ret < 0) { RARCH_WARN("SELF file is not of NPDRM type, trying another approach to boot it...\n"); sys_game_process_exitspawn(g_console.launch_app_on_exit, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } sceNpTerm(); cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP); cellSysmoduleUnloadModule(CELL_SYSMODULE_NET); #endif } }
s32 sceNpDrmProcessExitSpawn(vm::cptr<char> path, u32 argv_addr, u32 envp_addr, u32 data_addr, u32 data_size, u32 prio, u64 flags) { sceNp.Warning("sceNpDrmProcessExitSpawn() -> sys_game_process_exitspawn"); sys_game_process_exitspawn(path, argv_addr, envp_addr, data_addr, data_size, prio, flags); return CELL_OK; }
void input(void) { InputFrameStart(); if(((nFrame + nSelInputFrame) - nFrame) == 5) { // DPAD UP / LEFT ANALOG UP if((mIsButtPressed[BT_UP] && buttPressedNow[BT_UP]) || (mValLStickY < 50)) { if(main_menu->nSelectedItem > 0 && main_menu->nSelectedItem <= main_menu->nTotalItem) { main_menu->nSelectedItem--; } } // DPAD DOWN / LEFT ANALOG DOWN if ( (mIsButtPressed[BT_DOWN] && buttPressedNow[BT_DOWN]) || (mValLStickY > 200) ) { if(main_menu->nSelectedItem >= 0 && main_menu->nSelectedItem < main_menu->nTotalItem-1) { main_menu->nSelectedItem++; } } nSelInputFrame = 0; } nSelInputFrame++; // ------------------------------------------------------ // if(!mIsButtPressed[BT_TRIANGLE] && buttPressedNow[BT_TRIANGLE]) { // Rescan ISOs sys_game_process_exitspawn((char*)ISOLIST_SELF, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } if(!mIsButtPressed[BT_CROSS] && buttPressedNow[BT_CROSS]) { if(main_menu->nTotalItem >= 1) { int nType = -1; if(strstr(main_menu->item[main_menu->nSelectedItem]->szData_1, "PS3ISO")) nType = ISO_TYPE_PS3; if(strstr(main_menu->item[main_menu->nSelectedItem]->szData_1, "PSXISO")) nType = ISO_TYPE_PSX; if(strstr(main_menu->item[main_menu->nSelectedItem]->szData_1, "DVDISO")) nType = ISO_TYPE_DVD; if(strstr(main_menu->item[main_menu->nSelectedItem]->szData_1, "BDISO")) nType = ISO_TYPE_BD; if(nType != -1) { mount_ntfs_iso(main_menu->item[main_menu->nSelectedItem]->szData_1, nType); } } } InputFrameEnd(); }
void mount_ntfs_iso(char* szGamePath, int nType) { char szType[][8] = { {"EMU_PS3"},{"EMU_PSX"},{"EMU_BD"},{"EMU_DVD"} }; char *argv[3]; argv[0] = (char*)malloc(strlen(szGamePath)+1); memset(argv[0], 0, strlen(szGamePath)+1); strcpy(argv[0], szGamePath); argv[1] = (char*)malloc(8); strcpy(argv[1], szType[nType]); argv[2] = NULL; sys_game_process_exitspawn(ntfs_ext_iso_self_path, (const char**) argv, NULL, NULL, 0, 1001, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); }
static void system_exec(const char *path, bool should_load_game) { (void)should_load_game; RARCH_LOG("Attempt to load executable: [%s].\n", path); char spawn_data[256]; #ifndef IS_SALAMANDER char game_path[256]; game_path[0] = '\0'; #endif for(unsigned int i = 0; i < sizeof(spawn_data); ++i) spawn_data[i] = i & 0xff; #ifndef IS_SALAMANDER if (should_load_game) strlcpy(game_path, g_extern.fullpath, sizeof(game_path)); #endif const char * const spawn_argv[] = { #ifndef IS_SALAMANDER game_path, #endif NULL }; SceNpDrmKey * k_licensee = NULL; int ret = sceNpDrmProcessExitSpawn2(k_licensee, path, (const char** const)spawn_argv, NULL, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); if(ret < 0) { RARCH_WARN("SELF file is not of NPDRM type, trying another approach to boot it...\n"); sys_game_process_exitspawn(path, (const char** const)spawn_argv, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } sceNpTerm(); sys_net_finalize_network(); cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP); cellSysmoduleUnloadModule(CELL_SYSMODULE_NET); }
static int frontend_ps3_exec_exitspawn(const char *path, char const *argv[], char const *envp[]) { int ret; unsigned i; char spawn_data[256]; SceNpDrmKey *license_data = NULL; for(i = 0; i < sizeof(spawn_data); ++i) spawn_data[i] = i & 0xff; ret = sceNpDrmProcessExitSpawn(license_data, path, (const char** const)argv, envp, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); if(ret < 0) { RARCH_WARN("SELF file is not of NPDRM type, trying another approach to boot it...\n"); sys_game_process_exitspawn(path, (const char** const)argv, envp, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } return ret; }
static void frontend_ps3_exec(const char *path, bool should_load_game) { (void)should_load_game; char spawn_data[256]; #ifndef IS_SALAMANDER global_t *global = global_get_ptr(); bool original_verbose = global->verbosity; global->verbosity = true; char game_path[256]; game_path[0] = '\0'; #endif RARCH_LOG("Attempt to load executable: [%s].\n", path); for(unsigned int i = 0; i < sizeof(spawn_data); ++i) spawn_data[i] = i & 0xff; SceNpDrmKey * k_licensee = NULL; int ret; #ifdef IS_SALAMANDER const char * const spawn_argv[] = { NULL}; ret = sceNpDrmProcessExitSpawn2(k_licensee, path, (const char** const)spawn_argv, NULL, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); if(ret < 0) { RARCH_WARN("SELF file is not of NPDRM type, trying another approach to boot it...\n"); sys_game_process_exitspawn(path, (const char** const)spawn_argv, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } #else if (should_load_game && global->fullpath[0] != '\0') { strlcpy(game_path, global->fullpath, sizeof(game_path)); const char * const spawn_argv[] = { game_path, NULL }; ret = sceNpDrmProcessExitSpawn2(k_licensee, path, (const char** const)spawn_argv, NULL, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); if(ret < 0) { RARCH_WARN("SELF file is not of NPDRM type, trying another approach to boot it...\n"); sys_game_process_exitspawn(path, (const char** const)spawn_argv, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } } else { const char * const spawn_argv[] = {NULL}; ret = sceNpDrmProcessExitSpawn2(k_licensee, path, (const char** const)spawn_argv, NULL, (sys_addr_t)spawn_data, 256, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); if(ret < 0) { RARCH_WARN("SELF file is not of NPDRM type, trying another approach to boot it...\n"); sys_game_process_exitspawn(path, (const char** const)spawn_argv, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } } #endif sceNpTerm(); sys_net_finalize_network(); cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP); cellSysmoduleUnloadModule(CELL_SYSMODULE_NET); #ifndef IS_SALAMANDER global->verbosity = original_verbose; #endif }
void ExitDlgCallbackFunction(int buttonType, void *userData) { int nDialog = (int)userData; switch( buttonType ) { case CELL_MSGDIALOG_BUTTON_YES: { if(nDialog == STATUS_ROMSCAN_DLG) { cellMsgDialogAbort(); iniWrite(); // save settings // delete old cache cellFsUnlink("/dev_hdd0/game/FBAL00123/USRDIR/FBA.GAMELIST.CACHE.DAT"); fbaRL->RefreshGameList(); // Refresh gamelist break; } if(nDialog == STATUS_EXIT_MMAN) { cellMsgDialogAbort(); iniWrite(); // save settings app.onShutdown(); char path[] = "/dev_hdd0/game/BLES80608/USRDIR/RELOAD.SELF"; if(fbaRL->FileExist(path)) { sys_game_process_exitspawn(path, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } fbaRL->EndMainMenu(); break; } if(nDialog == STATUS_EXIT_IMANAGER) { cellMsgDialogAbort(); iniWrite(); // save settings app.onShutdown(); char path[] = "/dev_hdd0/game/IMANAGER4/USRDIR/iris_manager.self"; if(fbaRL->FileExist(path)) { sys_game_process_exitspawn(path, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } fbaRL->EndMainMenu(); break; } if(nDialog == STATUS_EXIT_FBARL_RA) { cellMsgDialogAbort(); iniWrite(); // save settings app.onShutdown(); char fba_rl_path[] = "/dev_hdd0/game/FBAL00123/USRDIR/RELOAD.SELF"; char rom_path[] = "DUMMY_ARG"; char preset_cfg[] = "DUMMY_ARG"; char aspect_ratio[] = "DUMMY_ARG"; if(fbaRL->FileExist(fba_rl_path)) { fbaRL->LaunchFBACore( (char*)rom_path, (char*)fba_rl_path, (char*)preset_cfg, (char*)aspect_ratio, (char*)(g_opt_bUseAltMenuKeyCombo ? "yes" : "no") ); } fbaRL->EndMainMenu(); break; } if(nDialog == STATUS_EXIT) { cellMsgDialogAbort(); iniWrite(); // save settings app.onShutdown(); exit(0); fbaRL->EndMainMenu(); break; } break; } case CELL_MSGDIALOG_BUTTON_NO: case CELL_MSGDIALOG_BUTTON_ESCAPE: case CELL_MSGDIALOG_BUTTON_NONE: break; default: break; } }
int main(int argc, char* argv[]) { init_log(); (void)argc; (void)argv; // [cobralib] unmount iso / eject cobra_send_fake_disc_eject_event(); cobra_umount_disc_image(); // Check if isolist.self is launching this app... FILE* fp_flag = fopen("/dev_hdd0/game/SISO00123/USRDIR/isolist_finished", "r"); if(fp_flag) { // load normally... fclose(fp_flag); *&fp_flag = NULL; // remove the launch flag... cellFsUnlink("/dev_hdd0/game/SISO00123/USRDIR/isolist_finished"); } else { // generate ISO list... sys_game_process_exitspawn((char*)ISOLIST_SELF, NULL, NULL, NULL, 0, 1000, SYS_PROCESS_PRIMARY_STACK_SIZE_1M); } if(!LoadModules()) { // error... (void)exit_app(); return 0; } // setup sys callback if(cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL) != CELL_OK) { // error... (void)exit_app(); return 0; } InputInit(); if(InitPSGLVideo(device, context, screen_width, screen_height, render_width, render_height)) { // clear vid on startup (void)render(true); // init font if(!font_init(render_width, render_height)) { bRun = false; } // init app core modules, ftp, settings, etc... if(!init_core()) { bRun = false; } // loop while(bRun) { cellSysutilCheckCallback(); (void)input(); (void)render(false); } } else { // error msg here... } (void)exit_app(); return 0; }