diff --git a/src/common/memory_patcher.cpp b/src/common/memory_patcher.cpp index a301bf1e8..b77bfa0b7 100644 --- a/src/common/memory_patcher.cpp +++ b/src/common/memory_patcher.cpp @@ -1,11 +1,9 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#ifdef ENABLE_QT_GUI #include #include -#include "common/logging/log.h" -#include "common/path_util.h" -#ifdef ENABLE_QT_GUI #include #include #include @@ -13,7 +11,8 @@ #include #include #include -#endif +#include "common/logging/log.h" +#include "common/path_util.h" #include "memory_patcher.h" namespace MemoryPatcher { @@ -23,7 +22,6 @@ u64 g_eboot_image_size; std::string g_game_serial; std::vector pending_patches; -#ifdef ENABLE_QT_GUI QString toHex(unsigned long long value, size_t byteSize) { std::stringstream ss; ss << std::hex << std::setfill('0') << std::setw(byteSize * 2) << value; @@ -89,12 +87,10 @@ QString convertValueToHex(const QString& type, const QString& valueStr) { } return result; } -#endif void OnGameLoaded() { -// We use the QT headers for the xml and json parsing, this define is only true on QT builds -#ifdef ENABLE_QT_GUI + // We use the QT headers for the xml and json parsing, this define is only true on QT builds QString patchDir = QString::fromStdString(Common::FS::GetUserPath(Common::FS::PathType::PatchesDir).string()); QString repositories[] = {"GoldHEN", "shadPS4"}; @@ -237,8 +233,6 @@ void OnGameLoaded() { } else { LOG_INFO(Loader, "Patches loaded successfully"); } -#endif - ApplyPendingPatches(); } } @@ -352,4 +346,6 @@ uintptr_t PatternScan(const std::string& signature) { return 0; } -} // namespace MemoryPatcher \ No newline at end of file +} // namespace MemoryPatcher + +#endif \ No newline at end of file diff --git a/src/core/module.cpp b/src/core/module.cpp index 5ab62c6c3..f9109aced 100644 --- a/src/core/module.cpp +++ b/src/core/module.cpp @@ -5,7 +5,9 @@ #include "common/alignment.h" #include "common/assert.h" #include "common/logging/log.h" +#ifdef ENABLE_QT_GUI #include "common/memory_patcher.h" +#endif #include "common/string_util.h" #include "core/aerolib/aerolib.h" #include "core/cpu_patches.h" @@ -194,6 +196,7 @@ void Module::LoadModuleToMemory(u32& max_tls_index) { const VAddr entry_addr = base_virtual_addr + elf.GetElfEntry(); LOG_INFO(Core_Linker, "program entry addr ..........: {:#018x}", entry_addr); +#ifdef ENABLE_QT_GUI if (MemoryPatcher::g_eboot_address == 0) { if (name == "eboot") { MemoryPatcher::g_eboot_address = base_virtual_addr; @@ -201,6 +204,7 @@ void Module::LoadModuleToMemory(u32& max_tls_index) { MemoryPatcher::OnGameLoaded(); } } +#endif } void Module::LoadDynamicInfo() { diff --git a/src/emulator.cpp b/src/emulator.cpp index 17a6f4a2a..14bb39061 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -7,7 +7,9 @@ #include "common/debug.h" #include "common/logging/backend.h" #include "common/logging/log.h" +#ifdef ENABLE_QT_GUI #include "common/memory_patcher.h" +#endif #include "common/ntapi.h" #include "common/path_util.h" #include "common/polyfill_thread.h" @@ -94,7 +96,9 @@ void Emulator::Run(const std::filesystem::path& file) { auto* param_sfo = Common::Singleton::Instance(); param_sfo->open(sce_sys_folder.string() + "/param.sfo", {}); id = std::string(param_sfo->GetString("CONTENT_ID"), 7, 9); +#ifdef ENABLE_QT_GUI MemoryPatcher::g_game_serial = id; +#endif title = param_sfo->GetString("TITLE"); LOG_INFO(Loader, "Game id: {} Title: {}", id, title); u32 fw_version = param_sfo->GetInteger("SYSTEM_VER"); diff --git a/src/qt_gui/translations/it.ts b/src/qt_gui/translations/it.ts index 92c2e94fc..8ce971387 100644 --- a/src/qt_gui/translations/it.ts +++ b/src/qt_gui/translations/it.ts @@ -16,7 +16,7 @@ shadPS4 is an experimental open-source emulator for the PlayStation 4. - shadPS4 è un emulatore sperimentale open source per Playstation 4. + shadPS4 è un emulatore sperimentale open source per PlayStation 4. @@ -181,7 +181,7 @@ Install application from a .pkg file - Installa applicaazione da un .pkg file + Installa applicazione da un file .pkg file @@ -375,7 +375,7 @@ System - Systema + Sistema @@ -460,7 +460,7 @@ Enable Shaders Dumping - Abilita Scaricamento Shader + Abilita Dump Shader @@ -470,7 +470,7 @@ Enable PM4 Dumping - Abilita Scaricamento PM4 + Abilita Dump PM4 @@ -480,7 +480,7 @@ Enable Debug Dumping - Abilita Scaricamento Debug + Abilita Dump Debug