engine: platform: psvita: implemented function for getting PSID

This commit is contained in:
SNMetamorph
2025-03-07 00:40:27 +04:00
committed by Alibek Omarov
parent 407d0aa291
commit 17ff80d85d

View File

@@ -14,6 +14,7 @@ GNU General Public License for more details.
*/
#include "platform/platform.h"
#include "xash3d_mathlib.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -201,3 +202,19 @@ qboolean PSVita_GetBasePath( char *buf, const size_t buflen )
return false;
}
int PSVita_GetPSID( char *buf, const size_t buflen )
{
SceKernelOpenPsId id;
const int datasize = Q_min( buflen, sizeof( id ));
if( sceKernelGetOpenPsId( &id ) < 0 )
{
return 0;
}
else
{
memcpy( buf, &id.id[0], datasize );
return datasize;
}
}