diff options
Diffstat (limited to 'src/core/hle/kernel/svc/svc_debug_string.cpp')
-rw-r--r-- | src/core/hle/kernel/svc/svc_debug_string.cpp | 29 |
1 files changed, 29 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..d4bf062d1 --- /dev/null +++ b/src/core/hle/kernel/svc/svc_debug_string.cpp @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/core.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, VAddr address, u64 len) { + R_SUCCEED_IF(len == 0); + + std::string str(len, '\0'); + system.Memory().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 |