libSceHmd Stubs (#2355)

* Add generated libSceHmd stubs

* Implement ReprojectionQuery functions

These constant returns come from decompiling libSceHmd.

* Clang

* Clang
This commit is contained in:
Stephen Miller 2025-02-05 09:24:53 -06:00 committed by GitHub
parent e757063d31
commit ecfc940381
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1431 additions and 0 deletions

View file

@ -486,6 +486,10 @@ set(ZLIB_LIB src/core/libraries/zlib/zlib.cpp
src/core/libraries/zlib/zlib_error.h
)
set(VR_LIBS src/core/libraries/hmd/hmd.cpp
src/core/libraries/hmd/hmd.h
)
set(MISC_LIBS src/core/libraries/screenshot/screenshot.cpp
src/core/libraries/screenshot/screenshot.h
src/core/libraries/move/move.cpp
@ -663,6 +667,7 @@ set(CORE src/core/aerolib/stubs.cpp
${IME_LIB}
${FIBER_LIB}
${VDEC_LIB}
${VR_LIBS}
${DEV_TOOLS}
src/core/debug_state.cpp
src/core/debug_state.h

View file

@ -134,6 +134,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
SUB(Lib, WebBrowserDialog) \
SUB(Lib, NpParty) \
SUB(Lib, Zlib) \
SUB(Lib, Hmd) \
CLS(Frontend) \
CLS(Render) \
SUB(Render, Vulkan) \

View file

@ -101,6 +101,7 @@ enum class Class : u8 {
Lib_WebBrowserDialog, ///< The LibSceWebBrowserDialog implementation
Lib_NpParty, ///< The LibSceNpParty implementation
Lib_Zlib, ///< The LibSceZlib implementation.
Lib_Hmd, ///< The LibSceHmd implementation.
Frontend, ///< Emulator UI
Render, ///< Video Core
Render_Vulkan, ///< Vulkan backend

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,203 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Core::Loader {
class SymbolsResolver;
}
namespace Libraries::Hmd {
s32 PS4_SYSV_ABI sceHmdReprojectionStartMultilayer();
s32 PS4_SYSV_ABI sceHmdDistortionGet2dVrCommand();
s32 PS4_SYSV_ABI sceHmdDistortionGetCompoundEyeCorrectionCommand();
s32 PS4_SYSV_ABI sceHmdDistortionGetCorrectionCommand();
s32 PS4_SYSV_ABI sceHmdDistortionGetWideNearCorrectionCommand();
s32 PS4_SYSV_ABI sceHmdDistortionGetWorkMemoryAlign();
s32 PS4_SYSV_ABI sceHmdDistortionGetWorkMemorySize();
s32 PS4_SYSV_ABI sceHmdDistortionInitialize();
s32 PS4_SYSV_ABI sceHmdDistortionSetOutputMinColor();
s32 PS4_SYSV_ABI Func_B26430EA74FC3DC0();
s32 PS4_SYSV_ABI sceHmdClose();
s32 PS4_SYSV_ABI sceHmdGet2DEyeOffset();
s32 PS4_SYSV_ABI sceHmdGet2dVrCommand();
s32 PS4_SYSV_ABI sceHmdGetAssyError();
s32 PS4_SYSV_ABI sceHmdGetDeviceInformation();
s32 PS4_SYSV_ABI sceHmdGetDeviceInformationByHandle();
s32 PS4_SYSV_ABI sceHmdGetDistortionCorrectionCommand();
s32 PS4_SYSV_ABI sceHmdGetDistortionParams();
s32 PS4_SYSV_ABI sceHmdGetDistortionWorkMemoryAlign();
s32 PS4_SYSV_ABI sceHmdGetDistortionWorkMemorySize();
s32 PS4_SYSV_ABI sceHmdGetFieldOfView();
s32 PS4_SYSV_ABI sceHmdGetInertialSensorData();
s32 PS4_SYSV_ABI sceHmdGetWideNearDistortionCorrectionCommand();
s32 PS4_SYSV_ABI sceHmdInitialize();
s32 PS4_SYSV_ABI sceHmdInitialize315();
s32 PS4_SYSV_ABI sceHmdInternal3dAudioClose();
s32 PS4_SYSV_ABI sceHmdInternal3dAudioOpen();
s32 PS4_SYSV_ABI sceHmdInternal3dAudioSendData();
s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenClose();
s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenGetAudioStatus();
s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenGetFadeState();
s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenGetVideoStatus();
s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenOpen();
s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenSendAudio();
s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenSendVideo();
s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenSetFadeAndSwitch();
s32 PS4_SYSV_ABI sceHmdInternalBindDeviceWithUserId();
s32 PS4_SYSV_ABI sceHmdInternalCheckDeviceModelMk3();
s32 PS4_SYSV_ABI sceHmdInternalCheckS3dPassModeAvailable();
s32 PS4_SYSV_ABI sceHmdInternalCrashReportCancel();
s32 PS4_SYSV_ABI sceHmdInternalCrashReportClose();
s32 PS4_SYSV_ABI sceHmdInternalCrashReportOpen();
s32 PS4_SYSV_ABI sceHmdInternalCrashReportReadData();
s32 PS4_SYSV_ABI sceHmdInternalCrashReportReadDataSize();
s32 PS4_SYSV_ABI sceHmdInternalCreateSharedMemory();
s32 PS4_SYSV_ABI sceHmdInternalDfuCheckAfterPvt();
s32 PS4_SYSV_ABI sceHmdInternalDfuCheckPartialUpdateAvailable();
s32 PS4_SYSV_ABI sceHmdInternalDfuClose();
s32 PS4_SYSV_ABI sceHmdInternalDfuGetStatus();
s32 PS4_SYSV_ABI sceHmdInternalDfuOpen();
s32 PS4_SYSV_ABI sceHmdInternalDfuReset();
s32 PS4_SYSV_ABI sceHmdInternalDfuSend();
s32 PS4_SYSV_ABI sceHmdInternalDfuSendSize();
s32 PS4_SYSV_ABI sceHmdInternalDfuSetMode();
s32 PS4_SYSV_ABI sceHmdInternalDfuStart();
s32 PS4_SYSV_ABI sceHmdInternalEventInitialize();
s32 PS4_SYSV_ABI sceHmdInternalGetBrightness();
s32 PS4_SYSV_ABI sceHmdInternalGetCrashDumpInfo();
s32 PS4_SYSV_ABI sceHmdInternalGetDebugMode();
s32 PS4_SYSV_ABI sceHmdInternalGetDebugSocialScreenMode();
s32 PS4_SYSV_ABI sceHmdInternalGetDebugTextMode();
s32 PS4_SYSV_ABI sceHmdInternalGetDefaultLedData();
s32 PS4_SYSV_ABI sceHmdInternalGetDemoMode();
s32 PS4_SYSV_ABI sceHmdInternalGetDeviceInformation();
s32 PS4_SYSV_ABI sceHmdInternalGetDeviceInformationByHandle();
s32 PS4_SYSV_ABI sceHmdInternalGetDeviceStatus();
s32 PS4_SYSV_ABI sceHmdInternalGetEyeStatus();
s32 PS4_SYSV_ABI sceHmdInternalGetHmuOpticalParam();
s32 PS4_SYSV_ABI sceHmdInternalGetHmuPowerStatusForDebug();
s32 PS4_SYSV_ABI sceHmdInternalGetHmuSerialNumber();
s32 PS4_SYSV_ABI sceHmdInternalGetIPD();
s32 PS4_SYSV_ABI sceHmdInternalGetIpdSettingEnableForSystemService();
s32 PS4_SYSV_ABI sceHmdInternalGetPuBuildNumber();
s32 PS4_SYSV_ABI sceHmdInternalGetPuPositionParam();
s32 PS4_SYSV_ABI sceHmdInternalGetPuRevision();
s32 PS4_SYSV_ABI sceHmdInternalGetPUSerialNumber();
s32 PS4_SYSV_ABI sceHmdInternalGetPUVersion();
s32 PS4_SYSV_ABI sceHmdInternalGetRequiredPUPVersion();
s32 PS4_SYSV_ABI sceHmdInternalGetStatusReport();
s32 PS4_SYSV_ABI sceHmdInternalGetTv4kCapability();
s32 PS4_SYSV_ABI sceHmdInternalGetVirtualDisplayDepth();
s32 PS4_SYSV_ABI sceHmdInternalGetVirtualDisplayHeight();
s32 PS4_SYSV_ABI sceHmdInternalGetVirtualDisplaySize();
s32 PS4_SYSV_ABI sceHmdInternalGetVr2dData();
s32 PS4_SYSV_ABI sceHmdInternalIsCommonDlgMiniAppVr2d();
s32 PS4_SYSV_ABI sceHmdInternalIsCommonDlgVr2d();
s32 PS4_SYSV_ABI sceHmdInternalIsGameVr2d();
s32 PS4_SYSV_ABI sceHmdInternalIsMiniAppVr2d();
s32 PS4_SYSV_ABI sceHmdInternalMapSharedMemory();
s32 PS4_SYSV_ABI sceHmdInternalMirroringModeSetAspect();
s32 PS4_SYSV_ABI sceHmdInternalMirroringModeSetAspectDebug();
s32 PS4_SYSV_ABI sceHmdInternalMmapGetCount();
s32 PS4_SYSV_ABI sceHmdInternalMmapGetModeId();
s32 PS4_SYSV_ABI sceHmdInternalMmapGetSensorCalibrationData();
s32 PS4_SYSV_ABI sceHmdInternalMmapIsConnect();
s32 PS4_SYSV_ABI sceHmdInternalPushVr2dData();
s32 PS4_SYSV_ABI sceHmdInternalRegisterEventCallback();
s32 PS4_SYSV_ABI sceHmdInternalResetInertialSensor();
s32 PS4_SYSV_ABI sceHmdInternalResetLedForVrTracker();
s32 PS4_SYSV_ABI sceHmdInternalResetLedForVsh();
s32 PS4_SYSV_ABI sceHmdInternalSeparateModeClose();
s32 PS4_SYSV_ABI sceHmdInternalSeparateModeGetAudioStatus();
s32 PS4_SYSV_ABI sceHmdInternalSeparateModeGetVideoStatus();
s32 PS4_SYSV_ABI sceHmdInternalSeparateModeOpen();
s32 PS4_SYSV_ABI sceHmdInternalSeparateModeSendAudio();
s32 PS4_SYSV_ABI sceHmdInternalSeparateModeSendVideo();
s32 PS4_SYSV_ABI sceHmdInternalSetBrightness();
s32 PS4_SYSV_ABI sceHmdInternalSetCrashReportCommand();
s32 PS4_SYSV_ABI sceHmdInternalSetDebugGpo();
s32 PS4_SYSV_ABI sceHmdInternalSetDebugMode();
s32 PS4_SYSV_ABI sceHmdInternalSetDebugSocialScreenMode();
s32 PS4_SYSV_ABI sceHmdInternalSetDebugTextMode();
s32 PS4_SYSV_ABI sceHmdInternalSetDefaultLedData();
s32 PS4_SYSV_ABI sceHmdInternalSetDemoMode();
s32 PS4_SYSV_ABI sceHmdInternalSetDeviceConnection();
s32 PS4_SYSV_ABI sceHmdInternalSetForcedCrash();
s32 PS4_SYSV_ABI sceHmdInternalSetHmuPowerControl();
s32 PS4_SYSV_ABI sceHmdInternalSetHmuPowerControlForDebug();
s32 PS4_SYSV_ABI sceHmdInternalSetIPD();
s32 PS4_SYSV_ABI sceHmdInternalSetIpdSettingEnableForSystemService();
s32 PS4_SYSV_ABI sceHmdInternalSetLedOn();
s32 PS4_SYSV_ABI sceHmdInternalSetM2LedBrightness();
s32 PS4_SYSV_ABI sceHmdInternalSetM2LedOn();
s32 PS4_SYSV_ABI sceHmdInternalSetPortConnection();
s32 PS4_SYSV_ABI sceHmdInternalSetPortStatus();
s32 PS4_SYSV_ABI sceHmdInternalSetS3dPassMode();
s32 PS4_SYSV_ABI sceHmdInternalSetSidetone();
s32 PS4_SYSV_ABI sceHmdInternalSetUserType();
s32 PS4_SYSV_ABI sceHmdInternalSetVirtualDisplayDepth();
s32 PS4_SYSV_ABI sceHmdInternalSetVirtualDisplayHeight();
s32 PS4_SYSV_ABI sceHmdInternalSetVirtualDisplaySize();
s32 PS4_SYSV_ABI sceHmdInternalSetVRMode();
s32 PS4_SYSV_ABI sceHmdInternalSocialScreenGetFadeState();
s32 PS4_SYSV_ABI sceHmdInternalSocialScreenSetFadeAndSwitch();
s32 PS4_SYSV_ABI sceHmdInternalSocialScreenSetOutput();
s32 PS4_SYSV_ABI sceHmdOpen();
s32 PS4_SYSV_ABI sceHmdReprojectionAddDisplayBuffer();
s32 PS4_SYSV_ABI sceHmdReprojectionClearUserEventEnd();
s32 PS4_SYSV_ABI sceHmdReprojectionClearUserEventStart();
s32 PS4_SYSV_ABI sceHmdReprojectionDebugGetLastInfo();
s32 PS4_SYSV_ABI sceHmdReprojectionDebugGetLastInfoMultilayer();
s32 PS4_SYSV_ABI sceHmdReprojectionFinalize();
s32 PS4_SYSV_ABI sceHmdReprojectionFinalizeCapture();
s32 PS4_SYSV_ABI sceHmdReprojectionInitialize();
s32 PS4_SYSV_ABI sceHmdReprojectionInitializeCapture();
s32 PS4_SYSV_ABI sceHmdReprojectionQueryGarlicBuffAlign();
s32 PS4_SYSV_ABI sceHmdReprojectionQueryGarlicBuffSize();
s32 PS4_SYSV_ABI sceHmdReprojectionQueryOnionBuffAlign();
s32 PS4_SYSV_ABI sceHmdReprojectionQueryOnionBuffSize();
s32 PS4_SYSV_ABI sceHmdReprojectionSetCallback();
s32 PS4_SYSV_ABI sceHmdReprojectionSetDisplayBuffers();
s32 PS4_SYSV_ABI sceHmdReprojectionSetOutputMinColor();
s32 PS4_SYSV_ABI sceHmdReprojectionSetUserEventEnd();
s32 PS4_SYSV_ABI sceHmdReprojectionSetUserEventStart();
s32 PS4_SYSV_ABI sceHmdReprojectionStart();
s32 PS4_SYSV_ABI sceHmdReprojectionStart2dVr();
s32 PS4_SYSV_ABI sceHmdReprojectionStartCapture();
s32 PS4_SYSV_ABI sceHmdReprojectionStartLiveCapture();
s32 PS4_SYSV_ABI sceHmdReprojectionStartMultilayer2();
s32 PS4_SYSV_ABI sceHmdReprojectionStartWideNear();
s32 PS4_SYSV_ABI sceHmdReprojectionStartWideNearWithOverlay();
s32 PS4_SYSV_ABI sceHmdReprojectionStartWithOverlay();
s32 PS4_SYSV_ABI sceHmdReprojectionStop();
s32 PS4_SYSV_ABI sceHmdReprojectionStopCapture();
s32 PS4_SYSV_ABI sceHmdReprojectionStopLiveCapture();
s32 PS4_SYSV_ABI sceHmdReprojectionUnsetCallback();
s32 PS4_SYSV_ABI sceHmdReprojectionUnsetDisplayBuffers();
s32 PS4_SYSV_ABI sceHmdTerminate();
s32 PS4_SYSV_ABI Func_202D0D1A687FCD2F();
s32 PS4_SYSV_ABI Func_358DBF818A3D8A12();
s32 PS4_SYSV_ABI Func_5CCBADA76FE8F40E();
s32 PS4_SYSV_ABI Func_63D403167DC08CF0();
s32 PS4_SYSV_ABI Func_69383B2B4E3AEABF();
s32 PS4_SYSV_ABI Func_791560C32F4F6D68();
s32 PS4_SYSV_ABI Func_7C955961EA85B6D3();
s32 PS4_SYSV_ABI Func_9952277839236BA7();
s32 PS4_SYSV_ABI Func_9A276E739E54EEAF();
s32 PS4_SYSV_ABI Func_9E501994E289CBE7();
s32 PS4_SYSV_ABI Func_A31A0320D80EAD99();
s32 PS4_SYSV_ABI Func_A31F4DA8B3BD2E12();
s32 PS4_SYSV_ABI Func_A92D7C23AC364993();
s32 PS4_SYSV_ABI Func_ADCCC25CB876FDBE();
s32 PS4_SYSV_ABI Func_B16652641FE69F0E();
s32 PS4_SYSV_ABI Func_B614F290B67FB59B();
s32 PS4_SYSV_ABI Func_B9A6FA0735EC7E49();
s32 PS4_SYSV_ABI Func_FC193BD653F2AF2E();
s32 PS4_SYSV_ABI Func_FF2E0E53015FE231();
void RegisterlibSceHmd(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::Hmd

View file

@ -11,6 +11,7 @@
#include "core/libraries/disc_map/disc_map.h"
#include "core/libraries/game_live_streaming/gamelivestreaming.h"
#include "core/libraries/gnmdriver/gnmdriver.h"
#include "core/libraries/hmd/hmd.h"
#include "core/libraries/ime/error_dialog.h"
#include "core/libraries/ime/ime.h"
#include "core/libraries/ime/ime_dialog.h"
@ -113,6 +114,7 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) {
Libraries::WebBrowserDialog::RegisterlibSceWebBrowserDialog(sym);
Libraries::NpParty::RegisterlibSceNpParty(sym);
Libraries::Zlib::RegisterlibSceZlib(sym);
Libraries::Hmd::RegisterlibSceHmd(sym);
}
} // namespace Libraries