Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
red-prig committed Dec 27, 2023
1 parent 35de089 commit 838a388
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 30 deletions.
40 changes: 26 additions & 14 deletions src/ps4_libscehmd.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ interface
ps4_program,
Classes,
SysUtils;
ps4_libSceUserService;

type
pSceUserServiceUserId=^SceUserServiceUserId;
SceUserServiceUserId=packed record
SceUserServiceUserId:Integer;
end;

pSceHmdOpenParam=^SceHmdOpenParam;
SceHmdOpenParam=packed record
reserve:array[0..7] of Byte;
end;
const
SCE_HMD_ERROR_PARAMETER_NULL=Integer($81110008);

type
pSceHmdOpenParam=^SceHmdOpenParam;
SceHmdOpenParam=packed record
reserve:array[0..7] of Byte;
end;

pSceHmdFieldOfView=^SceHmdFieldOfView;
SceHmdFieldOfView=packed record
tanOut :Single;
tanIn :Single;
tanTop :Single;
tanBottom:Single;
end;

implementation

Expand Down Expand Up @@ -89,18 +94,25 @@ function ps4_sceHmdReprojectionClearUserEventStart():Integer; SysV_ABI_CDecl;
Result:=0;
end;

function ps4_sceHmdReprojectionSetDisplayBuffers(videoOutHandle:Integer;index0:Integer;index1:Integer;option:Pointer):Integer; SysV_ABI_CDecl;
function ps4_sceHmdReprojectionSetDisplayBuffers(videoOutHandle,index0,index1:Integer;option:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceHmdOpen(userId:pSceUserServiceUserId;_type:Integer;index:Integer;pParam:pSceHmdOpenParam):Integer; SysV_ABI_CDecl;
function ps4_sceHmdOpen(userId,_type,index:Integer;pParam:pSceHmdOpenParam):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceHmdGetFieldOfView(handle:Integer;fieldOfView:Pointer):Integer; SysV_ABI_CDecl;
function ps4_sceHmdGetFieldOfView(handle:Integer;fieldOfView:pSceHmdFieldOfView):Integer; SysV_ABI_CDecl;
begin
if (fieldOfView=nil) then Exit(SCE_HMD_ERROR_PARAMETER_NULL);

fieldOfView^.tanOut :=1.20743;
fieldOfView^.tanIn :=1.181346;
fieldOfView^.tanTop :=1.262872;
fieldOfView^.tanBottom:=1.262872;

Result:=0;
end;

Expand Down
38 changes: 24 additions & 14 deletions src/ps4_libscenet.pas
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,16 @@ function ps4_sceNetNtohs(net16:Word):Integer; SysV_ABI_CDecl;
Result:=NToHs(net16);
end;

function htonll(Value:QWORD):QWORD; inline;
begin
Result:=htonl(Value shr 32) or (htonl(Value) shl 32)
end;

function ps4_sceNetHtonll(host64:QWORD):QWORD; SysV_ABI_CDecl;
begin
Result:=htonl(host64);
end;

function ps4_sceNetEpollControl(eid:Integer; op:Integer; id:Integer; event:pSceNetEpollEvent):Integer; SysV_ABI_CDecl;
begin
Result:=0;
Expand Down Expand Up @@ -413,35 +423,35 @@ function ps4_sceNetResolverStartAton(rid:Integer; const addr:pSceNetInAddr; host
Move(chost^,hostname^,Length(chost));
end;

function ps4_sceNetResolverDestroy(rid:Integer):Integer; SysV_ABI_CDecl;
function ps4_sceNetResolverStartNtoa(rid:Integer; const hostname:PChar; addr:pSceNetInAddr; timeout:Integer; retry:Integer; flags:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceNetConnect(s:Integer; const addr:pSceNetSockaddr; addrlen:SceNetSocklen_t):Integer; SysV_ABI_CDecl;
begin
Result:=0;
ps4_usleep(100);

if (addr<>nil) then
begin
addr^.s_addr:=SceNetInAddr_t(Pointer(@default_addr.sa_data)^);
end;
end;

function ps4_sceNetEpollWait(s:Integer; events:pSceNetEpollEvent; maxevents:Integer; timeout:Integer):Integer; SysV_ABI_CDecl;
function ps4_sceNetResolverDestroy(rid:Integer):Integer; SysV_ABI_CDecl;
begin
ps4_usleep(timeout);
Result:=0;
end;

function ps4_sceNetEpollDestroy(eid:Integer):Integer; SysV_ABI_CDecl;
function ps4_sceNetConnect(s:Integer; const addr:pSceNetSockaddr; addrlen:SceNetSocklen_t):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceNetHtonll(host64:QWORD):QWORD; SysV_ABI_CDecl;
function ps4_sceNetEpollWait(s:Integer; events:pSceNetEpollEvent; maxevents:Integer; timeout:Integer):Integer; SysV_ABI_CDecl;
begin
ps4_usleep(timeout);
Result:=0;
end;

function ps4_sceNetResolverStartNtoa(rid:Integer; const hostname:PChar; addr:pSceNetInAddr; timeout:Integer; retry:Integer; flags:Integer):Integer; SysV_ABI_CDecl;
const
chost:PChar='123.site.com'#0;
function ps4_sceNetEpollDestroy(eid:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
Expand Down Expand Up @@ -722,15 +732,15 @@ function Load_libSceNet(Const name:RawByteString):TElf_node;
lib^.set_proc($868380A1F86146F1,@ps4_sceNetGetsockname);
lib^.set_proc($A501A91D8A290086,@ps4_sceNetNtohl);
lib^.set_proc($45BBEDFB9636884C,@ps4_sceNetNtohs);
lib^.set_proc($DC21E2D4AD70B024,@ps4_sceNetHtonll);
lib^.set_proc($655C38E9BB1AB009,@ps4_sceNetEpollControl);
lib^.set_proc($C6986B66EB25EFC1,@ps4_sceNetGetsockopt);
lib^.set_proc($0296F8603C4AB112,@ps4_sceNetResolverStartAton);
lib^.set_proc($35DF7559A5A61B6C,@ps4_sceNetResolverStartNtoa);
lib^.set_proc($9099581F9B8C0162,@ps4_sceNetResolverDestroy);
lib^.set_proc($3975D7E26524DEE9,@ps4_sceNetConnect);
lib^.set_proc($76B8C86C36C0ED44,@ps4_sceNetEpollWait);
lib^.set_proc($227A7595F2FE25DC,@ps4_sceNetEpollDestroy);
lib^.set_proc($DC21E2D4AD70B024,@ps4_sceNetHtonll);
lib^.set_proc($35DF7559A5A61B6C,@ps4_sceNetResolverStartNtoa);
end;

function Load_libSceNetCtl(Const name:RawByteString):TElf_node;
Expand Down
2 changes: 0 additions & 2 deletions src/ps4_libsceuserservice.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ interface
atomic,
Classes,
SysUtils;
ps4_libSceHmd;

const
SCE_USER_SERVICE_MAX_LOGIN_USERS=4;
SCE_USER_SERVICE_USER_ID_INVALID=Integer($FFFFFFFF);

type
pSceUserServiceUserId=^SceUserServiceUserid;
PUserServiceInitializeParams=^TUserServiceInitializeParams;
TUserServiceInitializeParams=packed record
priority:DWORD;
Expand Down

0 comments on commit 838a388

Please sign in to comment.