Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sceVoiceGetResourceInfo + sceAudio3dTerminate + sceHmd functions #193

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/audio/ps4_libsceaudio3d.pas
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ function ps4_sceAudio3dBedWrite(uiPortId:SceAudio3dPortId;
Result:=0;
end;

function ps4_sceAudio3dTerminate():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function Load_libSceAudio3d(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
Expand All @@ -172,6 +177,7 @@ function Load_libSceAudio3d(Const name:RawByteString):TElf_node;
lib^.set_proc($B9C12C8BADACA13A,@ps4_sceAudio3dAudioOutOpen);
lib^.set_proc($61A6836C3C0AA453,@ps4_sceAudio3dPortGetQueueLevel);
lib^.set_proc($F6D130134195D2AA,@ps4_sceAudio3dBedWrite);
lib^.set_proc($596D534B68B3E727,@ps4_sceAudio3dTerminate);
end;

initialization
Expand Down
25 changes: 25 additions & 0 deletions src/ps4_libscehmd.pas
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ interface
tanBottom:Single;
end;

pSceFVector3=^SceFVector3;
SceFVector3=packed record
x,y,z:Single;
end;

pSceHmdEyeOffset=^SceHmdEyeOffset;
SceHmdEyeOffset=packed record
offset :SceFVector3;
reserve:array[0..19] of Byte;
end;

implementation

function ps4_sceHmdInitialize(param:Pointer):Integer; SysV_ABI_CDecl;
Expand Down Expand Up @@ -145,6 +156,11 @@ function ps4_sceHmdReprojectionSetDisplayBuffers(videoOutHandle,index0,index1:In
Result:=0;
end;

function ps4_sceHmdReprojectionSetOutputMinColor(r,g,b:Single):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceHmdOpen(userId,_type,index:Integer;pParam:pSceHmdOpenParam):Integer; SysV_ABI_CDecl;
begin
Result:=0;
Expand All @@ -162,6 +178,13 @@ function ps4_sceHmdGetFieldOfView(handle:Integer;fieldOfView:pSceHmdFieldOfView)
Result:=0;
end;

function ps4_sceHmdGet2DEyeOffset(handle:Integer;
leftEyeOffset:pSceHmdEyeOffset;
rightEyeOffset:pSceHmdEyeOffset):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceHmdTerminate():Integer; SysV_ABI_CDecl;
begin
Result:=0;
Expand Down Expand Up @@ -190,8 +213,10 @@ function Load_libSceHmd(Const name:RawByteString):TElf_node;
lib^.set_proc($66B579608A83D3D2,@ps4_sceHmdReprojectionFinalize);
lib^.set_proc($99DC856DA263EBA3,@ps4_sceHmdReprojectionClearUserEventStart);
lib^.set_proc($13E74F7E37902C72,@ps4_sceHmdReprojectionSetDisplayBuffers);
lib^.set_proc($2E374B472B0753A6,@ps4_sceHmdReprojectionSetOutputMinColor);
lib^.set_proc($776839223EC4533A,@ps4_sceHmdOpen);
lib^.set_proc($34F430605AA2D1BB,@ps4_sceHmdGetFieldOfView);
lib^.set_proc($05663FA8A3398711,@ps4_sceHmdGet2DEyeOffset);
lib^.set_proc($CFF44C20BA8FEAD1,@ps4_sceHmdTerminate);
end;

Expand Down
30 changes: 30 additions & 0 deletions src/ps4_libscevoice.pas
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ interface
const
SCE_VOICE_ERROR_ARGUMENT_INVALID=-2142369787;

//SceVoicePortType
SCE_VOICE_PORTTYPE_NULL =-1;
SCE_VOICE_PORTTYPE_IN_DEVICE =0;
SCE_VOICE_PORTTYPE_IN_PCMAUDIO =1;
SCE_VOICE_PORTTYPE_IN_VOICE =2;
SCE_VOICE_PORTTYPE_OUT_PCMAUDIO=3;
SCE_VOICE_PORTTYPE_OUT_VOICE =4;
SCE_VOICE_PORTTYPE_OUT_DEVICE =5;

type
pSceVoiceInitParam=^SceVoiceInitParam;
SceVoiceInitParam=packed record
Expand Down Expand Up @@ -46,6 +55,14 @@ interface
reserved :WORD;
end;

pSceVoiceResourceInfo=^SceVoiceResourceInfo;
SceVoiceResourceInfo=packed record
maxInVoicePort :Word;
maxOutVoicePort :Word;
maxInDevicePort :Word;
maxOutDevicePort:Word;
end;

implementation

function ps4_sceVoiceInit(pArg:pSceVoiceInitParam;
Expand Down Expand Up @@ -99,6 +116,18 @@ function ps4_sceVoiceGetPortInfo(portId:DWORD;pInfo:pSceVoiceBasePortInfo):Integ
Result:=0;
end;

function ps4_sceVoiceGetResourceInfo(pInfo:pSceVoiceResourceInfo):Integer; SysV_ABI_CDecl;
begin
if (pInfo=nil) then Exit(SCE_VOICE_ERROR_ARGUMENT_INVALID);

pInfo^.maxInVoicePort :=2;
pInfo^.maxOutVoicePort :=4;
pInfo^.maxInDevicePort :=0;
pInfo^.maxOutDevicePort:=5;

Result:=0;
end;

function ps4_sceVoiceReadFromOPort(ops:DWORD;data:Pointer;size:pDWORD):Integer; SysV_ABI_CDecl;
begin
Result:=0;
Expand Down Expand Up @@ -128,6 +157,7 @@ function Load_libSceVoice(Const name:RawByteString):TElf_node;
lib^.set_proc($A15F4601D276DC6C,@ps4_sceVoiceConnectIPortToOPort);
lib^.set_proc($6A3563DD01B6BA6E,@ps4_sceVoiceDisconnectIPortFromOPort);
lib^.set_proc($0AB2EA0F058BA173,@ps4_sceVoiceGetPortInfo);
lib^.set_proc($67A415EA3EE282F1,@ps4_sceVoiceGetResourceInfo);
lib^.set_proc($710E831AC4048D5E,@ps4_sceVoiceReadFromOPort);
lib^.set_proc($4011680088C9A174,@ps4_sceVoiceSetVolume);
lib^.set_proc($8305329E41203456,@ps4_sceVoiceSetMuteFlag);
Expand Down
Loading