mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-03 16:02:26 +00:00
fix mac build
This commit is contained in:
parent
43168f12fd
commit
d7564b2d5a
@ -4,6 +4,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <codecvt>
|
#include <codecvt>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
#include <pugixml.hpp>
|
#include <pugixml.hpp>
|
||||||
#ifdef ENABLE_QT_GUI
|
#ifdef ENABLE_QT_GUI
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -63,7 +64,8 @@ std::string convertValueToHex(const std::string type, const std::string valueStr
|
|||||||
doubleUnion.d = std::stod(valueStr);
|
doubleUnion.d = std::stod(valueStr);
|
||||||
result = toHex(doubleUnion.i, sizeof(doubleUnion.i));
|
result = toHex(doubleUnion.i, sizeof(doubleUnion.i));
|
||||||
} else if (type == "utf8") {
|
} else if (type == "utf8") {
|
||||||
std::vector<unsigned char> byteArray = std::vector<unsigned char>(valueStr.begin(), valueStr.end());
|
std::vector<unsigned char> byteArray =
|
||||||
|
std::vector<unsigned char>(valueStr.begin(), valueStr.end());
|
||||||
byteArray.push_back('\0');
|
byteArray.push_back('\0');
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
for (unsigned char c : byteArray) {
|
for (unsigned char c : byteArray) {
|
||||||
@ -82,20 +84,16 @@ std::string convertValueToHex(const std::string type, const std::string valueStr
|
|||||||
valueStringU16.push_back(static_cast<char16_t>(wc));
|
valueStringU16.push_back(static_cast<char16_t>(wc));
|
||||||
} else {
|
} else {
|
||||||
wc -= 0x10000;
|
wc -= 0x10000;
|
||||||
valueStringU16.push_back(
|
valueStringU16.push_back(static_cast<char16_t>(0xD800 | (wc >> 10)));
|
||||||
static_cast<char16_t>(0xD800 | (wc >> 10)));
|
valueStringU16.push_back(static_cast<char16_t>(0xDC00 | (wc & 0x3FF)));
|
||||||
valueStringU16.push_back(
|
|
||||||
static_cast<char16_t>(0xDC00 | (wc & 0x3FF)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<unsigned char> byteArray;
|
std::vector<unsigned char> byteArray;
|
||||||
// convert to little endian
|
// convert to little endian
|
||||||
for (char16_t ch : valueStringU16) {
|
for (char16_t ch : valueStringU16) {
|
||||||
unsigned char low_byte =
|
unsigned char low_byte = static_cast<unsigned char>(ch & 0x00FF);
|
||||||
static_cast<unsigned char>(ch & 0x00FF);
|
unsigned char high_byte = static_cast<unsigned char>((ch >> 8) & 0x00FF);
|
||||||
unsigned char high_byte =
|
|
||||||
static_cast<unsigned char>((ch >> 8) & 0x00FF);
|
|
||||||
|
|
||||||
byteArray.push_back(low_byte);
|
byteArray.push_back(low_byte);
|
||||||
byteArray.push_back(high_byte);
|
byteArray.push_back(high_byte);
|
||||||
@ -187,7 +185,7 @@ void OnGameLoaded() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_QT_GUI
|
#ifdef ENABLE_QT_GUI
|
||||||
// We use the QT headers for the xml and json parsing, this define is only true on QT builds
|
// We use the QT headers for the xml and json parsing, this define is only true on QT builds
|
||||||
QString patchDir =
|
QString patchDir =
|
||||||
QString::fromStdString(Common::FS::GetUserPath(Common::FS::PathType::PatchesDir).string());
|
QString::fromStdString(Common::FS::GetUserPath(Common::FS::PathType::PatchesDir).string());
|
||||||
@ -289,8 +287,8 @@ void OnGameLoaded() {
|
|||||||
QString patchValue = lineObject["Value"].toString();
|
QString patchValue = lineObject["Value"].toString();
|
||||||
QString maskOffsetStr = lineObject["Offset"].toString();
|
QString maskOffsetStr = lineObject["Offset"].toString();
|
||||||
|
|
||||||
patchValue =
|
patchValue = QString::fromStdString(
|
||||||
QString::fromStdString(convertValueToHex(type.toStdString(), patchValue.toStdString()));
|
convertValueToHex(type.toStdString(), patchValue.toStdString()));
|
||||||
|
|
||||||
bool littleEndian = false;
|
bool littleEndian = false;
|
||||||
|
|
||||||
@ -333,7 +331,7 @@ void OnGameLoaded() {
|
|||||||
}
|
}
|
||||||
ApplyPendingPatches();
|
ApplyPendingPatches();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddPatchToQueue(patchInfo patchToAdd) {
|
void AddPatchToQueue(patchInfo patchToAdd) {
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
#include "emulator.h"
|
|
||||||
#include "common/memory_patcher.h"
|
#include "common/memory_patcher.h"
|
||||||
|
#include "emulator.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
|
@ -27,10 +27,10 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
#include <common/logging/log.h>
|
#include <common/logging/log.h>
|
||||||
|
#include "common/memory_patcher.h"
|
||||||
#include "cheats_patches.h"
|
#include "cheats_patches.h"
|
||||||
#include "common/path_util.h"
|
#include "common/path_util.h"
|
||||||
#include "core/module.h"
|
#include "core/module.h"
|
||||||
#include "common/memory_patcher.h"
|
|
||||||
|
|
||||||
using namespace Common::FS;
|
using namespace Common::FS;
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "common/config.h"
|
#include "common/config.h"
|
||||||
|
#include "common/memory_patcher.h"
|
||||||
#include "core/file_sys/fs.h"
|
#include "core/file_sys/fs.h"
|
||||||
#include "emulator.h"
|
#include "emulator.h"
|
||||||
#include "game_install_dialog.h"
|
#include "game_install_dialog.h"
|
||||||
#include "main_window.h"
|
#include "main_window.h"
|
||||||
#include "common/memory_patcher.h"
|
|
||||||
|
|
||||||
// Custom message handler to ignore Qt logs
|
// Custom message handler to ignore Qt logs
|
||||||
void customMessageHandler(QtMsgType, const QMessageLogContext&, const QString&) {}
|
void customMessageHandler(QtMsgType, const QMessageLogContext&, const QString&) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user