more files for syncing with 0.15.1 branch (#4161)

This commit is contained in:
georgemoralis 2026-03-22 10:26:23 +02:00 committed by GitHub
parent 880445c2ce
commit edd50ab2d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 38 additions and 34 deletions

View File

@ -6,6 +6,7 @@
#include <filesystem>
#include <string>
#include <string_view>
#include <vector>
#include "assert.h"
#include "bit_field.h"
@ -73,6 +74,7 @@ class ElfInfo {
std::filesystem::path splash_path{};
std::filesystem::path game_folder{};
std::vector<std::string> npCommIds{};
public:
static constexpr u32 FW_10 = 0x1000000;
@ -139,6 +141,10 @@ public:
[[nodiscard]] const std::filesystem::path& GetGameFolder() const {
return game_folder;
}
[[nodiscard]] const std::vector<std::string> GetNpCommIds() const {
return npCommIds;
}
};
} // namespace Common

View File

@ -8,7 +8,6 @@
#include <string>
#include <nlohmann/json.hpp>
#include <pugixml.hpp>
#include "common/config.h"
#include "common/elf_info.h"
#include "common/logging/log.h"
#include "common/path_util.h"

View File

@ -2,7 +2,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
#include "common/config.h"
#include "common/string_util.h"
#include "core/file_sys/devices/logger.h"
#include "core/file_sys/devices/nop_device.h"

View File

@ -1172,13 +1172,14 @@ bool PS4_SYSV_ABI sceGnmIsUserPaEnabled() {
}
int PS4_SYSV_ABI sceGnmLogicalCuIndexToPhysicalCuIndex() {
LOG_ERROR(Lib_GnmDriver, "(STUBBED) called");
LOG_TRACE(Lib_GnmDriver, "called");
// Not available in retail firmware
return ORBIS_OK;
}
int PS4_SYSV_ABI sceGnmLogicalCuMaskToPhysicalCuMask() {
LOG_ERROR(Lib_GnmDriver, "(STUBBED) called");
return ORBIS_OK;
s32 PS4_SYSV_ABI sceGnmLogicalCuMaskToPhysicalCuMask(s64, s32 logical_cu_mask) {
LOG_INFO(Lib_GnmDriver, "called, logical_cu_mask: {}", logical_cu_mask);
return logical_cu_mask;
}
int PS4_SYSV_ABI sceGnmLogicalTcaUnitToPhysical() {

View File

@ -121,7 +121,7 @@ s32 PS4_SYSV_ABI sceGnmInsertWaitFlipDone(u32* cmdbuf, u32 size, s32 vo_handle,
int PS4_SYSV_ABI sceGnmIsCoredumpValid();
bool PS4_SYSV_ABI sceGnmIsUserPaEnabled();
int PS4_SYSV_ABI sceGnmLogicalCuIndexToPhysicalCuIndex();
int PS4_SYSV_ABI sceGnmLogicalCuMaskToPhysicalCuMask();
s32 PS4_SYSV_ABI sceGnmLogicalCuMaskToPhysicalCuMask(s64, s32 logical_cu_mask);
int PS4_SYSV_ABI sceGnmLogicalTcaUnitToPhysical();
int PS4_SYSV_ABI sceGnmMapComputeQueue(u32 pipe_id, u32 queue_id, VAddr ring_base_addr,
u32 ring_size_dw, u32* read_ptr_addr);

View File

@ -2,9 +2,9 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/assert.h"
#include "common/config.h"
#include "common/singleton.h"
#include "common/types.h"
#include "core/emulator_settings.h"
#include "core/libraries/error_codes.h"
#include "net_error.h"
#include "net_resolver.h"
@ -27,7 +27,7 @@ int Resolver::ResolveAsync(const char* hostname, OrbisNetInAddr* addr, int timeo
}
void Resolver::Resolve() {
if (!Config::getIsConnectedToNetwork()) {
if (!EmulatorSettings.IsConnectedToNetwork()) {
resolution_error = ORBIS_NET_ERROR_RESOLVER_ENODNS;
return;
}

View File

@ -47,3 +47,4 @@ constexpr int ORBIS_NP_TROPHY_ERROR_INCONSISTENT_TITLE_CONF = 0x80551628;
constexpr int ORBIS_NP_TROPHY_ERROR_TITLE_BACKGROUND = 0x80551629;
constexpr int ORBIS_NP_TROPHY_ERROR_SCREENSHOT_DISABLED = 0x8055162B;
constexpr int ORBIS_NP_TROPHY_ERROR_SCREENSHOT_DISPLAY_BUFFER_NOT_IN_USE = 0x8055162D;
constexpr int ORBIS_NP_TROPHY_ERROR_TITLE_NOT_FOUND = 0x805516C2;

View File

@ -7,11 +7,6 @@
#include <mutex>
#include <cmrc/cmrc.hpp>
#include <imgui.h>
#ifdef ENABLE_QT_GUI
#include <qt_gui/background_music_player.h>
#endif
#include "common/assert.h"
#include "common/path_util.h"
#include "common/singleton.h"

View File

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@ -20,3 +20,6 @@ constexpr int ORBIS_PAD_ERROR_INVALID_BUFFER_LENGTH = 0x80920102;
constexpr int ORBIS_PAD_ERROR_INVALID_REPORT_LENGTH = 0x80920103;
constexpr int ORBIS_PAD_ERROR_INVALID_REPORT_ID = 0x80920104;
constexpr int ORBIS_PAD_ERROR_SEND_AGAIN = 0x80920105;
constexpr s32 ORBIS_DEVICE_SERVICE_ERROR_INVALID_USER = 0x809b0001;
constexpr s32 ORBIS_DEVICE_SERVICE_ERROR_USER_NOT_LOGIN = 0x809b0081;

View File

@ -2,9 +2,9 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/assert.h"
#include "common/config.h"
#include "common/elf_info.h"
#include "common/logging/log.h"
#include "core/emulator_settings.h"
#include "core/file_sys/fs.h"
#include "core/libraries/disc_map/disc_map.h"
#include "core/libraries/font/font.h"
@ -108,7 +108,7 @@ bool validateModuleId(s32 id) {
}
// Cannot load debug modules on retail hardware.
if (isDebugModule(id) && !Config::isDevKitConsole()) {
if (isDebugModule(id) && !EmulatorSettings.IsDevKit()) {
return ORBIS_SYSMODULE_INVALID_ID;
}
@ -154,7 +154,7 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) {
std::string mod_name = std::string(mod.name);
// libSceGnmDriver case
if (index == 0xd && Config::isDevKitConsole()) {
if (index == 0xd && EmulatorSettings.IsDevKit()) {
// There are some other checks involved here that I am not familiar with.
// Since we're not exactly running libSceGnmDriver LLE, this shouldn't matter too much.
mod_name.append("_padebug");
@ -168,7 +168,7 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) {
}
// libSceVrTracker case
if (index == 0xb3 && Config::isDevKitConsole()) {
if (index == 0xb3 && EmulatorSettings.IsDevKit()) {
mod_name.append("_debug");
}
@ -178,7 +178,7 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) {
// PS4 Pro running in enhanced mode
mod_name.append("ForNeoMode");
} else if ((mod.flags & OrbisSysmoduleModuleInternalFlags::IsNeo) != 0 &&
Config::isNeoModeConsole()) {
EmulatorSettings.IsNeo()) {
// PS4 Pro running in base mode
mod_name.append("ForNeo");
}
@ -188,7 +188,7 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) {
// Now we need to check if the requested library is allowed to LLE.
// First, we allow all modules from game-specific sys_modules
const auto& sys_module_path = Config::getSysModulesPath();
const auto& sys_module_path = EmulatorSettings.GetSysModulesDir();
const auto& game_specific_module_path =
sys_module_path / game_info->GameSerial() / mod_name;
if (std::filesystem::exists(game_specific_module_path)) {
@ -223,7 +223,8 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) {
{"libSceAudiodec.sprx", nullptr},
{"libSceFont.sprx", &Libraries::Font::RegisterlibSceFont},
{"libSceFontFt.sprx", &Libraries::FontFt::RegisterlibSceFontFt},
{"libSceFreeTypeOt.sprx", nullptr}});
{"libSceFreeTypeOt.sprx", nullptr},
{"libScePadTracker.sprx", nullptr}});
// Iterate through the allowed array
const auto it = std::ranges::find_if(
@ -299,7 +300,7 @@ s32 loadModule(s32 id, s32 argc, const void* argv, s32* res_out) {
for (s64 i = requested_module.num_to_load - 1; i >= 0; i--) {
// Modules flagged as debug modules only load for devkits
u32 mod_index = requested_module.to_load[i];
if ((!Config::isDevKitConsole() &&
if ((!EmulatorSettings.IsDevKit() &&
g_modules_array[mod_index].flags & OrbisSysmoduleModuleInternalFlags::IsDebug) != 0) {
continue;
}
@ -361,7 +362,7 @@ s32 unloadModule(s32 id, s32 argc, const void* argv, s32* res_out, bool is_inter
OrbisSysmoduleModuleInternal dep_mod = g_modules_array[mod.to_load[i]];
// If this is a debug module and we're not emulating a devkit, skip it.
if ((dep_mod.flags & OrbisSysmoduleModuleInternalFlags::IsDebug) != 0 &&
!Config::isDevKitConsole()) {
!EmulatorSettings.IsDevKit()) {
continue;
}
@ -398,7 +399,7 @@ s32 preloadModulesForLibkernel() {
// These are skipped unless this console is a devkit.
if ((module_index == 0x12 || module_index == 0x1e || module_index == 0x24 ||
module_index == 0x26) &&
!Config::isDevKitConsole()) {
!EmulatorSettings.IsDevKit()) {
continue;
}
@ -409,13 +410,13 @@ s32 preloadModulesForLibkernel() {
// libSceDbgAssist is skipped on non-testkit consoles.
// For now, stub check to non-devkit.
if (module_index == 0x23 && !Config::isDevKitConsole()) {
if (module_index == 0x23 && !EmulatorSettings.IsDevKit()) {
continue;
}
// libSceRazorCpu, skipped for old non-devkit consoles.
if (module_index == 0x25 && sdk_ver < Common::ElfInfo::FW_45 &&
!Config::isDevKitConsole()) {
!EmulatorSettings.IsDevKit()) {
continue;
}

View File

@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/config.h"
#include "common/logging/log.h"
#include "common/singleton.h"
#include "core/libraries/libs.h"

View File

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/serdes.h"

View File

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Include the vulkan platform specific header

View File

@ -1,12 +1,12 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <xxhash.h>
#include "common/assert.h"
#include "common/config.h"
#include "common/debug.h"
#include "common/scope_exit.h"
#include "core/emulator_settings.h"
#include "core/memory.h"
#include "video_core/buffer_cache/buffer_cache.h"
#include "video_core/page_manager.h"
@ -641,7 +641,7 @@ ImageView& TextureCache::FindTexture(ImageId image_id, const ImageDesc& desc) {
Image& image = slot_images[image_id];
if (desc.type == BindingType::Storage) {
image.flags |= ImageFlagBits::GpuModified;
if (Config::readbackLinearImages() && !image.info.props.is_tiled &&
if (EmulatorSettings.IsReadbackLinearImagesEnabled() && !image.info.props.is_tiled &&
image.info.guest_address != 0) {
download_images.emplace(image_id);
}
@ -653,7 +653,7 @@ ImageView& TextureCache::FindTexture(ImageId image_id, const ImageDesc& desc) {
ImageView& TextureCache::FindRenderTarget(ImageId image_id, const ImageDesc& desc) {
Image& image = slot_images[image_id];
image.flags |= ImageFlagBits::GpuModified;
if (Config::readbackLinearImages() && !image.info.props.is_tiled) {
if (EmulatorSettings.IsReadbackLinearImagesEnabled() && !image.info.props.is_tiled) {
download_images.emplace(image_id);
}
image.usage.render_target = 1u;