diff options
author | bunnei <bunneidev@gmail.com> | 2018-02-14 03:39:58 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-02-14 05:26:01 +0100 |
commit | 4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c (patch) | |
tree | d307c316428d67ca0676e3369328c87fe193371e | |
parent | Merge pull request #187 from Subv/maxwell3d_query (diff) | |
download | yuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.tar yuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.tar.gz yuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.tar.bz2 yuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.tar.lz yuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.tar.xz yuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.tar.zst yuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.zip |
-rw-r--r-- | src/core/hle/service/vi/vi.cpp | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 8b4ed30d2..55f196ab0 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -429,7 +429,7 @@ public: {0, &IHOSBinderDriver::TransactParcel, "TransactParcel"}, {1, &IHOSBinderDriver::AdjustRefcount, "AdjustRefcount"}, {2, &IHOSBinderDriver::GetNativeHandle, "GetNativeHandle"}, - {3, &IHOSBinderDriver::TransactParcelAuto, "TransactParcelAuto"}, + {3, &IHOSBinderDriver::TransactParcel, "TransactParcelAuto"}, }; RegisterHandlers(functions); } @@ -518,30 +518,21 @@ private: u32 flags = rp.Pop<u32>(); LOG_DEBUG(Service_VI, "called, transaction=%x", transaction); - auto& input_buffer = ctx.BufferDescriptorA()[0]; - auto& output_buffer = ctx.BufferDescriptorB()[0]; - std::vector<u8> input_data(input_buffer.Size()); - Memory::ReadBlock(input_buffer.Address(), input_data.data(), input_buffer.Size()); - - TransactParcel(id, transaction, input_data, output_buffer.Address(), output_buffer.Size()); - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); - } - - void TransactParcelAuto(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - u32 id = rp.Pop<u32>(); - auto transaction = static_cast<TransactionId>(rp.Pop<u32>()); - u32 flags = rp.Pop<u32>(); - LOG_DEBUG(Service_VI, "called, transaction=%x", transaction); - - auto& input_buffer = ctx.BufferDescriptorX()[0]; - auto& output_buffer = ctx.BufferDescriptorC()[0]; - std::vector<u8> input_data(input_buffer.size); - Memory::ReadBlock(input_buffer.Address(), input_data.data(), input_buffer.size); - - TransactParcel(id, transaction, input_data, output_buffer.Address(), output_buffer.Size()); + if (ctx.BufferDescriptorA()[0].Size() != 0) { + auto& input_buffer = ctx.BufferDescriptorA()[0]; + auto& output_buffer = ctx.BufferDescriptorB()[0]; + std::vector<u8> input_data(input_buffer.Size()); + Memory::ReadBlock(input_buffer.Address(), input_data.data(), input_buffer.Size()); + TransactParcel(id, transaction, input_data, output_buffer.Address(), + output_buffer.Size()); + } else { + auto& input_buffer = ctx.BufferDescriptorX()[0]; + auto& output_buffer = ctx.BufferDescriptorC()[0]; + std::vector<u8> input_data(input_buffer.size); + Memory::ReadBlock(input_buffer.Address(), input_data.data(), input_buffer.size); + TransactParcel(id, transaction, input_data, output_buffer.Address(), + output_buffer.Size()); + } IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); |