summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2018-02-13 21:39:58 -0500
committerGravatar bunnei2018-02-13 23:26:01 -0500
commit4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c (patch)
treed307c316428d67ca0676e3369328c87fe193371e
parentMerge pull request #187 from Subv/maxwell3d_query (diff)
downloadyuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.tar.gz
yuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.tar.xz
yuzu-4f8ee5e4562da3aa8678a42dd3b8d94f6c1a1f5c.zip
vi: Fix TransactParcelAuto to support both buffer formats.
-rw-r--r--src/core/hle/service/vi/vi.cpp41
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:
429 {0, &IHOSBinderDriver::TransactParcel, "TransactParcel"}, 429 {0, &IHOSBinderDriver::TransactParcel, "TransactParcel"},
430 {1, &IHOSBinderDriver::AdjustRefcount, "AdjustRefcount"}, 430 {1, &IHOSBinderDriver::AdjustRefcount, "AdjustRefcount"},
431 {2, &IHOSBinderDriver::GetNativeHandle, "GetNativeHandle"}, 431 {2, &IHOSBinderDriver::GetNativeHandle, "GetNativeHandle"},
432 {3, &IHOSBinderDriver::TransactParcelAuto, "TransactParcelAuto"}, 432 {3, &IHOSBinderDriver::TransactParcel, "TransactParcelAuto"},
433 }; 433 };
434 RegisterHandlers(functions); 434 RegisterHandlers(functions);
435 } 435 }
@@ -518,30 +518,21 @@ private:
518 u32 flags = rp.Pop<u32>(); 518 u32 flags = rp.Pop<u32>();
519 LOG_DEBUG(Service_VI, "called, transaction=%x", transaction); 519 LOG_DEBUG(Service_VI, "called, transaction=%x", transaction);
520 520
521 auto& input_buffer = ctx.BufferDescriptorA()[0]; 521 if (ctx.BufferDescriptorA()[0].Size() != 0) {
522 auto& output_buffer = ctx.BufferDescriptorB()[0]; 522 auto& input_buffer = ctx.BufferDescriptorA()[0];
523 std::vector<u8> input_data(input_buffer.Size()); 523 auto& output_buffer = ctx.BufferDescriptorB()[0];
524 Memory::ReadBlock(input_buffer.Address(), input_data.data(), input_buffer.Size()); 524 std::vector<u8> input_data(input_buffer.Size());
525 525 Memory::ReadBlock(input_buffer.Address(), input_data.data(), input_buffer.Size());
526 TransactParcel(id, transaction, input_data, output_buffer.Address(), output_buffer.Size()); 526 TransactParcel(id, transaction, input_data, output_buffer.Address(),
527 527 output_buffer.Size());
528 IPC::ResponseBuilder rb{ctx, 2}; 528 } else {
529 rb.Push(RESULT_SUCCESS); 529 auto& input_buffer = ctx.BufferDescriptorX()[0];
530 } 530 auto& output_buffer = ctx.BufferDescriptorC()[0];
531 531 std::vector<u8> input_data(input_buffer.size);
532 void TransactParcelAuto(Kernel::HLERequestContext& ctx) { 532 Memory::ReadBlock(input_buffer.Address(), input_data.data(), input_buffer.size);
533 IPC::RequestParser rp{ctx}; 533 TransactParcel(id, transaction, input_data, output_buffer.Address(),
534 u32 id = rp.Pop<u32>(); 534 output_buffer.Size());
535 auto transaction = static_cast<TransactionId>(rp.Pop<u32>()); 535 }
536 u32 flags = rp.Pop<u32>();
537 LOG_DEBUG(Service_VI, "called, transaction=%x", transaction);
538
539 auto& input_buffer = ctx.BufferDescriptorX()[0];
540 auto& output_buffer = ctx.BufferDescriptorC()[0];
541 std::vector<u8> input_data(input_buffer.size);
542 Memory::ReadBlock(input_buffer.Address(), input_data.data(), input_buffer.size);
543
544 TransactParcel(id, transaction, input_data, output_buffer.Address(), output_buffer.Size());
545 536
546 IPC::ResponseBuilder rb{ctx, 2}; 537 IPC::ResponseBuilder rb{ctx, 2};
547 rb.Push(RESULT_SUCCESS); 538 rb.Push(RESULT_SUCCESS);