summaryrefslogtreecommitdiff
path: root/src/core/reporter.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2019-11-28 11:43:17 -0500
committerGravatar GitHub2019-11-28 11:43:17 -0500
commite3ee017e91ef4d713f1af8cb60c5157e40d43f18 (patch)
treee0a5b47cac1d548599b8ceba7f71b40746fe6b48 /src/core/reporter.cpp
parentMerge pull request #3171 from lioncash/internal-link (diff)
parentcore/memory; Migrate over SetCurrentPageTable() to the Memory class (diff)
downloadyuzu-e3ee017e91ef4d713f1af8cb60c5157e40d43f18.tar.gz
yuzu-e3ee017e91ef4d713f1af8cb60c5157e40d43f18.tar.xz
yuzu-e3ee017e91ef4d713f1af8cb60c5157e40d43f18.zip
Merge pull request #3169 from lioncash/memory
core/memory: Deglobalize memory management code
Diffstat (limited to 'src/core/reporter.cpp')
-rw-r--r--src/core/reporter.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp
index 6f4af77fd..f95eee3b1 100644
--- a/src/core/reporter.cpp
+++ b/src/core/reporter.cpp
@@ -147,7 +147,7 @@ json GetFullDataAuto(const std::string& timestamp, u64 title_id, Core::System& s
147} 147}
148 148
149template <bool read_value, typename DescriptorType> 149template <bool read_value, typename DescriptorType>
150json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer) { 150json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer, Memory::Memory& memory) {
151 auto buffer_out = json::array(); 151 auto buffer_out = json::array();
152 for (const auto& desc : buffer) { 152 for (const auto& desc : buffer) {
153 auto entry = json{ 153 auto entry = json{
@@ -157,7 +157,7 @@ json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer) {
157 157
158 if constexpr (read_value) { 158 if constexpr (read_value) {
159 std::vector<u8> data(desc.Size()); 159 std::vector<u8> data(desc.Size());
160 Memory::ReadBlock(desc.Address(), data.data(), desc.Size()); 160 memory.ReadBlock(desc.Address(), data.data(), desc.Size());
161 entry["data"] = Common::HexToString(data); 161 entry["data"] = Common::HexToString(data);
162 } 162 }
163 163
@@ -167,7 +167,7 @@ json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer) {
167 return buffer_out; 167 return buffer_out;
168} 168}
169 169
170json GetHLERequestContextData(Kernel::HLERequestContext& ctx) { 170json GetHLERequestContextData(Kernel::HLERequestContext& ctx, Memory::Memory& memory) {
171 json out; 171 json out;
172 172
173 auto cmd_buf = json::array(); 173 auto cmd_buf = json::array();
@@ -177,10 +177,10 @@ json GetHLERequestContextData(Kernel::HLERequestContext& ctx) {
177 177
178 out["command_buffer"] = std::move(cmd_buf); 178 out["command_buffer"] = std::move(cmd_buf);
179 179
180 out["buffer_descriptor_a"] = GetHLEBufferDescriptorData<true>(ctx.BufferDescriptorA()); 180 out["buffer_descriptor_a"] = GetHLEBufferDescriptorData<true>(ctx.BufferDescriptorA(), memory);
181 out["buffer_descriptor_b"] = GetHLEBufferDescriptorData<false>(ctx.BufferDescriptorB()); 181 out["buffer_descriptor_b"] = GetHLEBufferDescriptorData<false>(ctx.BufferDescriptorB(), memory);
182 out["buffer_descriptor_c"] = GetHLEBufferDescriptorData<false>(ctx.BufferDescriptorC()); 182 out["buffer_descriptor_c"] = GetHLEBufferDescriptorData<false>(ctx.BufferDescriptorC(), memory);
183 out["buffer_descriptor_x"] = GetHLEBufferDescriptorData<true>(ctx.BufferDescriptorX()); 183 out["buffer_descriptor_x"] = GetHLEBufferDescriptorData<true>(ctx.BufferDescriptorX(), memory);
184 184
185 return out; 185 return out;
186} 186}
@@ -259,7 +259,7 @@ void Reporter::SaveUnimplementedFunctionReport(Kernel::HLERequestContext& ctx, u
259 const auto title_id = system.CurrentProcess()->GetTitleID(); 259 const auto title_id = system.CurrentProcess()->GetTitleID();
260 auto out = GetFullDataAuto(timestamp, title_id, system); 260 auto out = GetFullDataAuto(timestamp, title_id, system);
261 261
262 auto function_out = GetHLERequestContextData(ctx); 262 auto function_out = GetHLERequestContextData(ctx, system.Memory());
263 function_out["command_id"] = command_id; 263 function_out["command_id"] = command_id;
264 function_out["function_name"] = name; 264 function_out["function_name"] = name;
265 function_out["service_name"] = service_name; 265 function_out["service_name"] = service_name;