core: Prepare various classes for memory read/write migration
Amends a few interfaces to be able to handle the migration over to the new Memory class by passing the class by reference as a function parameter where necessary. Notably, within the filesystem services, this eliminates two ReadBlock() calls by using the helper functions of HLERequestContext to do that for us.
This commit is contained in:
parent
fc7d0a17b6
commit
536fc7f0ea
24 changed files with 108 additions and 61 deletions
|
@ -147,7 +147,7 @@ json GetFullDataAuto(const std::string& timestamp, u64 title_id, Core::System& s
|
|||
}
|
||||
|
||||
template <bool read_value, typename DescriptorType>
|
||||
json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer) {
|
||||
json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer, Memory::Memory& memory) {
|
||||
auto buffer_out = json::array();
|
||||
for (const auto& desc : buffer) {
|
||||
auto entry = json{
|
||||
|
@ -167,7 +167,7 @@ json GetHLEBufferDescriptorData(const std::vector<DescriptorType>& buffer) {
|
|||
return buffer_out;
|
||||
}
|
||||
|
||||
json GetHLERequestContextData(Kernel::HLERequestContext& ctx) {
|
||||
json GetHLERequestContextData(Kernel::HLERequestContext& ctx, Memory::Memory& memory) {
|
||||
json out;
|
||||
|
||||
auto cmd_buf = json::array();
|
||||
|
@ -177,10 +177,10 @@ json GetHLERequestContextData(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
out["command_buffer"] = std::move(cmd_buf);
|
||||
|
||||
out["buffer_descriptor_a"] = GetHLEBufferDescriptorData<true>(ctx.BufferDescriptorA());
|
||||
out["buffer_descriptor_b"] = GetHLEBufferDescriptorData<false>(ctx.BufferDescriptorB());
|
||||
out["buffer_descriptor_c"] = GetHLEBufferDescriptorData<false>(ctx.BufferDescriptorC());
|
||||
out["buffer_descriptor_x"] = GetHLEBufferDescriptorData<true>(ctx.BufferDescriptorX());
|
||||
out["buffer_descriptor_a"] = GetHLEBufferDescriptorData<true>(ctx.BufferDescriptorA(), memory);
|
||||
out["buffer_descriptor_b"] = GetHLEBufferDescriptorData<false>(ctx.BufferDescriptorB(), memory);
|
||||
out["buffer_descriptor_c"] = GetHLEBufferDescriptorData<false>(ctx.BufferDescriptorC(), memory);
|
||||
out["buffer_descriptor_x"] = GetHLEBufferDescriptorData<true>(ctx.BufferDescriptorX(), memory);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ void Reporter::SaveUnimplementedFunctionReport(Kernel::HLERequestContext& ctx, u
|
|||
const auto title_id = system.CurrentProcess()->GetTitleID();
|
||||
auto out = GetFullDataAuto(timestamp, title_id, system);
|
||||
|
||||
auto function_out = GetHLERequestContextData(ctx);
|
||||
auto function_out = GetHLERequestContextData(ctx, system.Memory());
|
||||
function_out["command_id"] = command_id;
|
||||
function_out["function_name"] = name;
|
||||
function_out["service_name"] = service_name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue