Skip to content

Commit

Permalink
sceAudioOutGetSystemState function (#169)
Browse files Browse the repository at this point in the history
* sceAudioOutGetSystemState function

broken AvPlayer doesn't let game boot further

* Fix

---------

Co-authored-by: red-prig <vdpasha@mail.ru>
  • Loading branch information
kr1spy2115 and red-prig authored Jan 13, 2024
1 parent ebc6288 commit 81f5607
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/audio/ps4_libsceaudioout.pas
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,23 @@ function ps4_sceAudioOutGetPortState(handle:Integer;state:pSceAudioOutPortState)
Result:=0;
end;

type
pSceAudioOutSystemState=^SceAudioOutSystemState;
SceAudioOutSystemState=packed record
loudness :single;
reserved8 :array[0..3] of Byte;
reserved64:array[0..2] of QWORD;
end;

function ps4_sceAudioOutGetSystemState(state:pSceAudioOutSystemState):Integer; SysV_ABI_CDecl;
begin
if (state=nil) then Exit(SCE_AUDIO_OUT_ERROR_INVALID_POINTER);
if (HAudioOuts=nil) then Exit(SCE_AUDIO_OUT_ERROR_NOT_INIT);

state^.loudness:=1;
Result:=0;
end;

function ps4_sceAudioOutSetVolume(handle,flag:Integer;vol:PInteger):Integer; SysV_ABI_CDecl;
Var
H:TAudioOutHandle;
Expand Down Expand Up @@ -848,6 +865,7 @@ function Load_libSceAudioOut(Const name:RawByteString):TElf_node;
lib^.set_proc($40E42D6DE0EAB13E,@ps4_sceAudioOutOutput);
lib^.set_proc($C373DD6924D2C061,@ps4_sceAudioOutOutputs);
lib^.set_proc($3ED96DB37DBAA5DB,@ps4_sceAudioOutGetLastOutputTime);
lib^.set_proc($47985E9A828A203F,@ps4_sceAudioOutGetSystemState);
end;

const
Expand Down

0 comments on commit 81f5607

Please sign in to comment.