diff --git a/src/common/elf_info.h b/src/common/elf_info.h index b84f36ecb..8f79c9e69 100644 --- a/src/common/elf_info.h +++ b/src/common/elf_info.h @@ -6,6 +6,7 @@ #include #include #include +#include #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 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 GetNpCommIds() const { + return npCommIds; + } }; } // namespace Common diff --git a/src/common/memory_patcher.cpp b/src/common/memory_patcher.cpp index a7c020246..2517e3f22 100644 --- a/src/common/memory_patcher.cpp +++ b/src/common/memory_patcher.cpp @@ -8,7 +8,6 @@ #include #include #include -#include "common/config.h" #include "common/elf_info.h" #include "common/logging/log.h" #include "common/path_util.h" diff --git a/src/core/file_sys/fs.cpp b/src/core/file_sys/fs.cpp index 96a04ee5e..2fdf8c10b 100644 --- a/src/core/file_sys/fs.cpp +++ b/src/core/file_sys/fs.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include -#include "common/config.h" #include "common/string_util.h" #include "core/file_sys/devices/logger.h" #include "core/file_sys/devices/nop_device.h" diff --git a/src/core/libraries/gnmdriver/gnmdriver.cpp b/src/core/libraries/gnmdriver/gnmdriver.cpp index 1bb034dd0..f8886e3ff 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.cpp +++ b/src/core/libraries/gnmdriver/gnmdriver.cpp @@ -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() { diff --git a/src/core/libraries/gnmdriver/gnmdriver.h b/src/core/libraries/gnmdriver/gnmdriver.h index 4ece58ebd..2208ca05d 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.h +++ b/src/core/libraries/gnmdriver/gnmdriver.h @@ -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); diff --git a/src/core/libraries/network/net_resolver.cpp b/src/core/libraries/network/net_resolver.cpp index 7eb4c4001..a66f1519b 100644 --- a/src/core/libraries/network/net_resolver.cpp +++ b/src/core/libraries/network/net_resolver.cpp @@ -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; } diff --git a/src/core/libraries/np/np_trophy_error.h b/src/core/libraries/np/np_trophy_error.h index 8ac356225..173d7dd59 100644 --- a/src/core/libraries/np/np_trophy_error.h +++ b/src/core/libraries/np/np_trophy_error.h @@ -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; diff --git a/src/core/libraries/np/trophy_ui.cpp b/src/core/libraries/np/trophy_ui.cpp index 6ca24b6d5..a4fd21a33 100644 --- a/src/core/libraries/np/trophy_ui.cpp +++ b/src/core/libraries/np/trophy_ui.cpp @@ -7,11 +7,6 @@ #include #include #include - -#ifdef ENABLE_QT_GUI -#include -#endif - #include "common/assert.h" #include "common/path_util.h" #include "common/singleton.h" diff --git a/src/core/libraries/pad/pad_errors.h b/src/core/libraries/pad/pad_errors.h index 182c89219..bb2a2e9ac 100644 --- a/src/core/libraries/pad/pad_errors.h +++ b/src/core/libraries/pad/pad_errors.h @@ -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; diff --git a/src/core/libraries/sysmodule/sysmodule_internal.cpp b/src/core/libraries/sysmodule/sysmodule_internal.cpp index def410e25..b2853e2fa 100644 --- a/src/core/libraries/sysmodule/sysmodule_internal.cpp +++ b/src/core/libraries/sysmodule/sysmodule_internal.cpp @@ -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; } diff --git a/src/core/libraries/system_gesture/system_gesture.cpp b/src/core/libraries/system_gesture/system_gesture.cpp index 304a11612..a6455e05e 100644 --- a/src/core/libraries/system_gesture/system_gesture.cpp +++ b/src/core/libraries/system_gesture/system_gesture.cpp @@ -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" diff --git a/src/video_core/renderer_vulkan/vk_pipeline_serialization.cpp b/src/video_core/renderer_vulkan/vk_pipeline_serialization.cpp index f36d9c61c..eb31d4994 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_serialization.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_serialization.cpp @@ -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" diff --git a/src/video_core/renderer_vulkan/vk_platform.cpp b/src/video_core/renderer_vulkan/vk_platform.cpp index 7f02fcaf1..c77c80223 100644 --- a/src/video_core/renderer_vulkan/vk_platform.cpp +++ b/src/video_core/renderer_vulkan/vk_platform.cpp @@ -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 diff --git a/src/video_core/texture_cache/texture_cache.cpp b/src/video_core/texture_cache/texture_cache.cpp index 8163902cc..163712756 100644 --- a/src/video_core/texture_cache/texture_cache.cpp +++ b/src/video_core/texture_cache/texture_cache.cpp @@ -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 #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;