From 925739958978e1e192e1bc2d9899d5b104b44a82 Mon Sep 17 00:00:00 2001 From: red-prig Date: Fri, 1 Mar 2024 21:54:40 +0300 Subject: [PATCH] + --- kernel/ps4_scesocket.pas | 3 ++- src/np/ps4_libscenpmanager.pas | 2 +- src/np/ps4_libscenptus.pas | 35 +++++++++++++---------------- src/ps4_libscegamelivestreaming.pas | 5 ++++- src/ps4_libscenet.pas | 5 +++-- src/ps4_libsceult.pas | 23 ++++++++++--------- 6 files changed, 38 insertions(+), 35 deletions(-) diff --git a/kernel/ps4_scesocket.pas b/kernel/ps4_scesocket.pas index 3ff8b589..d669953d 100644 --- a/kernel/ps4_scesocket.pas +++ b/kernel/ps4_scesocket.pas @@ -161,7 +161,8 @@ function ps4_connect(s:SceNetId; const addr:pSceNetSockaddr; addrlen:SceNetSocklen_t):Integer; SysV_ABI_CDecl; begin - Result:=0; + sleep(200); + Result:=_set_errno(ECONNREFUSED); end; end. diff --git a/src/np/ps4_libscenpmanager.pas b/src/np/ps4_libscenpmanager.pas index 4d3703ff..04d8081c 100644 --- a/src/np/ps4_libscenpmanager.pas +++ b/src/np/ps4_libscenpmanager.pas @@ -546,7 +546,7 @@ function ps4_sceNpCheckCallbackForLib():Integer; SysV_ABI_CDecl; Result:=0; end; -function ps4_sceNpGetAccountDateOfBirth(userId:SceUserServiceUserId; +function ps4_sceNpGetAccountDateOfBirth(pOnlineId:pSceNpOnlineId; pDateOfBirth:PSceNpDate):Integer; SysV_ABI_CDecl; begin if pDateOfBirth=nil then diff --git a/src/np/ps4_libscenptus.pas b/src/np/ps4_libscenptus.pas index 727cfad2..a8d3c430 100644 --- a/src/np/ps4_libscenptus.pas +++ b/src/np/ps4_libscenptus.pas @@ -20,19 +20,14 @@ interface pSceNpTusDataStatus=^SceNpTusDataStatus; SceNpTusDataStatus=packed record - ownerId :SceNpOnlineId; - reserved1 :array[0..15] of Byte; - hasData :Integer; - lastChangedDate :QWORD; //SceRtcTick - lastChangedAuthorId :SceNpOnlineId; - reserved2 :array[0..15] of Byte; - pad :array[0..3] of Byte; - data :Pointer; - dataSize :QWORD; - info :SceNpTusDataInfo; - ownerAccountId :SceNpAccountId; - lastChangedAuthorAccountId:SceNpAccountId; - reserved :array[0..15] of Byte; + ownerId :SceNpId; + hasData :Integer; + lastChangedDate :QWORD; //SceRtcTick + lastChangedAuthorId:SceNpId; + pad :array[0..3] of Byte; + data :Pointer; + dataSize :QWORD; + info :SceNpTusDataInfo; end; pSceNpTusDataStatusA=^SceNpTusDataStatusA; @@ -85,13 +80,13 @@ function ps4_sceNpTusCreateNpTitleCtxA(serviceLabel:DWord;selfId:Integer):Intege end; function ps4_sceNpTusGetData(reqId:Integer; - targetAccountId:SceNpAccountId; - slotId:DWORD; - dataStatus:pSceNpTusDataStatus; - dataStatusSize:QWORD; - data:Pointer; - recvSize:QWORD; - option:Pointer):Integer; SysV_ABI_CDecl; + targetNpId:pSceNpId; + slotId:DWORD; + dataStatus:pSceNpTusDataStatus; + dataStatusSize:QWORD; + data:Pointer; + recvSize:QWORD; + option:Pointer):Integer; SysV_ABI_CDecl; begin Result:=0; end; diff --git a/src/ps4_libscegamelivestreaming.pas b/src/ps4_libscegamelivestreaming.pas index 93d3a220..2bd6c24f 100644 --- a/src/ps4_libscegamelivestreaming.pas +++ b/src/ps4_libscegamelivestreaming.pas @@ -74,7 +74,10 @@ interface pSceGameLiveStreamingPresetSocialFeedback=^SceGameLiveStreamingPresetSocialFeedback; SceGameLiveStreamingPresetSocialFeedback=packed record commandId :DWORD; - commandText:array[0..SCE_GAME_LIVE_STREAMING_MAX_SOCIAL_FEEDBACK_PRESET_TEXT_LENGTH,0..MB_LEN_MAX-1] of char; + 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; diff --git a/src/ps4_libscenet.pas b/src/ps4_libscenet.pas index 249a7610..a7bff14b 100644 --- a/src/ps4_libscenet.pas +++ b/src/ps4_libscenet.pas @@ -18,7 +18,7 @@ interface SCE_NET_ENOSPC =28; SCE_NET_EWOULDBLOCK =35; SCE_NET_EAFNOSUPPORT=47; - + SCE_NET_ECONNREFUSED=61; SCE_NET_EHOSTUNREACH=65; // @@ -452,7 +452,8 @@ function ps4_sceNetResolverDestroy(rid:Integer):Integer; SysV_ABI_CDecl; 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; diff --git a/src/ps4_libsceult.pas b/src/ps4_libsceult.pas index c7f8bc48..0606f01b 100644 --- a/src/ps4_libsceult.pas +++ b/src/ps4_libsceult.pas @@ -23,15 +23,16 @@ implementation {$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; @@ -548,7 +549,7 @@ function ps4_sceUltWaitingQueueResourcePoolDestroy(pool:PSceUltWaitingQueueResou if (pool=nil) then Exit(SCE_ULT_ERROR_NULL); Writeln(SysLogPrefix,'sceUltWaitingQueueResourcePoolDestroy'); - Result:=0; // TODO: Not used by current implementation of this lib. + Result:=0; // TODO: There is no actual destructor end; // @@ -675,6 +676,8 @@ 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;