mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-10-28 12:38:43 +01:00
* Some games open port with handle 255 , that is not an accepted port so don't complain about it * Net: Send the User-Agent configured on the HTTP template * simplified comment * default http user-agent * added dummy nputility module * match User Agent 100% with decompile * return result to np_auth and some more debug code * implemented sceNpLookup* (similar of how np_score ,np_tus) functions * improved accept encoding for gzip * removedd invalid test after last change , GZIP encoding is not default true * Implemented Cached Redirected Connection * Inflate only when the response is actually GZIP-encoded and the flag is enabled * simplify GetLibhttpSystemVersionString * fixed tests * old file removed --------- Co-authored-by: Gabriele C <sgdc3.mail@gmail.com>
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include <cstdio>
|
|
|
|
#include "tests/stubs/kernel_stub.h"
|
|
|
|
#include "core/libraries/kernel/kernel.h"
|
|
#include "core/libraries/kernel/process.h"
|
|
|
|
namespace Libraries::Kernel {
|
|
|
|
static constexpr s32 DefaultTestSdkVersion = 0x4500000;
|
|
static s32 g_test_sdk_version = DefaultTestSdkVersion;
|
|
|
|
void TestSetSdkVersion(s32 ver) {
|
|
g_test_sdk_version = ver;
|
|
}
|
|
|
|
void TestResetSdkVersion() {
|
|
g_test_sdk_version = DefaultTestSdkVersion;
|
|
}
|
|
|
|
s32 PS4_SYSV_ABI sceKernelGetCompiledSdkVersion(s32* ver) {
|
|
if (ver) {
|
|
*ver = g_test_sdk_version;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static u32 g_test_system_sw_version = CURRENT_FIRMWARE_VERSION;
|
|
|
|
void TestSetSystemSwVersion(u32 hex_version) {
|
|
g_test_system_sw_version = hex_version;
|
|
}
|
|
|
|
void TestResetSystemSwVersion() {
|
|
g_test_system_sw_version = CURRENT_FIRMWARE_VERSION;
|
|
}
|
|
|
|
s32 PS4_SYSV_ABI sceKernelGetSystemSwVersion(SwVersionStruct* ret) {
|
|
if (ret == nullptr) {
|
|
return 0;
|
|
}
|
|
const u32 fake_fw = g_test_system_sw_version;
|
|
ret->hex_representation = fake_fw;
|
|
std::snprintf(ret->text_representation, 28, "%2x.%03x.%03x", fake_fw >> 0x18,
|
|
fake_fw >> 0xc & 0xfff, fake_fw & 0xfff);
|
|
return 0;
|
|
}
|
|
|
|
} // namespace Libraries::Kernel
|