This commit is contained in:
DanielSvoboda 2024-08-28 19:20:47 -03:00
parent b78c249b31
commit 693c68c65d
3 changed files with 6 additions and 14 deletions

View file

@ -310,8 +310,6 @@ set(COMMON src/common/logging/backend.cpp
src/common/enum.h
src/common/io_file.cpp
src/common/io_file.h
src/qt_gui/memory_patcher.cpp
src/qt_gui/memory_patcher.h
src/common/error.cpp
src/common/error.h
src/common/scope_exit.h
@ -567,6 +565,8 @@ set(QT_GUI src/qt_gui/about_dialog.cpp
src/qt_gui/about_dialog.ui
src/qt_gui/cheats_patches.cpp
src/qt_gui/cheats_patches.h
src/qt_gui/memory_patcher.cpp
src/qt_gui/memory_patcher.h
src/qt_gui/main_window_ui.h
src/qt_gui/main_window.cpp
src/qt_gui/main_window.h

View file

@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#ifdef ENABLE_QT_GUI
#include <algorithm>
#include <string>
#include <QFile>
@ -144,12 +143,11 @@ void OnGameLoaded() {
bool insideMetadata = false;
bool isEnabled = false;
std::string currentPatchName;
while (!xmlReader.atEnd()) {
xmlReader.readNext();
if (xmlReader.isStartElement()) {
std::string currentPatchName;
QJsonArray patchLines;
if (xmlReader.name() == QStringLiteral("Metadata")) {
insideMetadata = true;
@ -297,8 +295,8 @@ void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valu
std::memcpy(cheatAddress, bytePatch.data(), bytePatch.size());
LOG_INFO(Loader, "Applied patch:{}, Offset:{}, Value:{}", modNameStr, (uintptr_t)cheatAddress,
valueStr);
LOG_INFO(Loader, "Applied patch: {}, Offset: {}, Value: {}", modNameStr,
(uintptr_t)cheatAddress, valueStr);
}
static std::vector<int32_t> PatternToByte(const std::string& pattern) {
@ -346,6 +344,4 @@ uintptr_t PatternScan(const std::string& signature) {
return 0;
}
} // namespace MemoryPatcher
#endif
} // namespace MemoryPatcher

View file

@ -5,9 +5,7 @@
#include <cstring>
#include <string>
#include <vector>
#ifdef ENABLE_QT_GUI
#include <QString>
#endif
namespace MemoryPatcher {
@ -34,9 +32,7 @@ struct patchInfo {
extern std::vector<patchInfo> pending_patches;
#ifdef ENABLE_QT_GUI
QString convertValueToHex(const QString& type, const QString& valueStr);
#endif
void OnGameLoaded();
void AddPatchToQueue(patchInfo patchToAdd);