From 538276437ad4f6c34c488963fdae5727ea9ae0b8 Mon Sep 17 00:00:00 2001 From: Stefanos Kornilios Mitsis Poiitidis Date: Thu, 5 Oct 2023 23:13:58 +0300 Subject: [PATCH] fixing mmap --- src/Core/PS4/HLE/LibKernel.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Core/PS4/HLE/LibKernel.cpp b/src/Core/PS4/HLE/LibKernel.cpp index 431240110..d3819855d 100644 --- a/src/Core/PS4/HLE/LibKernel.cpp +++ b/src/Core/PS4/HLE/LibKernel.cpp @@ -155,17 +155,18 @@ int PS4_SYSV_ABI sceKernelMmap(void* addr, u64 len, int prot, int flags, int fd, CloseHandle(h); ret = nullptr; } - res = &ret; + *res = ret; return 0; } -PS4_SYSV_ABI int mmap(void* addr, u64 len, int prot, int flags, int fd, u64 offset, void** res) { +PS4_SYSV_ABI void* mmap(void* addr, u64 len, int prot, int flags, int fd, u64 offset) { + void* ptr; // posix call the difference is that there is a different behaviour when it doesn't return 0 or SCE_OK - int result = sceKernelMmap(addr, len, prot, flags, fd, offset, res); + int result = sceKernelMmap(addr, len, prot, flags, fd, offset, &ptr); if (result != 0) { BREAKPOINT(); } - return result; + return ptr; } PS4_SYSV_ABI void close() { BREAKPOINT(); }