summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc/svc_debug_string.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/svc/svc_debug_string.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc/svc_debug_string.cpp b/src/core/hle/kernel/svc/svc_debug_string.cpp
new file mode 100644
index 000000000..4c14ce668
--- /dev/null
+++ b/src/core/hle/kernel/svc/svc_debug_string.cpp
@@ -0,0 +1,30 @@
+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "core/core.h"
+#include "core/hle/kernel/k_thread.h"
+#include "core/hle/kernel/svc.h"
+#include "core/memory.h"
+
+namespace Kernel::Svc {
+
+/// Used to output a message on a debug hardware unit - does nothing on a retail unit
+Result OutputDebugString(Core::System& system, u64 address, u64 len) {
+ R_SUCCEED_IF(len == 0);
+
+ std::string str(len, '\0');
+ GetCurrentMemory(system.Kernel()).ReadBlock(address, str.data(), str.size());
+ LOG_DEBUG(Debug_Emulated, "{}", str);
+
+ R_SUCCEED();
+}
+
+Result OutputDebugString64(Core::System& system, uint64_t debug_str, uint64_t len) {
+ R_RETURN(OutputDebugString(system, debug_str, len));
+}
+
+Result OutputDebugString64From32(Core::System& system, uint32_t debug_str, uint32_t len) {
+ R_RETURN(OutputDebugString(system, debug_str, len));
+}
+
+} // namespace Kernel::Svc