mirror of
https://github.com/red-prig/fpPS4.git
synced 2024-11-27 00:20:36 +00:00
libSceNpWebApi2 functions + getsockname + SceVoiceSetMuteFlag + SceAudio3dBedWrite (#189)
* libSceNpWebApi2 functions * getsockname * sceVoiceSetMuteFlag * sceAudio3dBedWrite * + --------- Co-authored-by: red-prig <vdpasha@mail.ru>
This commit is contained in:
parent
7c7c04a90f
commit
16778c491e
@ -1985,6 +1985,7 @@ begin
|
|||||||
lib^.set_proc($4D4BA2612DA413CB,@ps4_shutdown);
|
lib^.set_proc($4D4BA2612DA413CB,@ps4_shutdown);
|
||||||
lib^.set_proc($DDEFB822FEC827C5,@ps4_accept);
|
lib^.set_proc($DDEFB822FEC827C5,@ps4_accept);
|
||||||
lib^.set_proc($A01AF7D773E9A4D1,@ps4_sendto);
|
lib^.set_proc($A01AF7D773E9A4D1,@ps4_sendto);
|
||||||
|
lib^.set_proc($45E9C8D652F55859,@ps4_getsockname);
|
||||||
|
|
||||||
//socket
|
//socket
|
||||||
|
|
||||||
|
@ -14,8 +14,7 @@ type
|
|||||||
pSceNetId=^SceNetId;
|
pSceNetId=^SceNetId;
|
||||||
SceNetId=Integer;
|
SceNetId=Integer;
|
||||||
|
|
||||||
function ps4_socket(const name:PChar;
|
function ps4_socket(family,_type,protocol:Integer):Integer; SysV_ABI_CDecl;
|
||||||
family,_type,protocol:Integer):Integer; SysV_ABI_CDecl;
|
|
||||||
|
|
||||||
function ps4_bind(s:SceNetId;
|
function ps4_bind(s:SceNetId;
|
||||||
const addr:pSceNetSockaddr;
|
const addr:pSceNetSockaddr;
|
||||||
@ -26,7 +25,12 @@ function ps4_setsockopt(s:SceNetId;
|
|||||||
const optval:Pointer;
|
const optval:Pointer;
|
||||||
optlen:SceNetSocklen_t):Integer; SysV_ABI_CDecl;
|
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;
|
function ps4_recvfrom(s:SceNetId;
|
||||||
buf:Pointer;
|
buf:Pointer;
|
||||||
@ -48,12 +52,15 @@ function ps4_sendto(s:SceNetId;
|
|||||||
len:QWORD;
|
len:QWORD;
|
||||||
flags:Integer;
|
flags:Integer;
|
||||||
const addr:pSceNetSockaddr;
|
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
|
implementation
|
||||||
|
|
||||||
function ps4_socket(const name:PChar;
|
function ps4_socket(family,_type,protocol:Integer):Integer; SysV_ABI_CDecl;
|
||||||
family,_type,protocol:Integer):Integer; SysV_ABI_CDecl;
|
|
||||||
begin
|
begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
@ -73,7 +80,12 @@ begin
|
|||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
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
|
begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
@ -115,5 +127,20 @@ begin
|
|||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
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.
|
end.
|
||||||
|
|
||||||
|
@ -8,6 +8,10 @@ uses
|
|||||||
ps4_program;
|
ps4_program;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
//SceAudio3dFormat
|
||||||
|
SCE_AUDIO3D_FORMAT_S16 =0;
|
||||||
|
SCE_AUDIO3D_FORMAT_FLOAT=1;
|
||||||
|
|
||||||
//SceAudio3dRate
|
//SceAudio3dRate
|
||||||
SCE_AUDIO3D_RATE_48000=0;
|
SCE_AUDIO3D_RATE_48000=0;
|
||||||
|
|
||||||
@ -21,6 +25,9 @@ const
|
|||||||
SCE_AUDIO3D_BLOCKING_SYNC =1;
|
SCE_AUDIO3D_BLOCKING_SYNC =1;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
pSceAudio3dFormat=^SceAudio3dFormat;
|
||||||
|
SceAudio3dFormat=Integer;
|
||||||
|
|
||||||
pSceAudio3dAttributeId=^SceAudio3dAttributeId;
|
pSceAudio3dAttributeId=^SceAudio3dAttributeId;
|
||||||
SceAudio3dAttributeId=DWORD;
|
SceAudio3dAttributeId=DWORD;
|
||||||
|
|
||||||
@ -137,6 +144,15 @@ begin
|
|||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
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;
|
function Load_libSceAudio3d(Const name:RawByteString):TElf_node;
|
||||||
var
|
var
|
||||||
lib:PLIBRARY;
|
lib:PLIBRARY;
|
||||||
@ -155,6 +171,7 @@ begin
|
|||||||
lib^.set_proc($54456167DA9DE196,@ps4_sceAudio3dPortPush);
|
lib^.set_proc($54456167DA9DE196,@ps4_sceAudio3dPortPush);
|
||||||
lib^.set_proc($B9C12C8BADACA13A,@ps4_sceAudio3dAudioOutOpen);
|
lib^.set_proc($B9C12C8BADACA13A,@ps4_sceAudio3dAudioOutOpen);
|
||||||
lib^.set_proc($61A6836C3C0AA453,@ps4_sceAudio3dPortGetQueueLevel);
|
lib^.set_proc($61A6836C3C0AA453,@ps4_sceAudio3dPortGetQueueLevel);
|
||||||
|
lib^.set_proc($F6D130134195D2AA,@ps4_sceAudio3dBedWrite);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -79,26 +79,6 @@ begin
|
|||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
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;
|
function ps4_sceNpWebApiSendRequest(requestId:Int64;
|
||||||
pData:Pointer;
|
pData:Pointer;
|
||||||
dataSize:size_t):Integer; SysV_ABI_CDecl;
|
dataSize:size_t):Integer; SysV_ABI_CDecl;
|
||||||
@ -273,6 +253,80 @@ begin
|
|||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
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;
|
function Load_libSceNpWebApi(Const name:RawByteString):TElf_node;
|
||||||
var
|
var
|
||||||
lib:PLIBRARY;
|
lib:PLIBRARY;
|
||||||
@ -315,9 +369,12 @@ begin
|
|||||||
|
|
||||||
lib:=Result._add_lib('libSceNpWebApi2');
|
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($B24E786E2E85B583,@ps4_sceNpWebApi2CreateUserContext);
|
||||||
lib^.set_proc($41A7F179933758AE,@ps4_sceNpWebApi2PushEventDeletePushContext);
|
lib^.set_proc($41A7F179933758AE,@ps4_sceNpWebApi2PushEventDeletePushContext);
|
||||||
|
lib^.set_proc($7A038EBEB9C5EA62,@ps4_sceNpWebApi2AddHttpRequestHeader);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -11,6 +11,9 @@ uses
|
|||||||
SysUtils;
|
SysUtils;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
AF_INET = 2;
|
||||||
|
AF_INET6=28;
|
||||||
|
|
||||||
SCE_NET_EINVAL =22;
|
SCE_NET_EINVAL =22;
|
||||||
SCE_NET_ENOSPC =28;
|
SCE_NET_ENOSPC =28;
|
||||||
SCE_NET_EAFNOSUPPORT=47;
|
SCE_NET_EAFNOSUPPORT=47;
|
||||||
@ -65,6 +68,13 @@ type
|
|||||||
data:SceNetEpollData;
|
data:SceNetEpollData;
|
||||||
end;
|
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
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -130,10 +140,6 @@ begin
|
|||||||
Result:=3;
|
Result:=3;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
|
||||||
AF_INET = 2;
|
|
||||||
AF_INET6=28;
|
|
||||||
|
|
||||||
function ps4_sceNetInetPton(af:Integer;
|
function ps4_sceNetInetPton(af:Integer;
|
||||||
src:Pchar;
|
src:Pchar;
|
||||||
dst:Pointer):Integer; SysV_ABI_CDecl;
|
dst:Pointer):Integer; SysV_ABI_CDecl;
|
||||||
@ -281,13 +287,6 @@ begin
|
|||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
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;
|
function ps4_sceNetAccept(s:Integer;
|
||||||
addr:pSceNetSockaddr;
|
addr:pSceNetSockaddr;
|
||||||
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
|
paddrlen:pSceNetSocklen_t):Integer; SysV_ABI_CDecl;
|
||||||
|
@ -109,6 +109,11 @@ begin
|
|||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function ps4_sceVoiceSetMuteFlag(portId:DWORD;bMuted:Boolean):Integer; SysV_ABI_CDecl;
|
||||||
|
begin
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
function Load_libSceVoice(Const name:RawByteString):TElf_node;
|
function Load_libSceVoice(Const name:RawByteString):TElf_node;
|
||||||
var
|
var
|
||||||
lib:PLIBRARY;
|
lib:PLIBRARY;
|
||||||
@ -125,6 +130,7 @@ begin
|
|||||||
lib^.set_proc($0AB2EA0F058BA173,@ps4_sceVoiceGetPortInfo);
|
lib^.set_proc($0AB2EA0F058BA173,@ps4_sceVoiceGetPortInfo);
|
||||||
lib^.set_proc($710E831AC4048D5E,@ps4_sceVoiceReadFromOPort);
|
lib^.set_proc($710E831AC4048D5E,@ps4_sceVoiceReadFromOPort);
|
||||||
lib^.set_proc($4011680088C9A174,@ps4_sceVoiceSetVolume);
|
lib^.set_proc($4011680088C9A174,@ps4_sceVoiceSetVolume);
|
||||||
|
lib^.set_proc($8305329E41203456,@ps4_sceVoiceSetMuteFlag);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Load_libSceVoiceQoS(Const name:RawByteString):TElf_node;
|
function Load_libSceVoiceQoS(Const name:RawByteString):TElf_node;
|
||||||
|
Loading…
Reference in New Issue
Block a user