Skip to content

Commit

Permalink
SceSystemGesture library (#176)
Browse files Browse the repository at this point in the history
* libSceSystemGesture

* sceHmdGetDeviceInformationByHandle

* Fix

* +

---------

Co-authored-by: red-prig <vdpasha@mail.ru>
  • Loading branch information
Ordinary205 and red-prig authored Jan 25, 2024
1 parent 5948d7a commit 46d74e0
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 0 deletions.
1 change: 1 addition & 0 deletions fpPS4.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
ps4_libSceNpScore,
ps4_libSceNpTrophy,
ps4_libSceSystemService,
ps4_libSceSystemGesture,
ps4_libSceNpUtility,
ps4_libSceNpCommon,
ps4_libSceNpManager,
Expand Down
25 changes: 25 additions & 0 deletions src/ps4_libscehmd.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ interface
SCE_HMD_ERROR_PARAMETER_NULL=Integer($81110008);

type
pSceHmdDeviceInformation=^SceHmdDeviceInformation;
SceHmdDeviceInformation=packed record
status:DWORD;
userId:DWORD;
reserve0:array[0..3] of Byte;
deviceInfo:packed record
panelResolution:packed record
width :DWORD;
height:DWORD;
end;
flipToDisplayLatency:packed record
refreshRate90Hz :Word;
refreshRate120Hz:Word;
end;
end;
hmuMount:Byte;
reserve1:array[0..6] of Byte;
end;

pSceHmdOpenParam=^SceHmdOpenParam;
SceHmdOpenParam=packed record
reserve:array[0..7] of Byte;
Expand Down Expand Up @@ -74,6 +93,11 @@ function ps4_sceHmdGetDeviceInformation(info:Pointer):Integer; SysV_ABI_CDecl;
Result:=0;
end;

function ps4_sceHmdGetDeviceInformationByHandle(handle:Integer;info:pSceHmdDeviceInformation):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceHmdReprojectionStop():Integer; SysV_ABI_CDecl;
begin
Result:=0;
Expand Down Expand Up @@ -137,6 +161,7 @@ function Load_libSceHmd(Const name:RawByteString):TElf_node;
lib^.set_proc($EDAB340A35D6D41F,@ps4_sceHmdReprojectionSetUserEventStart);
lib^.set_proc($927C888659292E01,@ps4_sceHmdReprojectionSetUserEventEnd);
lib^.set_proc($B610EDF6EA59969F,@ps4_sceHmdGetDeviceInformation);
lib^.set_proc($D69C507E27F5AE41,@ps4_sceHmdGetDeviceInformationByHandle);
lib^.set_proc($BF33049300507223,@ps4_sceHmdReprojectionStop);
lib^.set_proc($88634DA430E3730A,@ps4_sceHmdReprojectionUnsetDisplayBuffers);
lib^.set_proc($66B579608A83D3D2,@ps4_sceHmdReprojectionFinalize);
Expand Down
177 changes: 177 additions & 0 deletions src/ps4_libscesystemgesture.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
unit ps4_libSceSystemGesture;

{$mode ObjFPC}{$H+}

interface

uses
ps4_program,
sce_pad_types,
Classes,
SysUtils;

const
SCE_PAD_MAX_TOUCH_NUM=2;
SCE_PAD_MAX_DEVICE_UNIQUE_DATA_SIZE=4;

//SceSystemGestureType
SCE_SYSTEM_GESTURE_TYPE_TAP =$00000001;
SCE_SYSTEM_GESTURE_TYPE_DRAG =$00000002;
SCE_SYSTEM_GESTURE_TYPE_TAP_AND_HOLD=$00000004;
SCE_SYSTEM_GESTURE_TYPE_PINCH_OUT_IN=$00000008;
SCE_SYSTEM_GESTURE_TYPE_ROTATION =$00000010;
SCE_SYSTEM_GESTURE_TYPE_FLICK =$00000020;

type
pSceFQuaternion=^SceFQuaternion;
SceFQuaternion=packed record
x,y,z,w:single;
end;

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

pSceSystemGesturePrimitiveTouchRecognizerParameter=^SceSystemGesturePrimitiveTouchRecognizerParameter;
SceSystemGesturePrimitiveTouchRecognizerParameter=packed record
reserve:array[0..63] of Byte;
end;

pSceSystemGestureOpenParameter=^SceSystemGestureOpenParameter;
SceSystemGestureOpenParameter=packed record
reserve:array[0..7] of Byte;
end;

pSceSystemGestureTouchRecognizer=^SceSystemGestureTouchRecognizer;
SceSystemGestureTouchRecognizer=packed record
reserve:array[0..360] of QWORD;
end;

pSceSystemGestureType=^SceSystemGestureType;
SceSystemGestureType=Integer;

pSceSystemGestureRectangle=^SceSystemGestureRectangle;
SceSystemGestureRectangle=packed record
x,y,width,height:single;
reserve:array[0..7] of Byte;
end;

pSceSystemGestureTapRecognizerParameter=^SceSystemGestureTapRecognizerParameter;
SceSystemGestureTapRecognizerParameter=packed record
maxTapCount:Byte;
reserve:array[0..62] of Byte;
end;

pSceSystemGestureDragRecognizerParameter=^SceSystemGestureDragRecognizerParameter;
SceSystemGestureDragRecognizerParameter=packed record
reserve:array[0..63] of Byte;
end;

pSceSystemGestureTapAndHoldRecognizerParameter=^SceSystemGestureTapAndHoldRecognizerParameter;
SceSystemGestureTapAndHoldRecognizerParameter=packed record
timeToInvokeEvent:QWORD;
reserve:array[0..55] of Byte;
end;

pSceSystemGesturePinchOutInRecognizerParameter=^SceSystemGesturePinchOutInRecognizerParameter;
SceSystemGesturePinchOutInRecognizerParameter=packed record
reserve:array[0..63] of Byte;
end;

pSceSystemGestureRotationRecognizerParameter=^SceSystemGestureRotationRecognizerParameter;
SceSystemGestureRotationRecognizerParameter=packed record
reserve:array[0..63] of Byte;
end;

pSceSystemGestureFlickRecognizerParameter=^SceSystemGestureFlickRecognizerParameter;
SceSystemGestureFlickRecognizerParameter=packed record
reserve:array[0..63] of Byte;
end;

pSceSystemGestureTouchRecognizerParameter=^SceSystemGestureTouchRecognizerParameter;
SceSystemGestureTouchRecognizerParameter=packed record
parameterBuf:array[0..63] of Byte;
tap :SceSystemGestureTapRecognizerParameter;
drag :SceSystemGestureDragRecognizerParameter;
tapAndHold :SceSystemGestureTapAndHoldRecognizerParameter;
pinchOutIn :SceSystemGesturePinchOutInRecognizerParameter;
rotation :SceSystemGestureRotationRecognizerParameter;
flick :SceSystemGestureFlickRecognizerParameter;
end;

pSceSystemGestureTouchPadData=^SceSystemGestureTouchPadData;
SceSystemGestureTouchPadData=packed record
padHandle :Integer;
reportNumber :Integer;
padDataBuffer:pScePadData;
reserve :array[0..7] of Byte;
end;

implementation

function ps4_sceSystemGestureInitializePrimitiveTouchRecognizer(parameter:pSceSystemGesturePrimitiveTouchRecognizerParameter):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceSystemGestureOpen(inputType:Integer;
parameter:pSceSystemGestureOpenParameter):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceSystemGestureCreateTouchRecognizer(gestureHandle:Integer;
touchRecognizer:pSceSystemGestureTouchRecognizer;
gestureType:SceSystemGestureType;
rectangle:pSceSystemGestureRectangle;
touchRecognizerParameter:pSceSystemGestureTouchRecognizerParameter):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceSystemGestureAppendTouchRecognizer(gestureHandle:Integer;
touchRecognizer:pSceSystemGestureTouchRecognizer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function ps4_sceSystemGestureUpdatePrimitiveTouchRecognizer(gestureHandle:Integer;
const pInputData:pSceSystemGestureTouchPadData):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

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

function ps4_sceSystemGestureGetTouchEventsCount(gestureHandle:Integer;
const touchRecognizer:pSceSystemGestureTouchRecognizer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;

function Load_libSceSystemGesture(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
begin
Result:=TElf_node.Create;
Result.pFileName:=name;

lib:=Result._add_lib('libSceSystemGesture');
lib^.set_proc($DE9700BE6C0A0AF3,@ps4_sceSystemGestureInitializePrimitiveTouchRecognizer);
lib^.set_proc($AA9A3F9843B08DED,@ps4_sceSystemGestureOpen);
lib^.set_proc($15617CCE486BF39E,@ps4_sceSystemGestureCreateTouchRecognizer);
lib^.set_proc($D4C30AD16FE43200,@ps4_sceSystemGestureAppendTouchRecognizer);
lib^.set_proc($1A014C6F6DAC6DB2,@ps4_sceSystemGestureUpdatePrimitiveTouchRecognizer);
lib^.set_proc($C0F246C08D913362,@ps4_sceSystemGestureUpdateAllTouchRecognizer);
lib^.set_proc($87CBA89E0701355B,@ps4_sceSystemGestureGetTouchEventsCount);
end;

initialization
ps4_app.RegistredPreLoad('libSceSystemGesture.prx',@Load_libSceSystemGesture);

end.

0 comments on commit 46d74e0

Please sign in to comment.