From 3c0113632dc4fb4e55b5dad9278a5b766dcaec14 Mon Sep 17 00:00:00 2001
From: Subv <subv2112@gmail.com>
Date: Wed, 4 Oct 2017 11:52:39 -0500
Subject: [PATCH] SVC: Replace GetPointer usage with ReadBlock in
 OutputDebugString.

---
 src/core/hle/function_wrappers.h | 4 ++--
 src/core/hle/svc.cpp             | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index cd500e83da..cb0b430ee9 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -267,9 +267,9 @@ void Wrap() {
     func(((s64)PARAM(1) << 32) | PARAM(0));
 }
 
-template <void func(const char*, int len)>
+template <void func(VAddr, int len)>
 void Wrap() {
-    func((char*)Memory::GetPointer(PARAM(0)), PARAM(1));
+    func(PARAM(0), PARAM(1));
 }
 
 template <void func(u8)>
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 61360bedeb..37eeeb860b 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -619,8 +619,10 @@ static void Break(u8 break_reason) {
 }
 
 /// Used to output a message on a debug hardware unit - does nothing on a retail unit
-static void OutputDebugString(const char* string, int len) {
-    LOG_DEBUG(Debug_Emulated, "%.*s", len, string);
+static void OutputDebugString(VAddr address, int len) {
+    std::vector<char> string(len);
+    Memory::ReadBlock(address, string.data(), len);
+    LOG_DEBUG(Debug_Emulated, "%.*s", len, string.data());
 }
 
 /// Get resource limit