mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-19 19:14:48 +00:00
Merge branch 'main' into fontlib
This commit is contained in:
commit
62709b0943
12 changed files with 157 additions and 69 deletions
|
@ -576,6 +576,8 @@ set(NP_LIBS src/core/libraries/np_common/np_common.cpp
|
|||
src/core/libraries/np_web_api/np_web_api.h
|
||||
src/core/libraries/np_party/np_party.cpp
|
||||
src/core/libraries/np_party/np_party.h
|
||||
src/core/libraries/np_auth/np_auth.cpp
|
||||
src/core/libraries/np_auth/np_auth.h
|
||||
)
|
||||
|
||||
set(ZLIB_LIB src/core/libraries/zlib/zlib.cpp
|
||||
|
|
11
README.md
11
README.md
|
@ -146,16 +146,13 @@ The following firmware modules are supported and must be placed in shadPS4's `us
|
|||
# Main team
|
||||
|
||||
- [**georgemoralis**](https://github.com/georgemoralis)
|
||||
- [**raphaelthegreat**](https://github.com/raphaelthegreat)
|
||||
- [**psucien**](https://github.com/psucien)
|
||||
- [**skmp**](https://github.com/skmp)
|
||||
- [**wheremyfoodat**](https://github.com/wheremyfoodat)
|
||||
- [**raziel1000**](https://github.com/raziel1000)
|
||||
- [**viniciuslrangel**](https://github.com/viniciuslrangel)
|
||||
- [**roamic**](https://github.com/vladmikhalin)
|
||||
- [**poly**](https://github.com/polybiusproxy)
|
||||
- [**squidbus**](https://github.com/squidbus)
|
||||
- [**frodo**](https://github.com/baggins183)
|
||||
- [**Stephen Miller**](https://github.com/StevenMiller123)
|
||||
- [**kalaposfos13**](https://github.com/kalaposfos13)
|
||||
|
||||
Logo is done by [**Xphalnos**](https://github.com/Xphalnos)
|
||||
|
||||
|
@ -166,11 +163,11 @@ Open a PR and we'll check it :)
|
|||
|
||||
# Translations
|
||||
|
||||
If you want to translate shadPS4 to your language we use [**crowdin**](https://crowdin.com/project/shadps4-emulator).
|
||||
If you want to translate shadPS4 to your language we use [**Crowdin**](https://crowdin.com/project/shadps4-emulator).
|
||||
# Contributors
|
||||
|
||||
<a href="https://github.com/shadps4-emu/shadPS4/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=shadps4-emu/shadPS4&max=15">
|
||||
<img src="https://contrib.rocks/image?repo=shadps4-emu/shadPS4&max=24">
|
||||
</a>
|
||||
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
|
|||
SUB(Lib, Ssl2) \
|
||||
SUB(Lib, SysModule) \
|
||||
SUB(Lib, Move) \
|
||||
SUB(Lib, NpAuth) \
|
||||
SUB(Lib, NpCommon) \
|
||||
SUB(Lib, NpManager) \
|
||||
SUB(Lib, NpScore) \
|
||||
|
|
|
@ -69,6 +69,7 @@ enum class Class : u8 {
|
|||
Lib_Http2, ///< The LibSceHttp2 implementation.
|
||||
Lib_SysModule, ///< The LibSceSysModule implementation
|
||||
Lib_NpCommon, ///< The LibSceNpCommon implementation
|
||||
Lib_NpAuth, ///< The LibSceNpAuth implementation
|
||||
Lib_NpManager, ///< The LibSceNpManager implementation
|
||||
Lib_NpScore, ///< The LibSceNpScore implementation
|
||||
Lib_NpTrophy, ///< The LibSceNpTrophy implementation
|
||||
|
|
|
@ -2804,7 +2804,7 @@ void RegisterlibSceGnmDriver(Core::Loader::SymbolsResolver* sym) {
|
|||
liverpool = std::make_unique<AmdGpu::Liverpool>();
|
||||
presenter = std::make_unique<Vulkan::Presenter>(*g_window, liverpool.get());
|
||||
|
||||
const int result = sceKernelGetCompiledSdkVersion(&sdk_version);
|
||||
const s32 result = sceKernelGetCompiledSdkVersion(&sdk_version);
|
||||
if (result != ORBIS_OK) {
|
||||
sdk_version = 0;
|
||||
}
|
||||
|
|
|
@ -106,12 +106,6 @@ s32 PS4_SYSV_ABI sceKernelAvailableDirectMemorySize(u64 searchStart, u64 searchE
|
|||
if (physAddrOut == nullptr || sizeOut == nullptr) {
|
||||
return ORBIS_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
if (searchEnd > sceKernelGetDirectMemorySize()) {
|
||||
return ORBIS_KERNEL_ERROR_EINVAL;
|
||||
}
|
||||
if (searchEnd <= searchStart) {
|
||||
return ORBIS_KERNEL_ERROR_ENOMEM;
|
||||
}
|
||||
|
||||
auto* memory = Core::Memory::Instance();
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "core/libraries/network/netctl.h"
|
||||
#include "core/libraries/network/ssl.h"
|
||||
#include "core/libraries/network/ssl2.h"
|
||||
#include "core/libraries/np_auth/np_auth.h"
|
||||
#include "core/libraries/np_common/np_common.h"
|
||||
#include "core/libraries/np_manager/np_manager.h"
|
||||
#include "core/libraries/np_party/np_party.h"
|
||||
|
@ -88,6 +89,7 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) {
|
|||
Libraries::NpScore::RegisterlibSceNpScore(sym);
|
||||
Libraries::NpTrophy::RegisterlibSceNpTrophy(sym);
|
||||
Libraries::NpWebApi::RegisterlibSceNpWebApi(sym);
|
||||
Libraries::NpAuth::RegisterlibSceNpAuth(sym);
|
||||
Libraries::ScreenShot::RegisterlibSceScreenShot(sym);
|
||||
Libraries::AppContent::RegisterlibSceAppContent(sym);
|
||||
Libraries::PngDec::RegisterlibScePngDec(sym);
|
||||
|
|
99
src/core/libraries/np_auth/np_auth.cpp
Normal file
99
src/core/libraries/np_auth/np_auth.cpp
Normal file
|
@ -0,0 +1,99 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/libraries/error_codes.h"
|
||||
#include "core/libraries/libs.h"
|
||||
#include "core/libraries/np_auth/np_auth.h"
|
||||
|
||||
namespace Libraries::NpAuth {
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetAuthorizationCode() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetIdToken() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthAbortRequest() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthCreateAsyncRequest() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthCreateRequest() {
|
||||
LOG_WARNING(Lib_NpAuth, "(DUMMY) called");
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthDeleteRequest(s32 id) {
|
||||
LOG_WARNING(Lib_NpAuth, "(DUMMY) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetAuthorizationCodeA() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetAuthorizationCodeV3() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetIdTokenA() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetIdTokenV3() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthPollAsync() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthSetTimeout() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthWaitAsync() {
|
||||
LOG_ERROR(Lib_NpAuth, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
void RegisterlibSceNpAuth(Core::Loader::SymbolsResolver* sym) {
|
||||
LIB_FUNCTION("KxGkOrQJTqY", "libSceNpAuthCompat", 1, "libSceNpAuth", 1, 1,
|
||||
sceNpAuthGetAuthorizationCode);
|
||||
LIB_FUNCTION("uaB-LoJqHis", "libSceNpAuthCompat", 1, "libSceNpAuth", 1, 1, sceNpAuthGetIdToken);
|
||||
LIB_FUNCTION("cE7wIsqXdZ8", "libSceNpAuth", 1, "libSceNpAuth", 1, 1, sceNpAuthAbortRequest);
|
||||
LIB_FUNCTION("N+mr7GjTvr8", "libSceNpAuth", 1, "libSceNpAuth", 1, 1,
|
||||
sceNpAuthCreateAsyncRequest);
|
||||
LIB_FUNCTION("6bwFkosYRQg", "libSceNpAuth", 1, "libSceNpAuth", 1, 1, sceNpAuthCreateRequest);
|
||||
LIB_FUNCTION("H8wG9Bk-nPc", "libSceNpAuth", 1, "libSceNpAuth", 1, 1, sceNpAuthDeleteRequest);
|
||||
LIB_FUNCTION("KxGkOrQJTqY", "libSceNpAuth", 1, "libSceNpAuth", 1, 1,
|
||||
sceNpAuthGetAuthorizationCode);
|
||||
LIB_FUNCTION("qAUXQ9GdWp8", "libSceNpAuth", 1, "libSceNpAuth", 1, 1,
|
||||
sceNpAuthGetAuthorizationCodeA);
|
||||
LIB_FUNCTION("KI4dHLlTNl0", "libSceNpAuth", 1, "libSceNpAuth", 1, 1,
|
||||
sceNpAuthGetAuthorizationCodeV3);
|
||||
LIB_FUNCTION("uaB-LoJqHis", "libSceNpAuth", 1, "libSceNpAuth", 1, 1, sceNpAuthGetIdToken);
|
||||
LIB_FUNCTION("CocbHVIKPE8", "libSceNpAuth", 1, "libSceNpAuth", 1, 1, sceNpAuthGetIdTokenA);
|
||||
LIB_FUNCTION("RdsFVsgSpZY", "libSceNpAuth", 1, "libSceNpAuth", 1, 1, sceNpAuthGetIdTokenV3);
|
||||
LIB_FUNCTION("gjSyfzSsDcE", "libSceNpAuth", 1, "libSceNpAuth", 1, 1, sceNpAuthPollAsync);
|
||||
LIB_FUNCTION("PM3IZCw-7m0", "libSceNpAuth", 1, "libSceNpAuth", 1, 1, sceNpAuthSetTimeout);
|
||||
LIB_FUNCTION("SK-S7daqJSE", "libSceNpAuth", 1, "libSceNpAuth", 1, 1, sceNpAuthWaitAsync);
|
||||
};
|
||||
|
||||
} // namespace Libraries::NpAuth
|
29
src/core/libraries/np_auth/np_auth.h
Normal file
29
src/core/libraries/np_auth/np_auth.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
namespace Core::Loader {
|
||||
class SymbolsResolver;
|
||||
}
|
||||
|
||||
namespace Libraries::NpAuth {
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetAuthorizationCode();
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetIdToken();
|
||||
s32 PS4_SYSV_ABI sceNpAuthAbortRequest();
|
||||
s32 PS4_SYSV_ABI sceNpAuthCreateAsyncRequest();
|
||||
s32 PS4_SYSV_ABI sceNpAuthCreateRequest();
|
||||
s32 PS4_SYSV_ABI sceNpAuthDeleteRequest(s32 id);
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetAuthorizationCodeA();
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetAuthorizationCodeV3();
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetIdTokenA();
|
||||
s32 PS4_SYSV_ABI sceNpAuthGetIdTokenV3();
|
||||
s32 PS4_SYSV_ABI sceNpAuthPollAsync();
|
||||
s32 PS4_SYSV_ABI sceNpAuthSetTimeout();
|
||||
s32 PS4_SYSV_ABI sceNpAuthWaitAsync();
|
||||
|
||||
void RegisterlibSceNpAuth(Core::Loader::SymbolsResolver* sym);
|
||||
} // namespace Libraries::NpAuth
|
|
@ -108,10 +108,22 @@ void Linker::Execute(const std::vector<std::string> args) {
|
|||
static constexpr s64 InternalMemorySize = 0x1000000;
|
||||
void* addr_out{reinterpret_cast<void*>(KernelAllocBase)};
|
||||
|
||||
const s32 ret = Libraries::Kernel::sceKernelMapNamedFlexibleMemory(
|
||||
&addr_out, InternalMemorySize, 3, 0, "SceKernelInternalMemory");
|
||||
s32 ret = Libraries::Kernel::sceKernelMapNamedFlexibleMemory(&addr_out, InternalMemorySize, 3,
|
||||
0, "SceKernelInternalMemory");
|
||||
ASSERT_MSG(ret == 0, "Unable to perform sceKernelInternalMemory mapping");
|
||||
|
||||
// Simulate libSceGnmDriver initialization, which maps a chunk of direct memory.
|
||||
// Some games fail without accurately emulating this behavior.
|
||||
s64 phys_addr{};
|
||||
ret = Libraries::Kernel::sceKernelAllocateDirectMemory(
|
||||
0, Libraries::Kernel::sceKernelGetDirectMemorySize(), 0x10000, 0x10000, 3, &phys_addr);
|
||||
if (ret == 0) {
|
||||
void* addr{reinterpret_cast<void*>(0xfe0000000)};
|
||||
ret = Libraries::Kernel::sceKernelMapNamedDirectMemory(&addr, 0x10000, 0x13, 0, phys_addr,
|
||||
0x10000, "SceGnmDriver");
|
||||
}
|
||||
ASSERT_MSG(ret == 0, "Unable to emulate libSceGnmDriver initialization");
|
||||
|
||||
main_thread.Run([this, module, args](std::stop_token) {
|
||||
Common::SetCurrentThreadName("GAME_MainThread");
|
||||
LoadSharedLibraries();
|
||||
|
|
|
@ -655,7 +655,7 @@ int MemoryManager::DirectQueryAvailable(PAddr search_start, PAddr search_end, si
|
|||
|
||||
if (dmem_area->second.GetEnd() > search_end) {
|
||||
// We need to trim remaining_size to ignore addresses beyond search_end
|
||||
remaining_size = remaining_size > (search_start - dmem_area->second.base)
|
||||
remaining_size = remaining_size > (dmem_area->second.GetEnd() - search_end)
|
||||
? remaining_size - (dmem_area->second.GetEnd() - search_end)
|
||||
: 0;
|
||||
}
|
||||
|
|
|
@ -127,58 +127,9 @@ tr("Do you want to overwrite existing mappings with the mappings from the Common
|
|||
}
|
||||
|
||||
void KBMSettings::ButtonConnects() {
|
||||
connect(ui->CrossButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->CrossButton); });
|
||||
connect(ui->CircleButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->CircleButton); });
|
||||
connect(ui->TriangleButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->TriangleButton); });
|
||||
connect(ui->SquareButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->SquareButton); });
|
||||
|
||||
connect(ui->L1Button, &QPushButton::clicked, this, [this]() { StartTimer(ui->L1Button); });
|
||||
connect(ui->L2Button, &QPushButton::clicked, this, [this]() { StartTimer(ui->L2Button); });
|
||||
connect(ui->L3Button, &QPushButton::clicked, this, [this]() { StartTimer(ui->L3Button); });
|
||||
connect(ui->R1Button, &QPushButton::clicked, this, [this]() { StartTimer(ui->R1Button); });
|
||||
connect(ui->R2Button, &QPushButton::clicked, this, [this]() { StartTimer(ui->R2Button); });
|
||||
connect(ui->R3Button, &QPushButton::clicked, this, [this]() { StartTimer(ui->R3Button); });
|
||||
|
||||
connect(ui->TouchpadButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->TouchpadButton); });
|
||||
connect(ui->OptionsButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->OptionsButton); });
|
||||
|
||||
connect(ui->DpadUpButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->DpadUpButton); });
|
||||
connect(ui->DpadDownButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->DpadDownButton); });
|
||||
connect(ui->DpadLeftButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->DpadLeftButton); });
|
||||
connect(ui->DpadRightButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->DpadRightButton); });
|
||||
|
||||
connect(ui->LStickUpButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->LStickUpButton); });
|
||||
connect(ui->LStickDownButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->LStickDownButton); });
|
||||
connect(ui->LStickLeftButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->LStickLeftButton); });
|
||||
connect(ui->LStickRightButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->LStickRightButton); });
|
||||
|
||||
connect(ui->RStickUpButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->RStickUpButton); });
|
||||
connect(ui->RStickDownButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->RStickDownButton); });
|
||||
connect(ui->RStickLeftButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->RStickLeftButton); });
|
||||
connect(ui->RStickRightButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->RStickRightButton); });
|
||||
|
||||
connect(ui->LHalfButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->LHalfButton); });
|
||||
connect(ui->RHalfButton, &QPushButton::clicked, this,
|
||||
[this]() { StartTimer(ui->RHalfButton); });
|
||||
for (auto& button : ButtonsList) {
|
||||
connect(button, &QPushButton::clicked, this, [this, &button]() { StartTimer(button); });
|
||||
}
|
||||
}
|
||||
|
||||
void KBMSettings::DisableMappingButtons() {
|
||||
|
|
Loading…
Add table
Reference in a new issue