libSceNpWebApi2 functions + getsockname + SceVoiceSetMuteFlag + SceAudio3dBedWrite (#189)

* libSceNpWebApi2 functions

* getsockname

* sceVoiceSetMuteFlag

* sceAudio3dBedWrite

* +

---------

Co-authored-by: red-prig <vdpasha@mail.ru>
This commit is contained in:
Ordinary205 2024-02-07 21:16:27 +04:00 committed by GitHub
parent 7c7c04a90f
commit 16778c491e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 146 additions and 39 deletions

View File

@ -1985,6 +1985,7 @@ begin
lib^.set_proc($4D4BA2612DA413CB,@ps4_shutdown);
lib^.set_proc($DDEFB822FEC827C5,@ps4_accept);
lib^.set_proc($A01AF7D773E9A4D1,@ps4_sendto);
lib^.set_proc($45E9C8D652F55859,@ps4_getsockname);
//socket

View File

@ -14,8 +14,7 @@ type
pSceNetId=^SceNetId;
SceNetId=Integer;
function ps4_socket(const name:PChar;
family,_type,protocol:Integer):Integer; SysV_ABI_CDecl;
function ps4_socket(family,_type,protocol:Integer):Integer; SysV_ABI_CDecl;
function ps4_bind(s:SceNetId;
const addr:pSceNetSockaddr;
@ -26,7 +25,12 @@ function ps4_setsockopt(s:SceNetId;
const optval:Pointer;
optlen:SceNetSocklen_t):Integer; SysV_ABI_CDecl;
function ps4_select():Integer; SysV_ABI_CDecl;
function ps4_select(s:SceNetId;
readfds :Pointer;
writefds :Pointer;
exceptfds:Pointer;
timeout :Pointer
):Integer; SysV_ABI_CDecl;
function ps4_recvfrom(s:SceNetId;
buf:Pointer;
@ -48,12 +52,15 @@ function ps4_sendto(s:SceNetId;
len:QWORD;
flags:Integer;
const addr:pSceNetSockaddr;
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
function ps4_getsockname(s:SceNetId;
addr:pSceNetSockaddr;
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
implementation
function ps4_socket(const name:PChar;
family,_type,protocol:Integer):Integer; SysV_ABI_CDecl;
function ps4_socket(family,_type,protocol:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
@ -73,7 +80,12 @@ begin
Result:=0;
end;
function ps4_select():Integer; SysV_ABI_CDecl;
function ps4_select(s:SceNetId;
readfds :Pointer;
writefds :Pointer;
exceptfds:Pointer;
timeout :Pointer
):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
@ -115,5 +127,20 @@ begin
Result:=0;
end;
function ps4_getsockname(s:SceNetId;
addr:pSceNetSockaddr;
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
begin
Result:=0;
if (addr<>nil) then
begin
addr^:=default_addr;
end;
if (paddrlen<>nil) then
begin
paddrlen^:=SizeOf(SceNetSockaddr);
end;
end;
end.

View File

@ -8,6 +8,10 @@ uses
ps4_program;
const
//SceAudio3dFormat
SCE_AUDIO3D_FORMAT_S16 =0;
SCE_AUDIO3D_FORMAT_FLOAT=1;
//SceAudio3dRate
SCE_AUDIO3D_RATE_48000=0;
@ -21,6 +25,9 @@ const
SCE_AUDIO3D_BLOCKING_SYNC =1;
type
pSceAudio3dFormat=^SceAudio3dFormat;
SceAudio3dFormat=Integer;
pSceAudio3dAttributeId=^SceAudio3dAttributeId;
SceAudio3dAttributeId=DWORD;
@ -137,6 +144,15 @@ begin
Result:=0;
end;
function ps4_sceAudio3dBedWrite(uiPortId:SceAudio3dPortId;
uiNumChannels:Integer;
eFormat:SceAudio3dFormat;
const pBuffer:Pointer;
_uiNumChannels:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function Load_libSceAudio3d(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
@ -155,6 +171,7 @@ begin
lib^.set_proc($54456167DA9DE196,@ps4_sceAudio3dPortPush);
lib^.set_proc($B9C12C8BADACA13A,@ps4_sceAudio3dAudioOutOpen);
lib^.set_proc($61A6836C3C0AA453,@ps4_sceAudio3dPortGetQueueLevel);
lib^.set_proc($F6D130134195D2AA,@ps4_sceAudio3dBedWrite);
end;
initialization

View File

@ -79,26 +79,6 @@ begin
Result:=0;
end;
//
function ps4_sceNpWebApi2Initialize(libHttp2CtxId:Integer;
poolSize:size_t):Integer; SysV_ABI_CDecl;
begin
Writeln('sceNpWebApi2Initialize:',libHttp2CtxId,':',poolSize);
Result:=4;
end;
function ps4_sceNpWebApi2CreateUserContext(libCtxId,m_userId:Integer):Integer; SysV_ABI_CDecl;
begin
Writeln('sceNpWebApi2CreateUserContext:',libCtxId,':',m_userId);
Result:=5;
end;
function ps4_sceNpWebApi2PushEventDeletePushContext(param_1:Integer;param_2:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpWebApiSendRequest(requestId:Int64;
pData:Pointer;
dataSize:size_t):Integer; SysV_ABI_CDecl;
@ -273,6 +253,80 @@ begin
Result:=0;
end;
//NpWebApi2
type
pSceNpWebApi2ContentParameter=^SceNpWebApi2ContentParameter;
SceNpWebApi2ContentParameter=packed record
contentLength:QWORD;
pContentType :Pchar;
reserved :array[0..15] of Byte;
end;
pSceNpWebApi2ResponseInformationOption=^SceNpWebApi2ResponseInformationOption;
SceNpWebApi2ResponseInformationOption=packed record
httpStatus :Integer;
_align :Integer;
pErrorObject :Pchar;
errorObjectSize :QWORD;
responseDataSize:QWORD;
end;
const
SCE_NP_WEBAPI2_PUSH_EVENT_UUID_LENGTH=36;
type
pSceNpWebApi2PushEventPushContextId=^SceNpWebApi2PushEventPushContextId;
SceNpWebApi2PushEventPushContextId=packed record
uuid:array[0..SCE_NP_WEBAPI2_PUSH_EVENT_UUID_LENGTH] of Char;
end;
function ps4_sceNpWebApi2Initialize(libHttp2CtxId:Integer;
poolSize:size_t):Integer; SysV_ABI_CDecl;
begin
Writeln('sceNpWebApi2Initialize:',libHttp2CtxId,':',poolSize);
Result:=4;
end;
function ps4_sceNpWebApi2CreateRequest(titleUserCtxId:Integer;
pApiGroup:Pchar;
pPath:Pchar;
method:PChar; //SceNpWebApi2HttpMethod
pContentParameter:pSceNpWebApi2ContentParameter;
pRequestId:pInt64):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpWebApi2SendRequest(requestId:Int64;
pData:Pointer;
dataSize:QWORD;
pRespInfoOption:pSceNpWebApi2ResponseInformationOption):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpWebApi2CreateUserContext(libCtxId,m_userId:Integer):Integer; SysV_ABI_CDecl;
begin
Writeln('sceNpWebApi2CreateUserContext:',libCtxId,':',m_userId);
Result:=5;
end;
function ps4_sceNpWebApi2PushEventDeletePushContext(userCtxId:Integer;
pPushCtxId:pSceNpWebApi2PushEventPushContextId):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpWebApi2AddHttpRequestHeader(requestId:Integer;
const pFieldName:PChar;
const pValue:PChar):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
//NpWebApi2
function Load_libSceNpWebApi(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
@ -315,9 +369,12 @@ begin
lib:=Result._add_lib('libSceNpWebApi2');
lib^.set_proc($FA8F7CD7A61086A4,@ps4_sceNpWebApi2Initialize );
lib^.set_proc($FA8F7CD7A61086A4,@ps4_sceNpWebApi2Initialize);
lib^.set_proc($DC423F39227AE577,@ps4_sceNpWebApi2CreateRequest);
lib^.set_proc($95038217CE25BF3C,@ps4_sceNpWebApi2SendRequest);
lib^.set_proc($B24E786E2E85B583,@ps4_sceNpWebApi2CreateUserContext);
lib^.set_proc($41A7F179933758AE,@ps4_sceNpWebApi2PushEventDeletePushContext);
lib^.set_proc($7A038EBEB9C5EA62,@ps4_sceNpWebApi2AddHttpRequestHeader);
end;
initialization

View File

@ -11,6 +11,9 @@ uses
SysUtils;
const
AF_INET = 2;
AF_INET6=28;
SCE_NET_EINVAL =22;
SCE_NET_ENOSPC =28;
SCE_NET_EAFNOSUPPORT=47;
@ -65,6 +68,13 @@ type
data:SceNetEpollData;
end;
const
default_addr:SceNetSockaddr=(
sa_len :SizeOf(SceNetSockaddr);
sa_family:AF_INET;
sa_data :(80,0,1,1,1,1,0,0,0,0,0,0,0,0);
);
implementation
uses
@ -130,10 +140,6 @@ begin
Result:=3;
end;
const
AF_INET = 2;
AF_INET6=28;
function ps4_sceNetInetPton(af:Integer;
src:Pchar;
dst:Pointer):Integer; SysV_ABI_CDecl;
@ -281,13 +287,6 @@ begin
Result:=0;
end;
const
default_addr:SceNetSockaddr=(
sa_len :SizeOf(SceNetSockaddr);
sa_family:AF_INET;
sa_data :(80,0,1,1,1,1,0,0,0,0,0,0,0,0);
);
function ps4_sceNetAccept(s:Integer;
addr:pSceNetSockaddr;
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;

View File

@ -109,6 +109,11 @@ begin
Result:=0;
end;
function ps4_sceVoiceSetMuteFlag(portId:DWORD;bMuted:Boolean):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function Load_libSceVoice(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
@ -125,6 +130,7 @@ begin
lib^.set_proc($0AB2EA0F058BA173,@ps4_sceVoiceGetPortInfo);
lib^.set_proc($710E831AC4048D5E,@ps4_sceVoiceReadFromOPort);
lib^.set_proc($4011680088C9A174,@ps4_sceVoiceSetVolume);
lib^.set_proc($8305329E41203456,@ps4_sceVoiceSetMuteFlag);
end;
function Load_libSceVoiceQoS(Const name:RawByteString):TElf_node;