Multiple Functions (#196)

* SceUltWaitingQueueResourcePoolDestroy + SceUltMutexDestroy

* SceNpProfileDialog library

* SceNpTusGetData

* SceGameLiveStreamingSetPresetSocialFeedbackCommands + SceGameLiveStreamingGetSocialFeedbackMessagesCount

* SceNpPartyRegisterHandlerA

* SceNpGetAccountDateOfBirthA

* connect

* +

---------

Co-authored-by: red-prig <vdpasha@mail.ru>
This commit is contained in:
Ordinary205 2024-03-01 23:02:18 +04:00 committed by GitHub
parent 79c2fef847
commit 34a6f77bb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 161 additions and 13 deletions

View File

@ -44,6 +44,7 @@ uses
ps4_libSceNpGameIntent,
ps4_libSceNpAuth,
ps4_libSceNpParty,
ps4_libSceNpProfileDialog,
ps4_libSceSaveData,
ps4_libSceDialogs,
ps4_libSceUserService,

View File

@ -1986,6 +1986,7 @@ begin
lib^.set_proc($DDEFB822FEC827C5,@ps4_accept);
lib^.set_proc($A01AF7D773E9A4D1,@ps4_sendto);
lib^.set_proc($45E9C8D652F55859,@ps4_getsockname);
lib^.set_proc($5D52FC4A8DD02549,@ps4_connect);
//socket

View File

@ -57,7 +57,11 @@ function ps4_sendto(s:SceNetId;
function ps4_getsockname(s:SceNetId;
addr:pSceNetSockaddr;
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
function ps4_connect(s:SceNetId;
const addr:pSceNetSockaddr;
addrlen:SceNetSocklen_t):Integer; SysV_ABI_CDecl;
implementation
@ -153,5 +157,13 @@ begin
end;
end;
function ps4_connect(s:SceNetId;
const addr:pSceNetSockaddr;
addrlen:SceNetSocklen_t):Integer; SysV_ABI_CDecl;
begin
sleep(200);
Result:=_set_errno(ECONNREFUSED);
end;
end.

View File

@ -546,7 +546,7 @@ begin
Result:=0;
end;
function ps4_sceNpGetAccountDateOfBirth(userId:SceUserServiceUserId;
function ps4_sceNpGetAccountDateOfBirth(pOnlineId:pSceNpOnlineId;
pDateOfBirth:PSceNpDate):Integer; SysV_ABI_CDecl;
begin
if pDateOfBirth=nil then
@ -557,6 +557,17 @@ begin
Result:=0;
end;
function ps4_sceNpGetAccountDateOfBirthA(userId:SceUserServiceUserId;
pDateOfBirth:PSceNpDate):Integer; SysV_ABI_CDecl;
begin
if pDateOfBirth=nil then
Exit(SCE_NP_ERROR_INVALID_ARGUMENT);
pDateOfBirth^.year :=1990;
pDateOfBirth^.month:=1;
pDateOfBirth^.day :=1;
Result:=0;
end;
function Load_libSceNpManager(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
@ -602,6 +613,7 @@ begin
lib^.set_proc($BAA70F24B58BD3C3,@ps4_sceNpPollAsync);
lib^.set_proc($337C055DB610B400,@ps4_sceNpUnregisterStateCallbackA);
lib^.set_proc($F150537917F56702,@ps4_sceNpGetAccountDateOfBirth);
lib^.set_proc($AB733B5F304A0B7B,@ps4_sceNpGetAccountDateOfBirthA);
lib^.set_proc($4CF31B808C6FA20D,@ps4_sceNpGetAccountLanguageA);
lib^.set_proc($1858555294666C71,@ps4_sceNpInGameMessageInitialize);

View File

@ -98,6 +98,11 @@ begin
Result:=0;
end;
function ps4_sceNpPartyRegisterHandlerA(const handlers:pSceNpPartyEventHandlers;userdata:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpPartyGetState(const state:pSceNpPartyState):Integer; SysV_ABI_CDecl;
begin
Result:=0;
@ -129,6 +134,7 @@ begin
lib:=Result._add_lib('libSceNpParty');
lib^.set_proc($9616024D098191DB,@ps4_sceNpPartyInitialize);
lib^.set_proc($900F3C81BBFBD5AA,@ps4_sceNpPartyRegisterHandler);
lib^.set_proc($FAFE1F5473301567,@ps4_sceNpPartyRegisterHandlerA);
lib^.set_proc($684CCA749CC04D9D,@ps4_sceNpPartyGetState);
lib^.set_proc($4F650E29FD3464DD,@ps4_sceNpPartyGetMembers);
lib^.set_proc($1753FEFF0A71428C,@ps4_sceNpPartyGetMemberInfo);

View File

@ -0,0 +1,34 @@
unit ps4_libSceNpProfileDialog;
{$mode ObjFPC}{$H+}
interface
uses
ps4_program,
Classes,
SysUtils;
implementation
function ps4_sceNpProfileDialogTerminate():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function Load_libSceNpProfileDialog(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
begin
Result:=TElf_node.Create;
Result.pFileName:=name;
lib:=Result._add_lib('libSceNpProfileDialog');
lib^.set_proc($D12A7DBC9701D7FC,@ps4_sceNpProfileDialogTerminate);
end;
initialization
ps4_app.RegistredPreLoad('libSceNpProfileDialog.prx',@Load_libSceNpProfileDialog);
end.

View File

@ -18,6 +18,18 @@ type
data :array[0..SCE_NP_TUS_DATA_INFO_MAX_SIZE-1] of Byte;
end;
pSceNpTusDataStatus=^SceNpTusDataStatus;
SceNpTusDataStatus=packed record
ownerId :SceNpId;
hasData :Integer;
lastChangedDate :QWORD; //SceRtcTick
lastChangedAuthorId:SceNpId;
pad :array[0..3] of Byte;
data :Pointer;
dataSize :QWORD;
info :SceNpTusDataInfo;
end;
pSceNpTusDataStatusA=^SceNpTusDataStatusA;
SceNpTusDataStatusA=packed record
ownerId :SceNpOnlineId;
@ -67,6 +79,18 @@ begin
Result:=-1;
end;
function ps4_sceNpTusGetData(reqId:Integer;
targetNpId:pSceNpId;
slotId:DWORD;
dataStatus:pSceNpTusDataStatus;
dataStatusSize:QWORD;
data:Pointer;
recvSize:QWORD;
option:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpTusGetDataA(reqId:Integer;
targetAccountId:SceNpAccountId;
slotId:DWORD;
@ -108,6 +132,7 @@ begin
lib^.set_proc($941B6B93EEE5935E,@ps4_sceNpTssCreateNpTitleCtxA);
lib^.set_proc($04890C9947CD2963,@ps4_sceNpTusCreateNpTitleCtx);
lib^.set_proc($D67FDD1AE9018276,@ps4_sceNpTusCreateNpTitleCtxA);
lib^.set_proc($5CECECCCEE0E3565,@ps4_sceNpTusGetData);
lib^.set_proc($C96107505918D6A2,@ps4_sceNpTusGetDataA);
lib^.set_proc($573C4DDED3A8BA3F,@ps4_sceNpTusSetDataA);
end;

View File

@ -8,6 +8,9 @@ uses
ps4_program;
const
SCE_GAME_LIVE_STREAMING_MAX_SOCIAL_FEEDBACK_PRESET_TEXT_LENGTH=32;
MB_LEN_MAX=2;
SCE_GAME_LIVE_STREAMING_ERROR_UNKNOWN =-2136997887; //0x80A00001
SCE_GAME_LIVE_STREAMING_ERROR_INVALID_PARAM =-2136997886; //0x80A00002
SCE_GAME_LIVE_STREAMING_ERROR_INVALID_STATUS =-2136997885; //0x80A00003
@ -33,6 +36,11 @@ const
SCE_GAME_LIVE_STREAMING_CAMERA_FRAME_POSITION_BOTTOM_LEFT =$03;
SCE_GAME_LIVE_STREAMING_CAMERA_FRAME_POSITION_BOTTOM_RIGHT=$04;
//SceGameLiveStreamingSocialFeedbackMessageType
SCE_GAME_LIVE_STREAMING_SOCIAL_FEEDBACK_MESSAGE_TYPE_MESSAGE=$01;
SCE_GAME_LIVE_STREAMING_SOCIAL_FEEDBACK_MESSAGE_TYPE_COMMAND=$02;
SCE_GAME_LIVE_STREAMING_SOCIAL_FEEDBACK_MESSAGE_TYPE_TEXT =$03;
type
pSceGameLiveStreamingStatus=^SceGameLiveStreamingStatus;
SceGameLiveStreamingStatus=packed record
@ -63,6 +71,19 @@ type
reserved:array[0..30] of Byte;
end;
pSceGameLiveStreamingPresetSocialFeedback=^SceGameLiveStreamingPresetSocialFeedback;
SceGameLiveStreamingPresetSocialFeedback=packed record
commandId :DWORD;
commandText:array[0..
(SCE_GAME_LIVE_STREAMING_MAX_SOCIAL_FEEDBACK_PRESET_TEXT_LENGTH*
MB_LEN_MAX+1)
-1] of char;
reserved :array[0..30] of Byte;
end;
pSceGameLiveStreamingSocialFeedbackMessageType=^SceGameLiveStreamingSocialFeedbackMessageType;
SceGameLiveStreamingSocialFeedbackMessageType=Integer;
implementation
function ps4_sceGameLiveStreamingInitialize(heapSize:qword):Integer; SysV_ABI_CDecl;
@ -134,6 +155,18 @@ begin
Result:=0;
end;
function ps4_sceGameLiveStreamingSetPresetSocialFeedbackCommands(const presetCounts:QWORD;
preset:pSceGameLiveStreamingPresetSocialFeedback):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceGameLiveStreamingGetSocialFeedbackMessagesCount(const _type:SceGameLiveStreamingSocialFeedbackMessageType;
count:PInteger):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function Load_libSceGameLiveStreaming(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
@ -153,6 +186,8 @@ begin
lib^.set_proc($DCF4A2C00CC52121,@ps4_sceGameLiveStreamingSetCameraFrameSetting);
lib^.set_proc($ABF931B9A17B5115,@ps4_sceGameLiveStreamingSetMaxBitrate);
lib^.set_proc($30BBD823CE85140A,@ps4_sceGameLiveStreamingSetStandbyScreenResource);
lib^.set_proc($C9CA1D88FD88D31A,@ps4_sceGameLiveStreamingSetPresetSocialFeedbackCommands);
lib^.set_proc($C9E40A8C71138B8D,@ps4_sceGameLiveStreamingGetSocialFeedbackMessagesCount);
end;
initialization

View File

@ -18,7 +18,7 @@ const
SCE_NET_ENOSPC =28;
SCE_NET_EWOULDBLOCK =35;
SCE_NET_EAFNOSUPPORT=47;
SCE_NET_ECONNREFUSED=61;
SCE_NET_EHOSTUNREACH=65;
//
@ -452,7 +452,8 @@ end;
function ps4_sceNetConnect(s:Integer; const addr:pSceNetSockaddr; addrlen:SceNetSocklen_t):Integer; SysV_ABI_CDecl;
begin
Result:=0;
sleep(200);
Result:=_set_net_errno(SCE_NET_ECONNREFUSED);
end;
function ps4_sceNetEpollWait(s:Integer; events:pSceNetEpollEvent; maxevents:Integer; timeout:Integer):Integer; SysV_ABI_CDecl;

View File

@ -23,15 +23,16 @@ uses
{$I sce_errno.inc}
const
SCE_ULT_ERROR_NULL =$80810001;
SCE_ULT_ERROR_ALIGNMENT =$80810002;
SCE_ULT_ERROR_RANGE =$80810003;
SCE_ULT_ERROR_INVALID =$80810004;
SCE_ULT_ERROR_PERMISSION =$80810005;
SCE_ULT_ERROR_STATE =$80810006;
SCE_ULT_ERROR_BUSY =$80810007;
SCE_ULT_ERROR_AGAIN =$80810008;
SCE_ULT_ERROR_NOT_INITIALIZE=$8081000A;
SCE_ULT_ERROR_NULL =Integer($80810001);
SCE_ULT_ERROR_ALIGNMENT =Integer($80810002);
SCE_ULT_ERROR_RANGE =Integer($80810003);
SCE_ULT_ERROR_INVALID =Integer($80810004);
SCE_ULT_ERROR_PERMISSION =Integer($80810005);
SCE_ULT_ERROR_STATE =Integer($80810006);
SCE_ULT_ERROR_BUSY =Integer($80810007);
SCE_ULT_ERROR_AGAIN =Integer($80810008);
SCE_ULT_ERROR_NOT_INITIALIZE=Integer($8081000A);
SCE_ULT_MAX_NAME_LENGTH =31;
ULT_STATE_INIT =0;
@ -543,6 +544,14 @@ begin
Result:=0; // TODO: Not used by current implementation of this lib.
end;
function ps4_sceUltWaitingQueueResourcePoolDestroy(pool:PSceUltWaitingQueueResourcePool):QWord; SysV_ABI_CDecl;
begin
if (pool=nil) then
Exit(SCE_ULT_ERROR_NULL);
Writeln(SysLogPrefix,'sceUltWaitingQueueResourcePoolDestroy');
Result:=0; // TODO: There is no actual destructor
end;
//
function ps4_sceUltQueueDataResourcePoolGetWorkAreaSize(numData:DWord;dataSize:QWord;numQueueObjects:DWord):Integer; SysV_ABI_CDecl;
@ -663,6 +672,16 @@ begin
Result:=0;
end;
function ps4_sceUltMutexDestroy(mutex:PSceUltMutex):Integer; SysV_ABI_CDecl;
begin
if (mutex=nil) then
Exit(SCE_ULT_ERROR_NULL);
ps4_pthread_mutex_destroy(mutex^.handle);
mutex^.handle:=nil;
//Writeln(SysLogPrefix,'sceUltMutexDestroy,mutex=',mutex^.name);
Result:=0;
end;
//
function ps4_sceUltSemaphoreCreate(semaphore :PSceUltSemaphore;
@ -753,6 +772,7 @@ begin
lib^.set_proc($588595D5077B3C55,@ps4_sceUltWaitingQueueResourcePoolGetWorkAreaSize);
lib^.set_proc($6221EE8CE1BDBD76,@ps4_sceUltWaitingQueueResourcePoolCreate);
lib^.set_proc($A2BE79E35EF07039,@ps4_sceUltWaitingQueueResourcePoolDestroy);
lib^.set_proc($7AF8FD60F912F2CE,@ps4_sceUltQueueDataResourcePoolGetWorkAreaSize);
lib^.set_proc($4C51E6EBF37ABE4B,@ps4_sceUltQueueDataResourcePoolCreate);
@ -765,6 +785,7 @@ begin
lib^.set_proc($F21106911D697EBF,@ps4_sceUltMutexLock);
lib^.set_proc($8745DE6CA88C06D9,@ps4_sceUltMutexUnlock);
lib^.set_proc($D7EF2DF5A1CB8B3F,@ps4_sceUltMutexOptParamInitialize);
lib^.set_proc($8D6F879DA7DE4B76,@ps4_sceUltMutexDestroy);
lib^.set_proc($8794252188FE468F,@ps4_sceUltSemaphoreCreate);
lib^.set_proc($1C0D4B75B8B794F6,@ps4_sceUltSemaphoreTryAcquire);