mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-02 04:38:28 -06:00
Merge branch 'main' into user_and_settings
This commit is contained in:
commit
164dba99e3
1
dist/net.shadps4.shadPS4.metainfo.xml
vendored
1
dist/net.shadps4.shadPS4.metainfo.xml
vendored
@ -11,6 +11,7 @@
|
|||||||
<project_license translate="no">GPL-2.0</project_license>
|
<project_license translate="no">GPL-2.0</project_license>
|
||||||
<launchable type="desktop-id" translate="no">net.shadps4.shadPS4.desktop</launchable>
|
<launchable type="desktop-id" translate="no">net.shadps4.shadPS4.desktop</launchable>
|
||||||
<url type="homepage" translate="no">https://shadps4.net/</url>
|
<url type="homepage" translate="no">https://shadps4.net/</url>
|
||||||
|
<url type="vcs-browser" translate="no">https://github.com/shadps4-emu/shadPS4</url>
|
||||||
<description>
|
<description>
|
||||||
<p>shadPS4 is an early PlayStation 4 emulator for Windows, Linux and macOS written in C++.</p>
|
<p>shadPS4 is an early PlayStation 4 emulator for Windows, Linux and macOS written in C++.</p>
|
||||||
<p>The emulator is still early in development, so don't expect a flawless experience. Nonetheless, the emulator can already run a number of commercial games.</p>
|
<p>The emulator is still early in development, so don't expect a flawless experience. Nonetheless, the emulator can already run a number of commercial games.</p>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2014 Citra Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2014 Citra Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@ -98,6 +99,7 @@ private:
|
|||||||
std::size_t bytes_written = 0;
|
std::size_t bytes_written = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
/**
|
/**
|
||||||
* Backend that writes to Visual Studio's output window
|
* Backend that writes to Visual Studio's output window
|
||||||
*/
|
*/
|
||||||
@ -108,15 +110,14 @@ public:
|
|||||||
~DebuggerBackend() = default;
|
~DebuggerBackend() = default;
|
||||||
|
|
||||||
void Write(const Entry& entry) {
|
void Write(const Entry& entry) {
|
||||||
#ifdef _WIN32
|
|
||||||
::OutputDebugStringW(UTF8ToUTF16W(FormatLogMessage(entry).append(1, '\n')).c_str());
|
::OutputDebugStringW(UTF8ToUTF16W(FormatLogMessage(entry).append(1, '\n')).c_str());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Flush() {}
|
void Flush() {}
|
||||||
|
|
||||||
void EnableForStacktrace() {}
|
void EnableForStacktrace() {}
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
bool initialization_in_progress_suppress_logging = true;
|
bool initialization_in_progress_suppress_logging = true;
|
||||||
|
|
||||||
@ -221,6 +222,7 @@ public:
|
|||||||
.line_num = line_num,
|
.line_num = line_num,
|
||||||
.function = function,
|
.function = function,
|
||||||
.message = std::move(message),
|
.message = std::move(message),
|
||||||
|
.thread = Common::GetCurrentThreadName(),
|
||||||
};
|
};
|
||||||
if (EmulatorSettings::GetInstance()->GetLogType() == "async") {
|
if (EmulatorSettings::GetInstance()->GetLogType() == "async") {
|
||||||
message_queue.EmplaceWait(entry);
|
message_queue.EmplaceWait(entry);
|
||||||
@ -268,7 +270,9 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ForEachBackend(auto lambda) {
|
void ForEachBackend(auto lambda) {
|
||||||
// lambda(debugger_backend);
|
#ifdef _WIN32
|
||||||
|
lambda(debugger_backend);
|
||||||
|
#endif
|
||||||
lambda(color_console_backend);
|
lambda(color_console_backend);
|
||||||
lambda(file_backend);
|
lambda(file_backend);
|
||||||
}
|
}
|
||||||
@ -281,7 +285,9 @@ private:
|
|||||||
static inline bool should_append{false};
|
static inline bool should_append{false};
|
||||||
|
|
||||||
Filter filter;
|
Filter filter;
|
||||||
|
#ifdef _WIN32
|
||||||
DebuggerBackend debugger_backend{};
|
DebuggerBackend debugger_backend{};
|
||||||
|
#endif
|
||||||
ColorConsoleBackend color_console_backend{};
|
ColorConsoleBackend color_console_backend{};
|
||||||
FileBackend file_backend;
|
FileBackend file_backend;
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ struct Entry {
|
|||||||
u32 line_num = 0;
|
u32 line_num = 0;
|
||||||
std::string function;
|
std::string function;
|
||||||
std::string message;
|
std::string message;
|
||||||
|
std::string thread;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Common::Log
|
} // namespace Common::Log
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/logging/log_entry.h"
|
#include "common/logging/log_entry.h"
|
||||||
#include "common/logging/text_formatter.h"
|
#include "common/logging/text_formatter.h"
|
||||||
#include "common/thread.h"
|
|
||||||
|
|
||||||
namespace Common::Log {
|
namespace Common::Log {
|
||||||
|
|
||||||
@ -25,9 +24,8 @@ std::string FormatLogMessage(const Entry& entry) {
|
|||||||
const char* class_name = GetLogClassName(entry.log_class);
|
const char* class_name = GetLogClassName(entry.log_class);
|
||||||
const char* level_name = GetLevelName(entry.log_level);
|
const char* level_name = GetLevelName(entry.log_level);
|
||||||
|
|
||||||
return fmt::format("[{}] <{}> ({}) {}:{} {}: {}", class_name, level_name,
|
return fmt::format("[{}] <{}> ({}) {}:{} {}: {}", class_name, level_name, entry.thread,
|
||||||
Common::GetCurrentThreadName(), entry.filename, entry.line_num,
|
entry.filename, entry.line_num, entry.function, entry.message);
|
||||||
entry.function, entry.message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintMessage(const Entry& entry) {
|
void PrintMessage(const Entry& entry) {
|
||||||
|
|||||||
@ -51,14 +51,14 @@ std::string convertValueToHex(const std::string type, const std::string valueStr
|
|||||||
uint32_t i;
|
uint32_t i;
|
||||||
} floatUnion;
|
} floatUnion;
|
||||||
floatUnion.f = std::stof(valueStr);
|
floatUnion.f = std::stof(valueStr);
|
||||||
result = toHex(floatUnion.i, sizeof(floatUnion.i));
|
result = toHex(std::byteswap(floatUnion.i), sizeof(floatUnion.i));
|
||||||
} else if (type == "float64") {
|
} else if (type == "float64") {
|
||||||
union {
|
union {
|
||||||
double d;
|
double d;
|
||||||
uint64_t i;
|
uint64_t i;
|
||||||
} doubleUnion;
|
} doubleUnion;
|
||||||
doubleUnion.d = std::stod(valueStr);
|
doubleUnion.d = std::stod(valueStr);
|
||||||
result = toHex(doubleUnion.i, sizeof(doubleUnion.i));
|
result = toHex(std::byteswap(doubleUnion.i), sizeof(doubleUnion.i));
|
||||||
} else if (type == "utf8") {
|
} else if (type == "utf8") {
|
||||||
std::vector<unsigned char> byteArray =
|
std::vector<unsigned char> byteArray =
|
||||||
std::vector<unsigned char>(valueStr.begin(), valueStr.end());
|
std::vector<unsigned char>(valueStr.begin(), valueStr.end());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user