From 057454fe7fa4e5b47fb14156f1ff28fa95115ad5 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Sat, 6 Jun 2026 19:41:05 -0400 Subject: [PATCH] Lib.Zlib: Use miniz instead of zlib-ng (#4531) * Uze miniz instead of zlib for libSceZlib Might fix ROTTR? * Claaaaang * Explicitly use miniz's uncompress * Clang2 * Swap types In theory, these types are all the same size. Best we use the right ones for the library though. * Remove "stub" logs --- src/core/libraries/zlib/zlib.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/libraries/zlib/zlib.cpp b/src/core/libraries/zlib/zlib.cpp index 57b67460f..b744b8ff0 100644 --- a/src/core/libraries/zlib/zlib.cpp +++ b/src/core/libraries/zlib/zlib.cpp @@ -5,8 +5,8 @@ #include #include #include +#include #include -#include #include "common/logging/log.h" #include "common/thread.h" @@ -55,9 +55,9 @@ void ZlibTaskThread(const std::stop_token& stop) { task_queue.pop(); } - uLongf decompressed_length = task.dst_length; - const auto ret = uncompress(static_cast(task.dst), &decompressed_length, - static_cast(task.src), task.src_length); + mz_ulong decompressed_length = task.dst_length; + const auto ret = mz_uncompress(static_cast(task.dst), &decompressed_length, + static_cast(task.src), task.src_length); { // Lock, insert the new result, and push the finished request ID to the done queue. @@ -92,7 +92,7 @@ s32 PS4_SYSV_ABI sceZlibInitialize(const void* buffer, u32 length) { s32 PS4_SYSV_ABI sceZlibInflate(const void* src, u32 src_len, void* dst, u32 dst_len, u64* request_id) { - LOG_DEBUG(Lib_Zlib, "(STUBBED) called"); + LOG_DEBUG(Lib_Zlib, "called"); if (!task_thread.Joinable()) { return ORBIS_ZLIB_ERROR_NOT_INITIALIZED; } @@ -117,7 +117,7 @@ s32 PS4_SYSV_ABI sceZlibInflate(const void* src, u32 src_len, void* dst, u32 dst } s32 PS4_SYSV_ABI sceZlibWaitForDone(u64* request_id, const u32* timeout) { - LOG_DEBUG(Lib_Zlib, "(STUBBED) called"); + LOG_DEBUG(Lib_Zlib, "called"); if (!task_thread.Joinable()) { return ORBIS_ZLIB_ERROR_NOT_INITIALIZED; } @@ -143,7 +143,7 @@ s32 PS4_SYSV_ABI sceZlibWaitForDone(u64* request_id, const u32* timeout) { } s32 PS4_SYSV_ABI sceZlibGetResult(const u64 request_id, u32* dst_length, s32* status) { - LOG_DEBUG(Lib_Zlib, "(STUBBED) called"); + LOG_DEBUG(Lib_Zlib, "called"); if (!task_thread.Joinable()) { return ORBIS_ZLIB_ERROR_NOT_INITIALIZED; }