diff --git a/src/core/libraries/videoout/driver.h b/src/core/libraries/videoout/driver.h index fac12135..0c1ea582 100644 --- a/src/core/libraries/videoout/driver.h +++ b/src/core/libraries/videoout/driver.h @@ -19,6 +19,8 @@ struct VideoOutPort { bool is_open = false; SceVideoOutResolutionStatus resolution; std::array buffer_slots; + std::array buffer_labels; // should be contiguous in memory + static_assert(sizeof(buffer_labels[0]) == 8u); std::array groups; FlipStatus flip_status; SceVideoOutVblankStatus vblank_status; diff --git a/src/core/libraries/videoout/video_out.cpp b/src/core/libraries/videoout/video_out.cpp index 363bd538..d6acd86c 100644 --- a/src/core/libraries/videoout/video_out.cpp +++ b/src/core/libraries/videoout/video_out.cpp @@ -210,6 +210,12 @@ void Vblank() { return driver->Vblank(); } +void sceVideoOutGetBufferLabelAddress(s32 handle, uintptr_t* label_addr) { + auto* port = driver->GetPort(handle); + ASSERT(port); + *label_addr = reinterpret_cast(port->buffer_labels.data()); +} + void RegisterLib(Core::Loader::SymbolsResolver* sym) { driver = std::make_unique(Config::getScreenWidth(), Config::getScreenHeight()); diff --git a/src/core/libraries/videoout/video_out.h b/src/core/libraries/videoout/video_out.h index 951eb6a5..9c7227e6 100644 --- a/src/core/libraries/videoout/video_out.h +++ b/src/core/libraries/videoout/video_out.h @@ -102,6 +102,8 @@ s32 PS4_SYSV_ABI sceVideoOutClose(s32 handle); void Flip(std::chrono::microseconds micros); void Vblank(); +void sceVideoOutGetBufferLabelAddress(s32 handle, uintptr_t* label_addr); + void RegisterLib(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::VideoOut