From 0f80805d69f68e20a634555642bc5a10538638b4 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Sun, 15 Oct 2023 00:31:42 +0300 Subject: [PATCH] video_out fixes for openBor --- src/Core/PS4/HLE/Graphics/video_out.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Core/PS4/HLE/Graphics/video_out.cpp b/src/Core/PS4/HLE/Graphics/video_out.cpp index 107c254e..18b65c4c 100644 --- a/src/Core/PS4/HLE/Graphics/video_out.cpp +++ b/src/Core/PS4/HLE/Graphics/video_out.cpp @@ -1,7 +1,9 @@ #include "video_out.h" +#include #include #include +#include #include #include #include @@ -15,9 +17,7 @@ #include "Objects/video_out_ctx.h" #include "Util/Singleton.h" #include "emulator.h" -#include #include "graphics_render.h" -#include namespace HLE::Libs::Graphics::VideoOut { @@ -168,9 +168,8 @@ s32 PS4_SYSV_ABI sceVideoOutRegisterBuffers(s32 handle, s32 startIndex, void* co GPU::renderCreateCtx(); // try to calculate buffer size - u64 buffer_size = 0;//still calculation is probably partial or wrong :D - if (attribute->tilingMode == 0) - { + u64 buffer_size = 0; // still calculation is probably partial or wrong :D + if (attribute->tilingMode == 0) { buffer_size = 1920 * 1088 * 4; } else { buffer_size = 1920 * 1080 * 4; @@ -207,8 +206,7 @@ s32 PS4_SYSV_ABI sceVideoOutRegisterBuffers(s32 handle, s32 startIndex, void* co ctx->buffers[i + startIndex].buffer_size = buffer_size; ctx->buffers[i + startIndex].buffer_pitch = buffer_pitch; ctx->buffers[i + startIndex].buffer_render = static_cast( - GPU::memoryCreateObj( - 0, videoOut->getGraphicCtx(), nullptr, reinterpret_cast(addresses[i]), buffer_size, buffer_info)); + GPU::memoryCreateObj(0, videoOut->getGraphicCtx(), nullptr, reinterpret_cast(addresses[i]), buffer_size, buffer_info)); LOG_INFO_IF(log_file_videoout, "buffers[{}] = {}\n", i + startIndex, log_hex_full(reinterpret_cast(addresses[i]))); } @@ -233,7 +231,8 @@ s32 PS4_SYSV_ABI sceVideoOutSubmitFlip(s32 handle, s32 bufferIndex, s32 flipMode auto* ctx = videoOut->getCtx(handle); if (flipMode != 1) { - BREAKPOINT(); // only flipmode==1 is supported + // BREAKPOINT(); // only flipmode==1 is supported + LOG_TRACE_IF(log_file_videoout, "sceVideoOutSubmitFlip flipmode {}\n", bufferIndex);//openBOR needs 2 but seems to work } if (bufferIndex == -1) { BREAKPOINT(); // blank output not supported @@ -250,7 +249,7 @@ s32 PS4_SYSV_ABI sceVideoOutSubmitFlip(s32 handle, s32 bufferIndex, s32 flipMode LOG_TRACE_IF(log_file_videoout, "sceVideoOutSubmitFlip flip queue is full\n"); return SCE_VIDEO_OUT_ERROR_FLIP_QUEUE_FULL; } - HLE::Libs::LibSceGnmDriver::sceGnmFlushGarlic();//hackish should be done that neccesary for niko's homebrew + HLE::Libs::LibSceGnmDriver::sceGnmFlushGarlic(); // hackish should be done that neccesary for niko's homebrew return SCE_OK; } s32 PS4_SYSV_ABI sceVideoOutGetFlipStatus(s32 handle, SceVideoOutFlipStatus* status) { @@ -277,7 +276,7 @@ s32 PS4_SYSV_ABI sceVideoOutGetResolutionStatus(s32 handle, SceVideoOutResolutio } s32 PS4_SYSV_ABI sceVideoOutOpen(SceUserServiceUserId userId, s32 busType, s32 index, const void* param) { PRINT_FUNCTION_NAME(); - if (userId != SCE_USER_SERVICE_USER_ID_SYSTEM) { + if (userId != SCE_USER_SERVICE_USER_ID_SYSTEM && userId != 0) { BREAKPOINT(); } if (busType != SCE_VIDEO_OUT_BUS_TYPE_MAIN) {