2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-24 02:40:41 +01:00

engine: psvita: implement Sys_NewInstance

This commit is contained in:
fgsfds 2023-02-26 00:59:07 +01:00 committed by Alibek Omarov
parent 610d528042
commit 287688d985

View File

@ -591,7 +591,20 @@ qboolean Sys_NewInstance( const char *gamedir )
envSetNextLoad( exe, newargs );
exit( 0 );
#elif XASH_PSVITA
fprintf( stderr, "Sys_NewInstance( %s ): not implemented yet\n", gamedir );
const char *exe = "app0:/eboot.bin";
char newgamedir[256];
char *newargv[4];
int newargc = 0;
// make a copy of the gamedir name just in case
Q_strncpy( newgamedir, gamedir, sizeof( newgamedir ) );
// TODO: carry over the old args
newargv[newargc++] = host.argv[0]; // this is not usually the executable path
newargv[newargc++] = (char *)"-game";
newargv[newargc++] = newgamedir;
newargv[newargc] = NULL;
// just restart the entire thing
Host_Shutdown( );
sceAppMgrLoadExec( exe, newargv, NULL );
exit( 0 );
#else
int i = 0;