From fec7f6cdc2bdcc5c768a681df98925bed5e138da Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 18 Apr 2024 22:31:31 +0300 Subject: [PATCH] added sceVideoOutGetVblankStatus --- src/core/libraries/videoout/video_out.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/core/libraries/videoout/video_out.cpp b/src/core/libraries/videoout/video_out.cpp index d60aaaa9..363bd538 100644 --- a/src/core/libraries/videoout/video_out.cpp +++ b/src/core/libraries/videoout/video_out.cpp @@ -144,6 +144,21 @@ s32 PS4_SYSV_ABI sceVideoOutGetFlipStatus(s32 handle, FlipStatus* status) { return ORBIS_OK; } +s32 PS4_SYSV_ABI sceVideoOutGetVblankStatus(int handle, SceVideoOutVblankStatus* status) { + if (status == nullptr) { + return SCE_VIDEO_OUT_ERROR_INVALID_ADDRESS; + } + + auto* port = driver->GetPort(handle); + if (!port) { + LOG_ERROR(Lib_VideoOut, "Invalid port handle = {}", handle); + return ORBIS_VIDEO_OUT_ERROR_INVALID_HANDLE; + } + + *status = port->vblank_status; + return ORBIS_OK; +} + s32 PS4_SYSV_ABI sceVideoOutGetResolutionStatus(s32 handle, SceVideoOutResolutionStatus* status) { LOG_INFO(Lib_VideoOut, "called"); *status = driver->GetPort(handle)->resolution; @@ -217,6 +232,8 @@ void RegisterLib(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("N5KDtkIjjJ4", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutUnregisterBuffers); LIB_FUNCTION("uquVH4-Du78", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutClose); + LIB_FUNCTION("1FZBKy8HeNU", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, + sceVideoOutGetVblankStatus); // openOrbis appears to have libSceVideoOut_v1 module libSceVideoOut_v1.1 LIB_FUNCTION("Up36PTk687E", "libSceVideoOut", 1, "libSceVideoOut", 1, 1, sceVideoOutOpen);