From 3cbbdd5b2f5a60ff554d225ffef3997288ab9ea9 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 13 Jul 2023 18:36:03 +0300 Subject: [PATCH] patching sceVideoOut functions --- src/Core/PS4/HLE/LibSceGnmDriver.cpp | 12 +++++++ src/Core/PS4/HLE/LibSceGnmDriver.h | 8 +++++ src/Core/PS4/HLE/LibSceVideoOut.cpp | 49 ++++++++++++++++++++++++++++ src/Core/PS4/HLE/LibSceVideoOut.h | 18 ++++++++++ src/Core/PS4/HLE/Libs.cpp | 4 +++ 5 files changed, 91 insertions(+) diff --git a/src/Core/PS4/HLE/LibSceGnmDriver.cpp b/src/Core/PS4/HLE/LibSceGnmDriver.cpp index e69de29b..36085b79 100644 --- a/src/Core/PS4/HLE/LibSceGnmDriver.cpp +++ b/src/Core/PS4/HLE/LibSceGnmDriver.cpp @@ -0,0 +1,12 @@ +#include "LibSceGnmDriver.h" +#include "Libs.h" +#include "../Loader/Elf.h" + +namespace HLE::Libs::LibSceGnmDriver { + + void LibSceGnmDriver_Register(SymbolsResolver* sym) + { + + } + +}; \ No newline at end of file diff --git a/src/Core/PS4/HLE/LibSceGnmDriver.h b/src/Core/PS4/HLE/LibSceGnmDriver.h index e69de29b..ade8683a 100644 --- a/src/Core/PS4/HLE/LibSceGnmDriver.h +++ b/src/Core/PS4/HLE/LibSceGnmDriver.h @@ -0,0 +1,8 @@ +#pragma once +#include "../Loader/SymbolsResolver.h" + +namespace HLE::Libs::LibSceGnmDriver { + +void LibSceGnmDriver_Register(SymbolsResolver* sym); + +}; // namespace HLE::Libs::LibSceGnmDriver \ No newline at end of file diff --git a/src/Core/PS4/HLE/LibSceVideoOut.cpp b/src/Core/PS4/HLE/LibSceVideoOut.cpp index e69de29b..2d1d0e19 100644 --- a/src/Core/PS4/HLE/LibSceVideoOut.cpp +++ b/src/Core/PS4/HLE/LibSceVideoOut.cpp @@ -0,0 +1,49 @@ +#include "LibSceVideoOut.h" +#include "Libs.h" +#include "../Loader/Elf.h" + +namespace HLE::Libs::LibSceVideoOut { + + int32_t sceVideoOutGetFlipStatus(int32_t handle /*, SceVideoOutFlipStatus* status*/){ + return 0; + } + + int32_t sceVideoOutSubmitFlip(int32_t handle, int32_t bufferIndex, int32_t flipMode,int64_t flipArg){ + return 0; + } + int32_t sceVideoOutRegisterBuffers(int32_t handle, int32_t startIndex, void* const* addresses, int32_t bufferNum /*, + const SceVideoOutBufferAttribute* attribute*/) { + return 0; + } + int32_t sceVideoOutAddFlipEvent(/*SceKernelEqueue eq,*/ int32_t handle, void* udata) { + return 0; + } + int32_t sceVideoOutSetFlipRate(int32_t handle, int32_t rate) { + return 0; + } + 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*/) + { return 0; + } + int32_t sceVideoOutOpen(/* SceUserServiceUserId userId,*/ int32_t busType, int32_t index, const void* param) { return 0; + } + int32_t sceVideoOutIsFlipPending(int32_t handle) { return 0; + } + void LibSceVideoOut_Register(SymbolsResolver* sym) + { + LIB_FUNCTION("SbU3dwp80lQ", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutGetFlipStatus); + LIB_FUNCTION("U46NwOiJpys", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutSubmitFlip); + LIB_FUNCTION("w3BY+tAEiQY", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutRegisterBuffers); + LIB_FUNCTION("HXzjK9yI30k", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutAddFlipEvent); + LIB_FUNCTION("CBiu4mCE1DA", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutSetFlipRate); + LIB_FUNCTION("i6-sR91Wt-4", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutSetBufferAttribute); + LIB_FUNCTION("6kPnj51T62Y", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutGetResolutionStatus); + LIB_FUNCTION("Up36PTk687E", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutOpen); + LIB_FUNCTION("zgXifHT9ErY", "libSceVideoOut", 1, "libSceVideoOut", 0, 0, sceVideoOutIsFlipPending); + } + +}; \ No newline at end of file diff --git a/src/Core/PS4/HLE/LibSceVideoOut.h b/src/Core/PS4/HLE/LibSceVideoOut.h index e69de29b..6f54daf9 100644 --- a/src/Core/PS4/HLE/LibSceVideoOut.h +++ b/src/Core/PS4/HLE/LibSceVideoOut.h @@ -0,0 +1,18 @@ +#pragma once +#include "../Loader/SymbolsResolver.h" + +namespace HLE::Libs::LibSceVideoOut { + +void LibSceVideoOut_Register(SymbolsResolver* sym); +//functions +int32_t sceVideoOutGetFlipStatus(int32_t handle /*, SceVideoOutFlipStatus* status*/); +int32_t sceVideoOutSubmitFlip(int32_t handle, int32_t bufferIndex, int32_t flipMode, int64_t flipArg); +int32_t sceVideoOutRegisterBuffers(int32_t handle, int32_t startIndex, void* const* addresses, int32_t bufferNum /*,const SceVideoOutBufferAttribute* attribute*/); +int32_t sceVideoOutAddFlipEvent(/*SceKernelEqueue eq,*/ int32_t handle, void* udata); +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 sceVideoOutIsFlipPending(int32_t handle); +}; // namespace HLE::Libs::LibSceVideoOut \ No newline at end of file diff --git a/src/Core/PS4/HLE/Libs.cpp b/src/Core/PS4/HLE/Libs.cpp index 66f319f6..09f1d85b 100644 --- a/src/Core/PS4/HLE/Libs.cpp +++ b/src/Core/PS4/HLE/Libs.cpp @@ -1,6 +1,8 @@ #include "Libs.h" #include "LibC.h" #include "LibKernel.h" +#include "LibSceVideoOut.h" +#include "LibSceGnmDriver.h" namespace HLE::Libs { @@ -8,5 +10,7 @@ namespace HLE::Libs { { LibC::LibC_Register(sym); LibKernel::LibKernel_Register(sym); + LibSceVideoOut::LibSceVideoOut_Register(sym); + LibSceGnmDriver::LibSceGnmDriver_Register(sym); } } \ No newline at end of file