mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-12 12:45:56 +00:00
Merge branch 'main' into fontlib
This commit is contained in:
commit
f9fac7ab9e
29 changed files with 1195 additions and 139 deletions
517
src/core/libraries/camera/camera.cpp
Normal file
517
src/core/libraries/camera/camera.cpp
Normal file
|
@ -0,0 +1,517 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/libraries/camera/camera.h"
|
||||
#include "core/libraries/camera/camera_error.h"
|
||||
#include "core/libraries/error_codes.h"
|
||||
#include "core/libraries/libs.h"
|
||||
|
||||
namespace Libraries::Camera {
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraAccGetData() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraAudioClose() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraAudioGetData() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraAudioGetData2() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraAudioOpen() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraAudioReset() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraChangeAppModuleState() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraClose(s32 handle) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraCloseByHandle() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraDeviceOpen() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetAttribute(s32 handle, OrbisCameraAttribute* pAttribute) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetAutoExposureGain(s32 handle, OrbisCameraChannel channel, u32* pEnable,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetAutoWhiteBalance(s32 handle, OrbisCameraChannel channel, u32* pEnable,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetCalibData() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetCalibDataFromDevice() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetCalibrationData() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetConfig(s32 handle, OrbisCameraConfig* pConfig) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetContrast(s32 handle, OrbisCameraChannel channel, u32* pContrast,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetDefectivePixelCancellation(s32 handle, OrbisCameraChannel channel,
|
||||
u32* pEnable, void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceConfig() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceConfigWithoutHandle() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceID() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceIDWithoutOpen() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceInfo(s32 reserved, OrbisCameraDeviceInfo* pDeviceInfo) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetExposureGain(s32 handle, OrbisCameraChannel channel,
|
||||
OrbisCameraExposureGain* pExposureGain, void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetFrameData(int handle, OrbisCameraFrameData* pFrameData) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetGamma(s32 handle, OrbisCameraChannel channel, OrbisCameraGamma* pGamma,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetHue(s32 handle, OrbisCameraChannel channel, s32* pHue, void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetLensCorrection(s32 handle, OrbisCameraChannel channel, u32* pEnable,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetMmapConnectedCount() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetProductInfo() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetRegister() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetRegistryInfo() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetSaturation(s32 handle, OrbisCameraChannel channel, u32* pSaturation,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetSharpness(s32 handle, OrbisCameraChannel channel, u32* pSharpness,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetVrCaptureInfo() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraGetWhiteBalance(s32 handle, OrbisCameraChannel channel,
|
||||
OrbisCameraWhiteBalance* pWhiteBalance, void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraInitializeRegistryCalibData() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraIsAttached(s32 index) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraIsConfigChangeDone() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraIsValidFrameData(int handle, OrbisCameraFrameData* pFrameData) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraOpen(Libraries::UserService::OrbisUserServiceUserId userId, s32 type,
|
||||
s32 index, OrbisCameraOpenParameter* pParam) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraOpenByModuleId() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraRemoveAppModuleFocus() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetAppModuleFocus() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetAttribute(s32 handle, OrbisCameraAttribute* pAttribute) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetAttributeInternal() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetAutoExposureGain(s32 handle, OrbisCameraChannel channel, u32 enable,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetAutoWhiteBalance(s32 handle, OrbisCameraChannel channel, u32 enable,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetCalibData() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetConfig(s32 handle, OrbisCameraConfig* pConfig) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetConfigInternal() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetContrast(s32 handle, OrbisCameraChannel channel, u32 contrast,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetDebugStop() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetDefectivePixelCancellation(s32 handle, OrbisCameraChannel channel,
|
||||
u32 enable, void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetDefectivePixelCancellationInternal() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetExposureGain(s32 handle, OrbisCameraChannel channel,
|
||||
OrbisCameraExposureGain* pExposureGain, void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetForceActivate() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetGamma(s32 handle, OrbisCameraChannel channel, OrbisCameraGamma* pGamma,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetHue(s32 handle, OrbisCameraChannel channel, s32 hue, void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetLensCorrection(s32 handle, OrbisCameraChannel channel, u32 enable,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetLensCorrectionInternal() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetProcessFocus() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetProcessFocusByHandle() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetRegister() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetSaturation(s32 handle, OrbisCameraChannel channel, u32 saturation,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetSharpness(s32 handle, OrbisCameraChannel channel, u32 sharpness,
|
||||
void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetTrackerMode() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetUacModeInternal() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetVideoSync(s32 handle, OrbisCameraVideoSyncParameter* pVideoSync) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetVideoSyncInternal() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraSetWhiteBalance(s32 handle, OrbisCameraChannel channel,
|
||||
OrbisCameraWhiteBalance* pWhiteBalance, void* pOption) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraStart(s32 handle, OrbisCameraStartParameter* pParam) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraStartByHandle() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraStop(s32 handle) {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraStopByHandle() {
|
||||
LOG_ERROR(Lib_Camera, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
void RegisterlibSceCamera(Core::Loader::SymbolsResolver* sym) {
|
||||
LIB_FUNCTION("QhjrPkRPUZQ", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraAccGetData);
|
||||
LIB_FUNCTION("UFonL7xopFM", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraAudioClose);
|
||||
LIB_FUNCTION("fkZE7Hup2ro", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraAudioGetData);
|
||||
LIB_FUNCTION("hftC5A1C8OQ", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraAudioGetData2);
|
||||
LIB_FUNCTION("DhqqFiBU+6g", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraAudioOpen);
|
||||
LIB_FUNCTION("wyU98EXAYxU", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraAudioReset);
|
||||
LIB_FUNCTION("Y0pCDajzkVQ", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraChangeAppModuleState);
|
||||
LIB_FUNCTION("OMS9LlcrvBo", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraClose);
|
||||
LIB_FUNCTION("ztqH5qNTpTk", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraCloseByHandle);
|
||||
LIB_FUNCTION("nBH6i2s4Glc", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraDeviceOpen);
|
||||
LIB_FUNCTION("0btIPD5hg5A", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetAttribute);
|
||||
LIB_FUNCTION("oEi6vM-3E2c", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraGetAutoExposureGain);
|
||||
LIB_FUNCTION("qTPRMh4eY60", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraGetAutoWhiteBalance);
|
||||
LIB_FUNCTION("hHA1frlMxYE", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetCalibData);
|
||||
LIB_FUNCTION("5Oie5RArfWs", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraGetCalibDataFromDevice);
|
||||
LIB_FUNCTION("RHYJ7GKOSMg", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraGetCalibrationData);
|
||||
LIB_FUNCTION("ZaqmGEtYuL0", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetConfig);
|
||||
LIB_FUNCTION("a5xFueMZIMs", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetContrast);
|
||||
LIB_FUNCTION("tslCukqFE+E", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraGetDefectivePixelCancellation);
|
||||
LIB_FUNCTION("DSOLCrc3Kh8", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetDeviceConfig);
|
||||
LIB_FUNCTION("n+rFeP1XXyM", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraGetDeviceConfigWithoutHandle);
|
||||
LIB_FUNCTION("jTJCdyv9GLU", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetDeviceID);
|
||||
LIB_FUNCTION("-H3UwGQvNZI", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraGetDeviceIDWithoutOpen);
|
||||
LIB_FUNCTION("WZpxnSAM-ds", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetDeviceInfo);
|
||||
LIB_FUNCTION("ObIste7hqdk", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetExposureGain);
|
||||
LIB_FUNCTION("mxgMmR+1Kr0", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetFrameData);
|
||||
LIB_FUNCTION("WVox2rwGuSc", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetGamma);
|
||||
LIB_FUNCTION("zrIUDKZx0iE", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetHue);
|
||||
LIB_FUNCTION("XqYRHc4aw3w", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraGetLensCorrection);
|
||||
LIB_FUNCTION("B260o9pSzM8", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraGetMmapConnectedCount);
|
||||
LIB_FUNCTION("ULxbwqiYYuU", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetProductInfo);
|
||||
LIB_FUNCTION("olojYZKYiYs", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetRegister);
|
||||
LIB_FUNCTION("hawKak+Auw4", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetRegistryInfo);
|
||||
LIB_FUNCTION("RTDOsWWqdME", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetSaturation);
|
||||
LIB_FUNCTION("c6Fp9M1EXXc", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetSharpness);
|
||||
LIB_FUNCTION("IAz2HgZQWzE", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetVrCaptureInfo);
|
||||
LIB_FUNCTION("HX5524E5tMY", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraGetWhiteBalance);
|
||||
LIB_FUNCTION("0wnf2a60FqI", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraInitializeRegistryCalibData);
|
||||
LIB_FUNCTION("p6n3Npi3YY4", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraIsAttached);
|
||||
LIB_FUNCTION("wQfd7kfRZvo", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraIsConfigChangeDone);
|
||||
LIB_FUNCTION("U3BVwQl2R5Q", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraIsValidFrameData);
|
||||
LIB_FUNCTION("BHn83xrF92E", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraOpen);
|
||||
LIB_FUNCTION("eTywOSWsEiI", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraOpenByModuleId);
|
||||
LIB_FUNCTION("py8p6kZcHmA", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraRemoveAppModuleFocus);
|
||||
LIB_FUNCTION("j5isFVIlZLk", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetAppModuleFocus);
|
||||
LIB_FUNCTION("doPlf33ab-U", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetAttribute);
|
||||
LIB_FUNCTION("96F7zp1Xo+k", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetAttributeInternal);
|
||||
LIB_FUNCTION("yfSdswDaElo", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetAutoExposureGain);
|
||||
LIB_FUNCTION("zIKL4kZleuc", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetAutoWhiteBalance);
|
||||
LIB_FUNCTION("LEMk5cTHKEA", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetCalibData);
|
||||
LIB_FUNCTION("VQ+5kAqsE2Q", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetConfig);
|
||||
LIB_FUNCTION("9+SNhbctk64", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetConfigInternal);
|
||||
LIB_FUNCTION("3i5MEzrC1pg", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetContrast);
|
||||
LIB_FUNCTION("vejouEusC7g", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetDebugStop);
|
||||
LIB_FUNCTION("jMv40y2A23g", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetDefectivePixelCancellation);
|
||||
LIB_FUNCTION("vER3cIMBHqI", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetDefectivePixelCancellationInternal);
|
||||
LIB_FUNCTION("wgBMXJJA6K4", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetExposureGain);
|
||||
LIB_FUNCTION("jeTpU0MqKU0", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetForceActivate);
|
||||
LIB_FUNCTION("lhEIsHzB8r4", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetGamma);
|
||||
LIB_FUNCTION("QI8GVJUy2ZY", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetHue);
|
||||
LIB_FUNCTION("K7W7H4ZRwbc", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetLensCorrection);
|
||||
LIB_FUNCTION("eHa3vhGu2rQ", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetLensCorrectionInternal);
|
||||
LIB_FUNCTION("lS0tM6n+Q5E", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetProcessFocus);
|
||||
LIB_FUNCTION("NVITuK83Z7o", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetProcessFocusByHandle);
|
||||
LIB_FUNCTION("8MjO05qk5hA", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetRegister);
|
||||
LIB_FUNCTION("bSKEi2PzzXI", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetSaturation);
|
||||
LIB_FUNCTION("P-7MVfzvpsM", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetSharpness);
|
||||
LIB_FUNCTION("3VJOpzKoIeM", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetTrackerMode);
|
||||
LIB_FUNCTION("nnR7KAIDPv8", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetUacModeInternal);
|
||||
LIB_FUNCTION("wpeyFwJ+UEI", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetVideoSync);
|
||||
LIB_FUNCTION("8WtmqmE4edw", "libSceCamera", 1, "libSceCamera", 1, 1,
|
||||
sceCameraSetVideoSyncInternal);
|
||||
LIB_FUNCTION("k3zPIcgFNv0", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraSetWhiteBalance);
|
||||
LIB_FUNCTION("9EpRYMy7rHU", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraStart);
|
||||
LIB_FUNCTION("cLxF1QtHch0", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraStartByHandle);
|
||||
LIB_FUNCTION("2G2C0nmd++M", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraStop);
|
||||
LIB_FUNCTION("+X1Kgnn3bzg", "libSceCamera", 1, "libSceCamera", 1, 1, sceCameraStopByHandle);
|
||||
};
|
||||
|
||||
} // namespace Libraries::Camera
|
308
src/core/libraries/camera/camera.h
Normal file
308
src/core/libraries/camera/camera.h
Normal file
|
@ -0,0 +1,308 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <core/libraries/system/userservice.h>
|
||||
#include "common/types.h"
|
||||
|
||||
namespace Core::Loader {
|
||||
class SymbolsResolver;
|
||||
}
|
||||
|
||||
namespace Libraries::Camera {
|
||||
|
||||
constexpr int ORBIS_CAMERA_MAX_DEVICE_NUM = 2;
|
||||
constexpr int ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM = 4;
|
||||
|
||||
enum OrbisCameraChannel {
|
||||
ORBIS_CAMERA_CHANNEL_0 = 1,
|
||||
ORBIS_CAMERA_CHANNEL_1 = 2,
|
||||
ORBIS_CAMERA_CHANNEL_BOTH = 3,
|
||||
};
|
||||
|
||||
struct OrbisCameraOpenParameter {
|
||||
u32 sizeThis;
|
||||
u32 reserved1;
|
||||
u32 reserved2;
|
||||
u32 reserved3;
|
||||
};
|
||||
|
||||
enum OrbisCameraConfigType {
|
||||
ORBIS_CAMERA_CONFIG_TYPE1 = 0x01,
|
||||
ORBIS_CAMERA_CONFIG_TYPE2 = 0x02,
|
||||
ORBIS_CAMERA_CONFIG_TYPE3 = 0x03,
|
||||
ORBIS_CAMERA_CONFIG_TYPE4 = 0x04,
|
||||
ORBIS_CAMERA_CONFIG_TYPE5 = 0x05,
|
||||
ORBIS_CAMERA_CONFIG_EXTENTION = 0x10,
|
||||
};
|
||||
|
||||
enum OrbisCameraResolution {
|
||||
ORBIS_CAMERA_RESOLUTION_1280X800 = 0x0,
|
||||
ORBIS_CAMERA_RESOLUTION_640X400 = 0x1,
|
||||
ORBIS_CAMERA_RESOLUTION_320X200 = 0x2,
|
||||
ORBIS_CAMERA_RESOLUTION_160X100 = 0x3,
|
||||
ORBIS_CAMERA_RESOLUTION_320X192 = 0x4,
|
||||
ORBIS_CAMERA_RESOLUTION_SPECIFIED_WIDTH_HEIGHT,
|
||||
ORBIS_CAMERA_RESOLUTION_UNKNOWN = 0xFF,
|
||||
};
|
||||
|
||||
enum OrbisCameraFramerate {
|
||||
ORBIS_CAMERA_FRAMERATE_UNKNOWN = 0,
|
||||
ORBIS_CAMERA_FRAMERATE_7_5 = 7,
|
||||
ORBIS_CAMERA_FRAMERATE_15 = 15,
|
||||
ORBIS_CAMERA_FRAMERATE_30 = 30,
|
||||
ORBIS_CAMERA_FRAMERATE_60 = 60,
|
||||
ORBIS_CAMERA_FRAMERATE_120 = 120,
|
||||
ORBIS_CAMERA_FRAMERATE_240 = 240,
|
||||
};
|
||||
|
||||
enum OrbisCameraBaseFormat {
|
||||
ORBIS_CAMERA_FORMAT_YUV422 = 0x0,
|
||||
ORBIS_CAMERA_FORMAT_RAW16,
|
||||
ORBIS_CAMERA_FORMAT_RAW8,
|
||||
ORBIS_CAMERA_FORMAT_NO_USE = 0x10,
|
||||
ORBIS_CAMERA_FORMAT_UNKNOWN = 0xFF,
|
||||
};
|
||||
|
||||
enum OrbisCameraScaleFormat {
|
||||
ORBIS_CAMERA_SCALE_FORMAT_YUV422 = 0x0,
|
||||
ORBIS_CAMERA_SCALE_FORMAT_Y16 = 0x3,
|
||||
ORBIS_CAMERA_SCALE_FORMAT_Y8,
|
||||
ORBIS_CAMERA_SCALE_FORMAT_NO_USE = 0x10,
|
||||
ORBIS_CAMERA_SCALE_FORMAT_UNKNOWN = 0xFF,
|
||||
};
|
||||
|
||||
struct OrbisCameraFormat {
|
||||
OrbisCameraBaseFormat formatLevel0;
|
||||
OrbisCameraScaleFormat formatLevel1;
|
||||
OrbisCameraScaleFormat formatLevel2;
|
||||
OrbisCameraScaleFormat formatLevel3;
|
||||
};
|
||||
|
||||
struct OrbisCameraConfigExtention {
|
||||
OrbisCameraFormat format;
|
||||
OrbisCameraResolution resolution;
|
||||
OrbisCameraFramerate framerate;
|
||||
u32 width;
|
||||
u32 height;
|
||||
u32 reserved1;
|
||||
void* pBaseOption;
|
||||
};
|
||||
|
||||
struct OrbisCameraConfig {
|
||||
u32 sizeThis;
|
||||
OrbisCameraConfigType configType;
|
||||
OrbisCameraConfigExtention configExtention[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
};
|
||||
|
||||
enum OrbisCameraAecAgcTarget {
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_DEF = 0x00,
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_2_0 = 0x20,
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_1_6 = 0x16,
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_1_4 = 0x14,
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_1_2 = 0x12,
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_1_0 = 0x10,
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_0_8 = 0x08,
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_0_6 = 0x06,
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_0_4 = 0x04,
|
||||
ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_0_2 = 0x02,
|
||||
};
|
||||
|
||||
struct OrbisCameraDeviceInfo {
|
||||
u32 sizeThis;
|
||||
u32 infoRevision;
|
||||
u32 deviceRevision;
|
||||
u32 padding;
|
||||
};
|
||||
|
||||
struct OrbisCameraStartParameter {
|
||||
u32 sizeThis;
|
||||
u32 formatLevel[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
void* pStartOption;
|
||||
};
|
||||
|
||||
struct OrbisCameraVideoSyncParameter {
|
||||
u32 sizeThis;
|
||||
u32 videoSyncMode;
|
||||
void* pModeOption;
|
||||
};
|
||||
|
||||
struct OrbisCameraFramePosition {
|
||||
u32 x;
|
||||
u32 y;
|
||||
u32 xSize;
|
||||
u32 ySize;
|
||||
};
|
||||
|
||||
struct OrbisCameraAutoExposureGainTarget {
|
||||
u32 sizeThis;
|
||||
OrbisCameraAecAgcTarget target;
|
||||
};
|
||||
|
||||
struct OrbisCameraExposureGain {
|
||||
u32 exposureControl;
|
||||
u32 exposure;
|
||||
u32 gain;
|
||||
u32 mode;
|
||||
};
|
||||
|
||||
struct OrbisCameraWhiteBalance {
|
||||
u32 whiteBalanceControl;
|
||||
u32 gainRed;
|
||||
u32 gainBlue;
|
||||
u32 gainGreen;
|
||||
};
|
||||
|
||||
struct OrbisCameraGamma {
|
||||
u32 gammaControl;
|
||||
u32 value;
|
||||
u8 reserved[16];
|
||||
};
|
||||
|
||||
struct OrbisCameraMeta {
|
||||
u32 metaMode;
|
||||
u32 format[ORBIS_CAMERA_MAX_DEVICE_NUM][ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM];
|
||||
u64 frame[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
u64 timestamp[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
u32 deviceTimestamp[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
OrbisCameraExposureGain exposureGain[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
OrbisCameraWhiteBalance whiteBalance[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
OrbisCameraGamma gamma[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
u32 luminance[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
float acceleration_x;
|
||||
float acceleration_y;
|
||||
float acceleration_z;
|
||||
u64 vcounter;
|
||||
u32 reserved[14];
|
||||
};
|
||||
|
||||
struct OrbisCameraFrameData {
|
||||
u32 sizeThis;
|
||||
u32 readMode;
|
||||
OrbisCameraFramePosition framePosition[ORBIS_CAMERA_MAX_DEVICE_NUM]
|
||||
[ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM];
|
||||
void* pFramePointerList[ORBIS_CAMERA_MAX_DEVICE_NUM][ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM];
|
||||
u32 frameSize[ORBIS_CAMERA_MAX_DEVICE_NUM][ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM];
|
||||
u32 status[ORBIS_CAMERA_MAX_DEVICE_NUM];
|
||||
OrbisCameraMeta meta;
|
||||
void* pFramePointerListGarlic[ORBIS_CAMERA_MAX_DEVICE_NUM][ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM];
|
||||
};
|
||||
|
||||
struct OrbisCameraAttribute {
|
||||
u32 sizeThis;
|
||||
OrbisCameraChannel channel;
|
||||
OrbisCameraFramePosition framePosition;
|
||||
OrbisCameraExposureGain exposureGain;
|
||||
OrbisCameraWhiteBalance whiteBalance;
|
||||
OrbisCameraGamma gamma;
|
||||
u32 saturation;
|
||||
u32 contrast;
|
||||
u32 sharpness;
|
||||
s32 hue;
|
||||
u32 reserved1;
|
||||
u32 reserved2;
|
||||
u32 reserved3;
|
||||
u32 reserved4;
|
||||
};
|
||||
|
||||
s32 PS4_SYSV_ABI sceCameraAccGetData();
|
||||
s32 PS4_SYSV_ABI sceCameraAudioClose();
|
||||
s32 PS4_SYSV_ABI sceCameraAudioGetData();
|
||||
s32 PS4_SYSV_ABI sceCameraAudioGetData2();
|
||||
s32 PS4_SYSV_ABI sceCameraAudioOpen();
|
||||
s32 PS4_SYSV_ABI sceCameraAudioReset();
|
||||
s32 PS4_SYSV_ABI sceCameraChangeAppModuleState();
|
||||
s32 PS4_SYSV_ABI sceCameraClose(s32 handle);
|
||||
s32 PS4_SYSV_ABI sceCameraCloseByHandle();
|
||||
s32 PS4_SYSV_ABI sceCameraDeviceOpen();
|
||||
s32 PS4_SYSV_ABI sceCameraGetAttribute(s32 handle, OrbisCameraAttribute* pAttribute);
|
||||
s32 PS4_SYSV_ABI sceCameraGetAutoExposureGain(s32 handle, OrbisCameraChannel channel, u32* pEnable,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetAutoWhiteBalance(s32 handle, OrbisCameraChannel channel, u32* pEnable,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetCalibData();
|
||||
s32 PS4_SYSV_ABI sceCameraGetCalibDataFromDevice();
|
||||
s32 PS4_SYSV_ABI sceCameraGetCalibrationData();
|
||||
s32 PS4_SYSV_ABI sceCameraGetConfig(s32 handle, OrbisCameraConfig* pConfig);
|
||||
s32 PS4_SYSV_ABI sceCameraGetContrast(s32 handle, OrbisCameraChannel channel, u32* pContrast,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetDefectivePixelCancellation(s32 handle, OrbisCameraChannel channel,
|
||||
u32* pEnable, void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceConfig();
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceConfigWithoutHandle();
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceID();
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceIDWithoutOpen();
|
||||
s32 PS4_SYSV_ABI sceCameraGetDeviceInfo(s32 reserved, OrbisCameraDeviceInfo* pDeviceInfo);
|
||||
s32 PS4_SYSV_ABI sceCameraGetExposureGain(s32 handle, OrbisCameraChannel channel,
|
||||
OrbisCameraExposureGain* pExposureGain, void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetFrameData(int handle, OrbisCameraFrameData* pFrameData);
|
||||
s32 PS4_SYSV_ABI sceCameraGetGamma(s32 handle, OrbisCameraChannel channel, OrbisCameraGamma* pGamma,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetHue(s32 handle, OrbisCameraChannel channel, s32* pHue, void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetLensCorrection(s32 handle, OrbisCameraChannel channel, u32* pEnable,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetMmapConnectedCount();
|
||||
s32 PS4_SYSV_ABI sceCameraGetProductInfo();
|
||||
s32 PS4_SYSV_ABI sceCameraGetRegister();
|
||||
s32 PS4_SYSV_ABI sceCameraGetRegistryInfo();
|
||||
s32 PS4_SYSV_ABI sceCameraGetSaturation(s32 handle, OrbisCameraChannel channel, u32* pSaturation,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetSharpness(s32 handle, OrbisCameraChannel channel, u32* pSharpness,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraGetVrCaptureInfo();
|
||||
s32 PS4_SYSV_ABI sceCameraGetWhiteBalance(s32 handle, OrbisCameraChannel channel,
|
||||
OrbisCameraWhiteBalance* pWhiteBalance, void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraInitializeRegistryCalibData();
|
||||
s32 PS4_SYSV_ABI sceCameraIsAttached(s32 index);
|
||||
s32 PS4_SYSV_ABI sceCameraIsConfigChangeDone();
|
||||
s32 PS4_SYSV_ABI sceCameraIsValidFrameData(int handle, OrbisCameraFrameData* pFrameData);
|
||||
s32 PS4_SYSV_ABI sceCameraOpen(Libraries::UserService::OrbisUserServiceUserId userId, s32 type,
|
||||
s32 index, OrbisCameraOpenParameter* pParam);
|
||||
s32 PS4_SYSV_ABI sceCameraOpenByModuleId();
|
||||
s32 PS4_SYSV_ABI sceCameraRemoveAppModuleFocus();
|
||||
s32 PS4_SYSV_ABI sceCameraSetAppModuleFocus();
|
||||
s32 PS4_SYSV_ABI sceCameraSetAttribute(s32 handle, OrbisCameraAttribute* pAttribute);
|
||||
s32 PS4_SYSV_ABI sceCameraSetAttributeInternal();
|
||||
s32 PS4_SYSV_ABI sceCameraSetAutoExposureGain(s32 handle, OrbisCameraChannel channel, u32 enable,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetAutoWhiteBalance(s32 handle, OrbisCameraChannel channel, u32 enable,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetCalibData();
|
||||
s32 PS4_SYSV_ABI sceCameraSetConfig(s32 handle, OrbisCameraConfig* pConfig);
|
||||
s32 PS4_SYSV_ABI sceCameraSetConfigInternal();
|
||||
s32 PS4_SYSV_ABI sceCameraSetContrast(s32 handle, OrbisCameraChannel channel, u32 contrast,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetDebugStop();
|
||||
s32 PS4_SYSV_ABI sceCameraSetDefectivePixelCancellation(s32 handle, OrbisCameraChannel channel,
|
||||
u32 enable, void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetDefectivePixelCancellationInternal();
|
||||
s32 PS4_SYSV_ABI sceCameraSetExposureGain(s32 handle, OrbisCameraChannel channel,
|
||||
OrbisCameraExposureGain* pExposureGain, void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetForceActivate();
|
||||
s32 PS4_SYSV_ABI sceCameraSetGamma(s32 handle, OrbisCameraChannel channel, OrbisCameraGamma* pGamma,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetHue(s32 handle, OrbisCameraChannel channel, s32 hue, void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetLensCorrection(s32 handle, OrbisCameraChannel channel, u32 enable,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetLensCorrectionInternal();
|
||||
s32 PS4_SYSV_ABI sceCameraSetProcessFocus();
|
||||
s32 PS4_SYSV_ABI sceCameraSetProcessFocusByHandle();
|
||||
s32 PS4_SYSV_ABI sceCameraSetRegister();
|
||||
s32 PS4_SYSV_ABI sceCameraSetSaturation(s32 handle, OrbisCameraChannel channel, u32 saturation,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetSharpness(s32 handle, OrbisCameraChannel channel, u32 sharpness,
|
||||
void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraSetTrackerMode();
|
||||
s32 PS4_SYSV_ABI sceCameraSetUacModeInternal();
|
||||
s32 PS4_SYSV_ABI sceCameraSetVideoSync(s32 handle, OrbisCameraVideoSyncParameter* pVideoSync);
|
||||
s32 PS4_SYSV_ABI sceCameraSetVideoSyncInternal();
|
||||
s32 PS4_SYSV_ABI sceCameraSetWhiteBalance(s32 handle, OrbisCameraChannel channel,
|
||||
OrbisCameraWhiteBalance* pWhiteBalance, void* pOption);
|
||||
s32 PS4_SYSV_ABI sceCameraStart(s32 handle, OrbisCameraStartParameter* pParam);
|
||||
s32 PS4_SYSV_ABI sceCameraStartByHandle();
|
||||
s32 PS4_SYSV_ABI sceCameraStop(s32 handle);
|
||||
s32 PS4_SYSV_ABI sceCameraStopByHandle();
|
||||
|
||||
void RegisterlibSceCamera(Core::Loader::SymbolsResolver* sym);
|
||||
} // namespace Libraries::Camera
|
29
src/core/libraries/camera/camera_error.h
Normal file
29
src/core/libraries/camera/camera_error.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
constexpr int ORBIS_CAMERA_ERROR_PARAM = 0x802E0000;
|
||||
constexpr int ORBIS_CAMERA_ERROR_ALREADY_INIT = 0x802E0001;
|
||||
constexpr int ORBIS_CAMERA_ERROR_NOT_INIT = 0x802E0002;
|
||||
constexpr int ORBIS_CAMERA_ERROR_ALREADY_OPEN = 0x802E0003;
|
||||
constexpr int ORBIS_CAMERA_ERROR_NOT_OPEN = 0x802E0004;
|
||||
constexpr int ORBIS_CAMERA_ERROR_ALREADY_START = 0x802E0005;
|
||||
constexpr int ORBIS_CAMERA_ERROR_NOT_START = 0x802E0006;
|
||||
constexpr int ORBIS_CAMERA_ERROR_FORMAT_UNKNOWN = 0x802E0007;
|
||||
constexpr int ORBIS_CAMERA_ERROR_RESOLUTION_UNKNOWN = 0x802E0008;
|
||||
constexpr int ORBIS_CAMERA_ERROR_BAD_FRAMERATE = 0x802E0009;
|
||||
constexpr int ORBIS_CAMERA_ERROR_TIMEOUT = 0x802E000A;
|
||||
constexpr int ORBIS_CAMERA_ERROR_ATTRIBUTE_UNKNOWN = 0x802E000B;
|
||||
constexpr int ORBIS_CAMERA_ERROR_BUSY = 0x802E000C;
|
||||
constexpr int ORBIS_CAMERA_ERROR_UNKNOWN_CONFIG = 0x802E000D;
|
||||
constexpr int ORBIS_CAMERA_ERROR_ALREADY_READ = 0x802E000F;
|
||||
constexpr int ORBIS_CAMERA_ERROR_NOT_CONNECTED = 0x802E0010;
|
||||
constexpr int ORBIS_CAMERA_ERROR_NOT_SUPPORTED = 0x802E0011;
|
||||
constexpr int ORBIS_CAMERA_ERROR_INVALID_CONFIG = 0x802E0013;
|
||||
constexpr int ORBIS_CAMERA_ERROR_MAX_HANDLE = 0x802E0014;
|
||||
constexpr int ORBIS_CAMERA_ERROR_MAX_PROCESS = 0x802E00FB;
|
||||
constexpr int ORBIS_CAMERA_ERROR_COPYOUT_FAILED = 0x802E00FC;
|
||||
constexpr int ORBIS_CAMERA_ERROR_COPYIN_FAILED = 0x802E00FD;
|
||||
constexpr int ORBIS_CAMERA_ERROR_KPROC_CREATE = 0x802E00FE;
|
||||
constexpr int ORBIS_CAMERA_ERROR_FATAL = 0x802E00FF;
|
|
@ -19,7 +19,7 @@ namespace Libraries::Kernel {
|
|||
static s32* id_state;
|
||||
static s32 id_index;
|
||||
|
||||
s32 sceKernelAioInitializeImpl(void* p, s32 size) {
|
||||
s32 PS4_SYSV_ABI sceKernelAioInitializeImpl(void* p, s32 size) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <fmt/core.h>
|
||||
#include "common/string_literal.h"
|
||||
#include "common/types.h"
|
||||
#include "core/libraries/kernel/orbis_error.h"
|
||||
|
||||
|
@ -20,26 +17,21 @@ int ErrnoToSceKernelError(int e);
|
|||
void SetPosixErrno(int e);
|
||||
int* PS4_SYSV_ABI __Error();
|
||||
|
||||
template <StringLiteral name, class F, F f>
|
||||
struct WrapperImpl;
|
||||
template <class F, F f>
|
||||
struct OrbisWrapperImpl;
|
||||
|
||||
template <StringLiteral name, class R, class... Args, PS4_SYSV_ABI R (*f)(Args...)>
|
||||
struct WrapperImpl<name, PS4_SYSV_ABI R (*)(Args...), f> {
|
||||
static constexpr StringLiteral Name{name};
|
||||
template <class R, class... Args, PS4_SYSV_ABI R (*f)(Args...)>
|
||||
struct OrbisWrapperImpl<PS4_SYSV_ABI R (*)(Args...), f> {
|
||||
static R PS4_SYSV_ABI wrap(Args... args) {
|
||||
u32 ret = f(args...);
|
||||
if (ret != 0) {
|
||||
// LOG_ERROR(Lib_Kernel, "Function {} returned {}", std::string_view{name.value}, ret);
|
||||
ret += ORBIS_KERNEL_ERROR_UNKNOWN;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
template <StringLiteral name, class F, F f>
|
||||
constexpr auto OrbisWrapper = WrapperImpl<name, F, f>::wrap;
|
||||
|
||||
#define ORBIS(func) WrapperImpl<#func, decltype(&func), func>::wrap
|
||||
#define ORBIS(func) (Libraries::Kernel::OrbisWrapperImpl<decltype(&(func)), func>::wrap)
|
||||
|
||||
int* PS4_SYSV_ABI __Error();
|
||||
|
||||
|
|
|
@ -383,13 +383,12 @@ s32 PS4_SYSV_ABI sceKernelMemoryPoolExpand(u64 searchStart, u64 searchEnd, size_
|
|||
LOG_ERROR(Kernel_Vmm, "Provided address range is invalid!");
|
||||
return ORBIS_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
const bool is_in_range = searchEnd - searchStart >= len;
|
||||
if (len <= 0 || !Common::Is64KBAligned(len) || !is_in_range) {
|
||||
LOG_ERROR(Kernel_Vmm, "Provided address range is invalid!");
|
||||
if (len <= 0 || !Common::Is64KBAligned(len)) {
|
||||
LOG_ERROR(Kernel_Vmm, "Provided length {:#x} is invalid!", len);
|
||||
return ORBIS_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
if (alignment != 0 && !Common::Is64KBAligned(alignment)) {
|
||||
LOG_ERROR(Kernel_Vmm, "Alignment value is invalid!");
|
||||
LOG_ERROR(Kernel_Vmm, "Alignment {:#x} is invalid!", alignment);
|
||||
return ORBIS_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
if (physAddrOut == nullptr) {
|
||||
|
@ -397,8 +396,21 @@ s32 PS4_SYSV_ABI sceKernelMemoryPoolExpand(u64 searchStart, u64 searchEnd, size_
|
|||
return ORBIS_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
|
||||
const bool is_in_range = searchEnd - searchStart >= len;
|
||||
if (searchEnd <= searchStart || searchEnd < len || !is_in_range) {
|
||||
LOG_ERROR(Kernel_Vmm,
|
||||
"Provided address range is too small!"
|
||||
" searchStart = {:#x}, searchEnd = {:#x}, length = {:#x}",
|
||||
searchStart, searchEnd, len);
|
||||
return ORBIS_KERNEL_ERROR_ENOMEM;
|
||||
}
|
||||
|
||||
auto* memory = Core::Memory::Instance();
|
||||
PAddr phys_addr = memory->PoolExpand(searchStart, searchEnd, len, alignment);
|
||||
if (phys_addr == -1) {
|
||||
return ORBIS_KERNEL_ERROR_ENOMEM;
|
||||
}
|
||||
|
||||
*physAddrOut = static_cast<s64>(phys_addr);
|
||||
|
||||
LOG_INFO(Kernel_Vmm,
|
||||
|
@ -413,10 +425,6 @@ s32 PS4_SYSV_ABI sceKernelMemoryPoolReserve(void* addrIn, size_t len, size_t ali
|
|||
LOG_INFO(Kernel_Vmm, "addrIn = {}, len = {:#x}, alignment = {:#x}, flags = {:#x}",
|
||||
fmt::ptr(addrIn), len, alignment, flags);
|
||||
|
||||
if (addrIn == nullptr) {
|
||||
LOG_ERROR(Kernel_Vmm, "Address is invalid!");
|
||||
return ORBIS_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
if (len == 0 || !Common::Is2MBAligned(len)) {
|
||||
LOG_ERROR(Kernel_Vmm, "Map size is either zero or not 2MB aligned!");
|
||||
return ORBIS_KERNEL_ERROR_EINVAL;
|
||||
|
@ -469,9 +477,61 @@ s32 PS4_SYSV_ABI sceKernelMemoryPoolDecommit(void* addr, size_t len, int flags)
|
|||
|
||||
const VAddr pool_addr = reinterpret_cast<VAddr>(addr);
|
||||
auto* memory = Core::Memory::Instance();
|
||||
memory->PoolDecommit(pool_addr, len);
|
||||
|
||||
return ORBIS_OK;
|
||||
return memory->PoolDecommit(pool_addr, len);
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceKernelMemoryPoolBatch(const OrbisKernelMemoryPoolBatchEntry* entries, s32 count,
|
||||
s32* num_processed, s32 flags) {
|
||||
if (entries == nullptr) {
|
||||
return ORBIS_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
s32 result = ORBIS_OK;
|
||||
s32 processed = 0;
|
||||
|
||||
for (s32 i = 0; i < count; i++, processed++) {
|
||||
OrbisKernelMemoryPoolBatchEntry entry = entries[i];
|
||||
switch (entry.opcode) {
|
||||
case OrbisKernelMemoryPoolOpcode::Commit: {
|
||||
result = sceKernelMemoryPoolCommit(entry.commit_params.addr, entry.commit_params.len,
|
||||
entry.commit_params.type, entry.commit_params.prot,
|
||||
entry.flags);
|
||||
break;
|
||||
}
|
||||
case OrbisKernelMemoryPoolOpcode::Decommit: {
|
||||
result = sceKernelMemoryPoolDecommit(entry.decommit_params.addr,
|
||||
entry.decommit_params.len, entry.flags);
|
||||
break;
|
||||
}
|
||||
case OrbisKernelMemoryPoolOpcode::Protect: {
|
||||
result = sceKernelMProtect(entry.protect_params.addr, entry.protect_params.len,
|
||||
entry.protect_params.prot);
|
||||
break;
|
||||
}
|
||||
case OrbisKernelMemoryPoolOpcode::TypeProtect: {
|
||||
result = sceKernelMTypeProtect(
|
||||
entry.type_protect_params.addr, entry.type_protect_params.len,
|
||||
entry.type_protect_params.type, entry.type_protect_params.prot);
|
||||
break;
|
||||
}
|
||||
case OrbisKernelMemoryPoolOpcode::Move: {
|
||||
UNREACHABLE_MSG("Unimplemented sceKernelMemoryPoolBatch opcode Move");
|
||||
}
|
||||
default: {
|
||||
result = ORBIS_KERNEL_ERROR_EINVAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != ORBIS_OK) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (num_processed != nullptr) {
|
||||
*num_processed = processed;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceKernelMmap(void* addr, u64 len, int prot, int flags, int fd, size_t offset,
|
||||
|
@ -605,6 +665,7 @@ void RegisterMemory(Core::Loader::SymbolsResolver* sym) {
|
|||
LIB_FUNCTION("pU-QydtGcGY", "libkernel", 1, "libkernel", 1, 1, sceKernelMemoryPoolReserve);
|
||||
LIB_FUNCTION("Vzl66WmfLvk", "libkernel", 1, "libkernel", 1, 1, sceKernelMemoryPoolCommit);
|
||||
LIB_FUNCTION("LXo1tpFqJGs", "libkernel", 1, "libkernel", 1, 1, sceKernelMemoryPoolDecommit);
|
||||
LIB_FUNCTION("YN878uKRBbE", "libkernel", 1, "libkernel", 1, 1, sceKernelMemoryPoolBatch);
|
||||
|
||||
LIB_FUNCTION("BPE9s9vQQXo", "libkernel", 1, "libkernel", 1, 1, posix_mmap);
|
||||
LIB_FUNCTION("BPE9s9vQQXo", "libScePosix", 1, "libkernel", 1, 1, posix_mmap);
|
||||
|
|
|
@ -61,13 +61,15 @@ struct OrbisVirtualQueryInfo {
|
|||
size_t offset;
|
||||
s32 protection;
|
||||
s32 memory_type;
|
||||
u32 is_flexible : 1;
|
||||
u32 is_direct : 1;
|
||||
u32 is_stack : 1;
|
||||
u32 is_pooled : 1;
|
||||
u32 is_committed : 1;
|
||||
u8 is_flexible : 1;
|
||||
u8 is_direct : 1;
|
||||
u8 is_stack : 1;
|
||||
u8 is_pooled : 1;
|
||||
u8 is_committed : 1;
|
||||
char name[ORBIS_KERNEL_MAXIMUM_NAME_LENGTH];
|
||||
};
|
||||
static_assert(sizeof(OrbisVirtualQueryInfo) == 72,
|
||||
"OrbisVirtualQueryInfo struct size is incorrect");
|
||||
|
||||
struct OrbisKernelBatchMapEntry {
|
||||
void* start;
|
||||
|
@ -79,6 +81,48 @@ struct OrbisKernelBatchMapEntry {
|
|||
int operation;
|
||||
};
|
||||
|
||||
enum class OrbisKernelMemoryPoolOpcode : u32 {
|
||||
Commit = 1,
|
||||
Decommit = 2,
|
||||
Protect = 3,
|
||||
TypeProtect = 4,
|
||||
Move = 5,
|
||||
};
|
||||
|
||||
struct OrbisKernelMemoryPoolBatchEntry {
|
||||
OrbisKernelMemoryPoolOpcode opcode;
|
||||
u32 flags;
|
||||
union {
|
||||
struct {
|
||||
void* addr;
|
||||
u64 len;
|
||||
u8 prot;
|
||||
u8 type;
|
||||
} commit_params;
|
||||
struct {
|
||||
void* addr;
|
||||
u64 len;
|
||||
} decommit_params;
|
||||
struct {
|
||||
void* addr;
|
||||
u64 len;
|
||||
u8 prot;
|
||||
} protect_params;
|
||||
struct {
|
||||
void* addr;
|
||||
u64 len;
|
||||
u8 prot;
|
||||
u8 type;
|
||||
} type_protect_params;
|
||||
struct {
|
||||
void* dest_addr;
|
||||
void* src_addr;
|
||||
u64 len;
|
||||
} move_params;
|
||||
uintptr_t padding[3];
|
||||
};
|
||||
};
|
||||
|
||||
u64 PS4_SYSV_ABI sceKernelGetDirectMemorySize();
|
||||
int PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u64 len,
|
||||
u64 alignment, int memoryType, s64* physAddrOut);
|
||||
|
@ -128,6 +172,8 @@ s32 PS4_SYSV_ABI sceKernelMemoryPoolReserve(void* addrIn, size_t len, size_t ali
|
|||
void** addrOut);
|
||||
s32 PS4_SYSV_ABI sceKernelMemoryPoolCommit(void* addr, size_t len, int type, int prot, int flags);
|
||||
s32 PS4_SYSV_ABI sceKernelMemoryPoolDecommit(void* addr, size_t len, int flags);
|
||||
s32 PS4_SYSV_ABI sceKernelMemoryPoolBatch(const OrbisKernelMemoryPoolBatchEntry* entries, s32 count,
|
||||
s32* num_processed, s32 flags);
|
||||
|
||||
int PS4_SYSV_ABI sceKernelMunmap(void* addr, size_t len);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
this->func = std::move(func);
|
||||
PthreadAttrT attr{};
|
||||
posix_pthread_attr_init(&attr);
|
||||
posix_pthread_create(&thread, &attr, RunWrapper, this);
|
||||
posix_pthread_create(&thread, &attr, HOST_CALL(RunWrapper), this);
|
||||
posix_pthread_attr_destroy(&attr);
|
||||
}
|
||||
|
||||
|
|
|
@ -581,12 +581,9 @@ int PS4_SYSV_ABI posix_pthread_setaffinity_np(PthreadT thread, size_t cpusetsize
|
|||
return thread->SetAffinity(cpusetp);
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePthreadSetaffinity(PthreadT thread, const Cpuset mask) {
|
||||
int result = posix_pthread_setaffinity_np(thread, 0x10, &mask);
|
||||
if (result != 0) {
|
||||
return ErrnoToSceKernelError(result);
|
||||
}
|
||||
return 0;
|
||||
int PS4_SYSV_ABI scePthreadSetaffinity(PthreadT thread, const u64 mask) {
|
||||
const Cpuset cpuset = {.bits = mask};
|
||||
return posix_pthread_setaffinity_np(thread, sizeof(Cpuset), &cpuset);
|
||||
}
|
||||
|
||||
void RegisterThread(Core::Loader::SymbolsResolver* sym) {
|
||||
|
@ -635,7 +632,7 @@ void RegisterThread(Core::Loader::SymbolsResolver* sym) {
|
|||
LIB_FUNCTION("W0Hpm2X0uPE", "libkernel", 1, "libkernel", 1, 1, ORBIS(posix_pthread_setprio));
|
||||
LIB_FUNCTION("rNhWz+lvOMU", "libkernel", 1, "libkernel", 1, 1, _sceKernelSetThreadDtors);
|
||||
LIB_FUNCTION("6XG4B33N09g", "libkernel", 1, "libkernel", 1, 1, sched_yield);
|
||||
LIB_FUNCTION("bt3CTBKmGyI", "libkernel", 1, "libkernel", 1, 1, scePthreadSetaffinity)
|
||||
LIB_FUNCTION("bt3CTBKmGyI", "libkernel", 1, "libkernel", 1, 1, ORBIS(scePthreadSetaffinity));
|
||||
}
|
||||
|
||||
} // namespace Libraries::Kernel
|
||||
|
|
|
@ -159,6 +159,7 @@ enum class SchedPolicy : u32 {
|
|||
|
||||
struct Cpuset {
|
||||
u64 bits;
|
||||
u64 _reserved;
|
||||
};
|
||||
|
||||
struct PthreadAttr {
|
||||
|
@ -269,7 +270,7 @@ struct Pthread {
|
|||
bool no_cancel;
|
||||
bool cancel_async;
|
||||
bool cancelling;
|
||||
Cpuset sigmask;
|
||||
u64 sigmask;
|
||||
bool unblock_sigcancel;
|
||||
bool in_sigsuspend;
|
||||
bool force_exit;
|
||||
|
|
|
@ -243,7 +243,7 @@ int PS4_SYSV_ABI posix_pthread_attr_getaffinity_np(const PthreadAttrT* pattr, si
|
|||
if (attr->cpuset != nullptr)
|
||||
memcpy(cpusetp, attr->cpuset, std::min(cpusetsize, attr->cpusetsize));
|
||||
else
|
||||
memset(cpusetp, -1, sizeof(Cpuset));
|
||||
memset(cpusetp, -1, cpusetsize);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -259,30 +259,31 @@ int PS4_SYSV_ABI posix_pthread_attr_setaffinity_np(PthreadAttrT* pattr, size_t c
|
|||
if (cpusetsize == 0 || cpusetp == nullptr) {
|
||||
if (attr->cpuset != nullptr) {
|
||||
free(attr->cpuset);
|
||||
attr->cpuset = NULL;
|
||||
attr->cpuset = nullptr;
|
||||
attr->cpusetsize = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (attr->cpuset == nullptr) {
|
||||
attr->cpuset = (Cpuset*)calloc(1, sizeof(Cpuset));
|
||||
attr->cpuset = static_cast<Cpuset*>(calloc(1, sizeof(Cpuset)));
|
||||
attr->cpusetsize = sizeof(Cpuset);
|
||||
}
|
||||
memcpy(attr->cpuset, cpusetp, sizeof(Cpuset));
|
||||
memcpy(attr->cpuset, cpusetp, cpusetsize);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePthreadAttrGetaffinity(PthreadAttrT* param_1, Cpuset* mask) {
|
||||
int PS4_SYSV_ABI scePthreadAttrGetaffinity(PthreadAttrT* param_1, u64* mask) {
|
||||
Cpuset cpuset;
|
||||
const int ret = posix_pthread_attr_getaffinity_np(param_1, 0x10, &cpuset);
|
||||
const int ret = posix_pthread_attr_getaffinity_np(param_1, sizeof(Cpuset), &cpuset);
|
||||
if (ret == 0) {
|
||||
*mask = cpuset;
|
||||
*mask = cpuset.bits;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI scePthreadAttrSetaffinity(PthreadAttrT* attr, const Cpuset mask) {
|
||||
return posix_pthread_attr_setaffinity_np(attr, 0x10, &mask);
|
||||
int PS4_SYSV_ABI scePthreadAttrSetaffinity(PthreadAttrT* attr, const u64 mask) {
|
||||
const Cpuset cpuset = {.bits = mask};
|
||||
return posix_pthread_attr_setaffinity_np(attr, sizeof(Cpuset), &cpuset);
|
||||
}
|
||||
|
||||
void RegisterThreadAttr(Core::Loader::SymbolsResolver* sym) {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "core/libraries/audio/audioout.h"
|
||||
#include "core/libraries/audio3d/audio3d.h"
|
||||
#include "core/libraries/avplayer/avplayer.h"
|
||||
#include "core/libraries/camera/camera.h"
|
||||
#include "core/libraries/disc_map/disc_map.h"
|
||||
#include "core/libraries/game_live_streaming/gamelivestreaming.h"
|
||||
#include "core/libraries/gnmdriver/gnmdriver.h"
|
||||
|
@ -122,6 +123,7 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) {
|
|||
Libraries::DiscMap::RegisterlibSceDiscMap(sym);
|
||||
Libraries::Ulobjmgr::RegisterlibSceUlobjmgr(sym);
|
||||
Libraries::SigninDialog::RegisterlibSceSigninDialog(sym);
|
||||
Libraries::Camera::RegisterlibSceCamera(sym);
|
||||
}
|
||||
|
||||
} // namespace Libraries
|
||||
|
|
|
@ -3,13 +3,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/loader/elf.h"
|
||||
#include "core/loader/symbols_resolver.h"
|
||||
|
||||
#define W(foo) foo
|
||||
#include "core/tls.h"
|
||||
|
||||
#define LIB_FUNCTION(nid, lib, libversion, mod, moduleVersionMajor, moduleVersionMinor, function) \
|
||||
{ \
|
||||
|
@ -21,11 +17,11 @@
|
|||
sr.module_version_major = moduleVersionMajor; \
|
||||
sr.module_version_minor = moduleVersionMinor; \
|
||||
sr.type = Core::Loader::SymbolType::Function; \
|
||||
auto func = reinterpret_cast<u64>(function); \
|
||||
auto func = reinterpret_cast<u64>(HOST_CALL(function)); \
|
||||
sym->AddSymbol(sr, func); \
|
||||
}
|
||||
|
||||
#define LIB_OBJ(nid, lib, libversion, mod, moduleVersionMajor, moduleVersionMinor, function) \
|
||||
#define LIB_OBJ(nid, lib, libversion, mod, moduleVersionMajor, moduleVersionMinor, obj) \
|
||||
{ \
|
||||
Core::Loader::SymbolResolver sr{}; \
|
||||
sr.name = nid; \
|
||||
|
@ -35,8 +31,7 @@
|
|||
sr.module_version_major = moduleVersionMajor; \
|
||||
sr.module_version_minor = moduleVersionMinor; \
|
||||
sr.type = Core::Loader::SymbolType::Object; \
|
||||
auto func = reinterpret_cast<u64>(function); \
|
||||
sym->AddSymbol(sr, func); \
|
||||
sym->AddSymbol(sr, reinterpret_cast<u64>(obj)); \
|
||||
}
|
||||
|
||||
namespace Libraries {
|
||||
|
|
|
@ -17,10 +17,12 @@ int PS4_SYSV_ABI sceVideodecCreateDecoder(const OrbisVideodecConfigInfo* pCfgInf
|
|||
LOG_INFO(Lib_Videodec, "called");
|
||||
|
||||
if (!pCfgInfoIn || !pRsrcInfoIn || !pCtrlOut) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (pCfgInfoIn->thisSize != sizeof(OrbisVideodecConfigInfo) ||
|
||||
pRsrcInfoIn->thisSize != sizeof(OrbisVideodecResourceInfo)) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
|
||||
|
@ -37,15 +39,18 @@ int PS4_SYSV_ABI sceVideodecDecode(OrbisVideodecCtrl* pCtrlIn,
|
|||
OrbisVideodecPictureInfo* pPictureInfoOut) {
|
||||
LOG_TRACE(Lib_Videodec, "called");
|
||||
if (!pCtrlIn || !pInputDataIn || !pPictureInfoOut) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (pCtrlIn->thisSize != sizeof(OrbisVideodecCtrl) ||
|
||||
pFrameBufferInOut->thisSize != sizeof(OrbisVideodecFrameBuffer)) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
|
||||
VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle;
|
||||
if (!decoder) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid decoder handle");
|
||||
return ORBIS_VIDEODEC_ERROR_HANDLE;
|
||||
}
|
||||
return decoder->Decode(*pInputDataIn, *pFrameBufferInOut, *pPictureInfoOut);
|
||||
|
@ -56,6 +61,7 @@ int PS4_SYSV_ABI sceVideodecDeleteDecoder(OrbisVideodecCtrl* pCtrlIn) {
|
|||
|
||||
VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle;
|
||||
if (!decoder) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid decoder handle");
|
||||
return ORBIS_VIDEODEC_ERROR_HANDLE;
|
||||
}
|
||||
delete decoder;
|
||||
|
@ -68,15 +74,18 @@ int PS4_SYSV_ABI sceVideodecFlush(OrbisVideodecCtrl* pCtrlIn,
|
|||
LOG_INFO(Lib_Videodec, "called");
|
||||
|
||||
if (!pFrameBufferInOut || !pPictureInfoOut) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (pFrameBufferInOut->thisSize != sizeof(OrbisVideodecFrameBuffer) ||
|
||||
pPictureInfoOut->thisSize != sizeof(OrbisVideodecPictureInfo)) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
|
||||
VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle;
|
||||
if (!decoder) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid decoder handle");
|
||||
return ORBIS_VIDEODEC_ERROR_HANDLE;
|
||||
}
|
||||
return decoder->Flush(*pFrameBufferInOut, *pPictureInfoOut);
|
||||
|
@ -92,10 +101,12 @@ int PS4_SYSV_ABI sceVideodecQueryResourceInfo(const OrbisVideodecConfigInfo* pCf
|
|||
LOG_INFO(Lib_Videodec, "called");
|
||||
|
||||
if (!pCfgInfoIn || !pRsrcInfoOut) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (pCfgInfoIn->thisSize != sizeof(OrbisVideodecConfigInfo) ||
|
||||
pRsrcInfoOut->thisSize != sizeof(OrbisVideodecResourceInfo)) {
|
||||
LOG_ERROR(Lib_Videodec, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,9 +17,11 @@ sceVideodec2QueryComputeMemoryInfo(OrbisVideodec2ComputeMemoryInfo* computeMemIn
|
|||
LOG_INFO(Lib_Vdec2, "called");
|
||||
|
||||
if (!computeMemInfo) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (computeMemInfo->thisSize != sizeof(OrbisVideodec2ComputeMemoryInfo)) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
|
||||
|
@ -47,10 +49,12 @@ sceVideodec2QueryDecoderMemoryInfo(const OrbisVideodec2DecoderConfigInfo* decode
|
|||
LOG_INFO(Lib_Vdec2, "called");
|
||||
|
||||
if (!decoderCfgInfo || !decoderMemInfo) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (decoderCfgInfo->thisSize != sizeof(OrbisVideodec2DecoderConfigInfo) ||
|
||||
decoderMemInfo->thisSize != sizeof(OrbisVideodec2DecoderMemoryInfo)) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
|
||||
|
@ -74,10 +78,12 @@ s32 PS4_SYSV_ABI sceVideodec2CreateDecoder(const OrbisVideodec2DecoderConfigInfo
|
|||
LOG_INFO(Lib_Vdec2, "called");
|
||||
|
||||
if (!decoderCfgInfo || !decoderMemInfo || !decoder) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (decoderCfgInfo->thisSize != sizeof(OrbisVideodec2DecoderConfigInfo) ||
|
||||
decoderMemInfo->thisSize != sizeof(OrbisVideodec2DecoderMemoryInfo)) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
|
||||
|
@ -89,6 +95,7 @@ s32 PS4_SYSV_ABI sceVideodec2DeleteDecoder(OrbisVideodec2Decoder decoder) {
|
|||
LOG_INFO(Lib_Vdec2, "called");
|
||||
|
||||
if (!decoder) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC2_ERROR_DECODER_INSTANCE;
|
||||
}
|
||||
|
||||
|
@ -103,13 +110,16 @@ s32 PS4_SYSV_ABI sceVideodec2Decode(OrbisVideodec2Decoder decoder,
|
|||
LOG_TRACE(Lib_Vdec2, "called");
|
||||
|
||||
if (!decoder) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid decoder instance");
|
||||
return ORBIS_VIDEODEC2_ERROR_DECODER_INSTANCE;
|
||||
}
|
||||
if (!inputData || !frameBuffer || !outputInfo) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (inputData->thisSize != sizeof(OrbisVideodec2InputData) ||
|
||||
frameBuffer->thisSize != sizeof(OrbisVideodec2FrameBuffer)) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
|
||||
|
@ -122,13 +132,16 @@ s32 PS4_SYSV_ABI sceVideodec2Flush(OrbisVideodec2Decoder decoder,
|
|||
LOG_INFO(Lib_Vdec2, "called");
|
||||
|
||||
if (!decoder) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid decoder instance");
|
||||
return ORBIS_VIDEODEC2_ERROR_DECODER_INSTANCE;
|
||||
}
|
||||
if (!frameBuffer || !outputInfo) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (frameBuffer->thisSize != sizeof(OrbisVideodec2FrameBuffer) ||
|
||||
outputInfo->thisSize != sizeof(OrbisVideodec2OutputInfo)) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
|
||||
|
@ -139,6 +152,7 @@ s32 PS4_SYSV_ABI sceVideodec2Reset(OrbisVideodec2Decoder decoder) {
|
|||
LOG_INFO(Lib_Vdec2, "called");
|
||||
|
||||
if (!decoder) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid decoder instance");
|
||||
return ORBIS_VIDEODEC2_ERROR_DECODER_INSTANCE;
|
||||
}
|
||||
|
||||
|
@ -150,12 +164,15 @@ s32 PS4_SYSV_ABI sceVideodec2GetPictureInfo(const OrbisVideodec2OutputInfo* outp
|
|||
LOG_TRACE(Lib_Vdec2, "called");
|
||||
|
||||
if (!outputInfo) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (outputInfo->thisSize != sizeof(OrbisVideodec2OutputInfo)) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
if (outputInfo->pictureCount == 0 || gPictureInfos.empty()) {
|
||||
LOG_ERROR(Lib_Vdec2, "No picture info available");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
|
@ -163,6 +180,7 @@ s32 PS4_SYSV_ABI sceVideodec2GetPictureInfo(const OrbisVideodec2OutputInfo* outp
|
|||
OrbisVideodec2AvcPictureInfo* picInfo =
|
||||
static_cast<OrbisVideodec2AvcPictureInfo*>(p1stPictureInfoOut);
|
||||
if (picInfo->thisSize != sizeof(OrbisVideodec2AvcPictureInfo)) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
*picInfo = gPictureInfos.back();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue