mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-07-11 01:24:28 +02:00
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
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
#include <mutex>
|
||||
#include <stop_token>
|
||||
#include <unordered_map>
|
||||
#include <miniz.h>
|
||||
#include <queue>
|
||||
#include <zlib.h>
|
||||
|
||||
#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<Bytef*>(task.dst), &decompressed_length,
|
||||
static_cast<const Bytef*>(task.src), task.src_length);
|
||||
mz_ulong decompressed_length = task.dst_length;
|
||||
const auto ret = mz_uncompress(static_cast<u8*>(task.dst), &decompressed_length,
|
||||
static_cast<const u8*>(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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user