From d8140ca016e185dde95b64913296e91de51f139c Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 20 Jul 2023 17:53:51 +0300 Subject: [PATCH] added atexit() HLE function , sceVideoOutOpen appears to get invalid parameters --- src/Core/PS4/HLE/LibC.cpp | 10 ++++++---- src/Core/PS4/HLE/LibSceVideoOut.cpp | 21 ++++++++++++++++++++- src/Core/PS4/HLE/LibSceVideoOut.h | 4 +++- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/Core/PS4/HLE/LibC.cpp b/src/Core/PS4/HLE/LibC.cpp index 43d27c69..e39dc278 100644 --- a/src/Core/PS4/HLE/LibC.cpp +++ b/src/Core/PS4/HLE/LibC.cpp @@ -37,10 +37,12 @@ namespace HLE::Libs::LibC { } static int atexit(void (*func)()) { - for (;;) { - printf("we reached here too!\n"); - } - return 0; + int rt = ::atexit(func); + if (rt != 0) + { + __debugbreak(); + } + return rt; } void LibC_Register(SymbolsResolver* sym) diff --git a/src/Core/PS4/HLE/LibSceVideoOut.cpp b/src/Core/PS4/HLE/LibSceVideoOut.cpp index 2d1d0e19..419059db 100644 --- a/src/Core/PS4/HLE/LibSceVideoOut.cpp +++ b/src/Core/PS4/HLE/LibSceVideoOut.cpp @@ -29,7 +29,26 @@ namespace HLE::Libs::LibSceVideoOut { int32_t sceVideoOutGetResolutionStatus(int32_t handle /*, SceVideoOutResolutionStatus* status*/) { return 0; } - int32_t sceVideoOutOpen(/* SceUserServiceUserId userId,*/ int32_t busType, int32_t index, const void* param) { return 0; + + + int32_t sceVideoOutOpen(SceUserServiceUserId userId, int32_t busType, int32_t index, const void* param) + { + if (busType != 0) + { + __debugbreak(); + } + if (index != 0) + { + __debugbreak(); + } + if (param != nullptr) + { + __debugbreak(); + } + for (;;) { + printf("videoopen\n"); + } + return 0; } int32_t sceVideoOutIsFlipPending(int32_t handle) { return 0; } diff --git a/src/Core/PS4/HLE/LibSceVideoOut.h b/src/Core/PS4/HLE/LibSceVideoOut.h index 6f54daf9..672184ab 100644 --- a/src/Core/PS4/HLE/LibSceVideoOut.h +++ b/src/Core/PS4/HLE/LibSceVideoOut.h @@ -3,6 +3,8 @@ namespace HLE::Libs::LibSceVideoOut { +typedef int32_t SceUserServiceUserId; //TODO move it to proper place + void LibSceVideoOut_Register(SymbolsResolver* sym); //functions int32_t sceVideoOutGetFlipStatus(int32_t handle /*, SceVideoOutFlipStatus* status*/); @@ -13,6 +15,6 @@ int32_t sceVideoOutSetFlipRate(int32_t handle, int32_t rate); void sceVideoOutSetBufferAttribute(/* SceVideoOutBufferAttribute* attribute,*/ uint32_t pixelFormat, uint32_t tilingMode, uint32_t aspectRatio, uint32_t width, uint32_t height, uint32_t pitchInPixel); int32_t sceVideoOutGetResolutionStatus(int32_t handle /*, SceVideoOutResolutionStatus* status*/); -int32_t sceVideoOutOpen(/* SceUserServiceUserId userId,*/ int32_t busType, int32_t index, const void* param); +int32_t sceVideoOutOpen(SceUserServiceUserId userId,int32_t busType, int32_t index, const void* param); int32_t sceVideoOutIsFlipPending(int32_t handle); }; // namespace HLE::Libs::LibSceVideoOut \ No newline at end of file